Skip to content

Add platform integration: login, link, push, and status commands#6

Open
marwaneltoukhy wants to merge 1 commit intomainfrom
feature/cli-platform-integration
Open

Add platform integration: login, link, push, and status commands#6
marwaneltoukhy wants to merge 1 commit intomainfrom
feature/cli-platform-integration

Conversation

@marwaneltoukhy
Copy link
Contributor

Summary

  • Browser-based OAuth login (cf login): Opens Cognito hosted UI, captures auth code via localhost callback with PKCE, exchanges for a long-lived cfk_live_ API key stored in ~/.chipfoundry-cli/config.toml
  • New commands: cf logout, cf whoami, cf link, cf unlink for authentication and project association management
  • Extended cf push: On first push, prompts to create a new platform project, link to an existing one, or skip. Supports --create-project, --shuttle, --link-project, --skip-platform flags for CI/non-interactive use
  • Extended cf status: Shows platform project status panel (name, status, shuttle, design type, review notes), --all flag to list all projects, --json for machine-readable output, graceful degradation when offline

New files

File Description
chipfoundry_cli/api.py PlatformAPI HTTP client -- wraps all backend REST calls with API key auth
chipfoundry_cli/auth.py Browser OAuth flow -- local HTTP server, PKCE, Cognito redirect, API key exchange

Modified files

File Change
chipfoundry_cli/main.py New commands (login, logout, whoami, link, unlink) and extended push/status
chipfoundry_cli/utils.py API key/URL helpers, platform project ID read/write, config file permissions

Dependencies

Requires chipignite-backend-services#13 for the /auth/cli/ and portal OAuth callback endpoints.

Test plan

  • cf login -- browser opens, authenticate, key saved to config.toml
  • cf whoami -- displays user info panel
  • cf logout / cf logout --revoke -- removes key locally / revokes on server
  • cf init -- remains local-only, shows platform hint
  • cf push (first push) -- prompts to create/link/skip platform project
  • cf push --create-project --shuttle <slug> -- non-interactive creation
  • cf push --skip-platform -- SFTP only
  • cf link / cf link --id <uuid> / cf link --name <name> -- links local project
  • cf unlink -- removes platform_project_id from project.json
  • cf status -- shows platform panel + SFTP status
  • cf status --all -- lists all platform projects in table
  • cf status --json -- JSON output
  • cf status (logged out) -- graceful degradation, no crash

Made with Cursor

Browser-based OAuth login flow (cf login) that obtains a long-lived
cfk_live_ API key via PKCE and localhost callback. New commands:

- cf login/logout/whoami -- authenticate with the ChipFoundry platform
- cf link/unlink -- connect local projects to platform projects
- cf push -- extended to create/link platform projects on first push
- cf status -- extended with platform project panel, --all, --json flags

New modules: api.py (PlatformAPI client), auth.py (browser OAuth flow).
Updated utils.py with API key and platform project ID helpers.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant