feat(cli): add --token flag and fetch projects for agent-friendly setup#1
Open
caffeinum wants to merge 3 commits into
Open
feat(cli): add --token flag and fetch projects for agent-friendly setup#1caffeinum wants to merge 3 commits into
caffeinum wants to merge 3 commits into
Conversation
Enables AI coding agents to use the PowerSync CLI end-to-end without visiting the dashboard: - Add reusable --token flag on all Cloud commands (inherited via CloudInstanceCommand.baseFlags) plus fetch instances. Precedence: --token > PS_ADMIN_TOKEN env > keychain/stored token. Implemented via a process-wide override store mirroring cli-client-headers. - Add fetch projects command to list Cloud projects the token can access (id, name, org, instance count). Supports --output=json for piping into jq. Removes the "extract project-id from dashboard URL" step. - Improve not-authenticated error: lists all three auth methods (--token flag, PS_ADMIN_TOKEN env, powersync login) and links to the PAT creation page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enables AI agents and CI scripts to persist a PAT without going through the interactive browser/password flow. When --token is passed, all prompts are skipped and the token is stored via the same AuthenticationService path as interactive login. Safety: on platforms without secure storage, --token alone errors out pointing to PS_ADMIN_TOKEN or --force-insecure. This prevents silently writing plaintext tokens to disk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent-experience (AX) improvements to the PowerSync CLI so AI coding agents can complete zero-to-deployed integrations without hitting the dashboard.
Motivation: our eval data shows only ~23% of AI-agent attempts at PowerSync+Supabase integration successfully deploy. Two specific CLI gaps cause most failures — no way to authenticate inline, and no way to discover project IDs without parsing dashboard URLs.
Changes
Test plan
Commits