CLI v0.1: auth, projects, branches, secrets, deploy, governance, observe

Merged
JW
4mo ago
+3201-0

The insta CLI — a thin client of the platform control-plane API (Node + TS + commander).

Commands

  • auth: login/logout/status (email+password, automatic token refresh)
  • org, project (create/list/link/delete), branch (create/list/switch/delete)
  • secrets (the seam → .env), deploy, manifest, events
  • governance: approvals (list/approve/deny), policy (get/set)
  • observe — local credential-audit hook (scanner detects AWS/GitHub/Stripe/LLM/DB/JWT/keys, emits redacted fingerprints; auto-installed on project create/link; report/sync into the project timeline)

Verification

11 unit tests; verified end-to-end against the platform dev:fake server (signup → login → project create → secrets → branch clone → deploy → events → delete-with-approval) and the observe hook (HIGH exposure detected, secret stayed redacted).

🤖 Generated with Claude Code


Summary by cubic

Introduce the initial insta CLI v0.1, a thin client for the control-plane API with auth, projects, branches, secrets, deploy, governance, and a local observe hook for credential audits. Improves developer and agent workflows with simple commands, token refresh, and approval handling.

  • New Features

    • Core commands: auth (login/logout/status), org (list/create), project (create/list/link/delete), branch (create/list/switch/delete)
    • Secrets: fetch the credential bundle and write to .env or print as JSON; handles approval-gated responses
    • Deploy: push an image to a branch/group/port; outputs URL; approval-gated actions prompt next steps
    • Manifest and events: environment/resource view and project timeline
    • Governance: approvals (list/approve/deny) and policy (get/set)
    • Observe: install/uninstall/report/sync; scans tool-use for AWS/GitHub/Stripe/LLM/DB/JWT/private-key patterns; writes redacted findings to ./.insta/audit.jsonl; auto-install on project create/link (best effort)
    • Config: global in ~/.insta/config.json, project in ./.insta/project.json; API URL override via INSTA_API_URL or --api-url
    • Implementation: Node 20 + TypeScript (ESM) with commander; tests cover .env serialization, approval handling, and the scanner
  • Migration

    • Install: npm install && npm run build; run insta --help
    • Login and set API URL if needed: insta login --email --password --api-url <url>
    • Create and link a project: insta project create <name>; secrets to .env via insta secrets
    • Deploy: insta deploy --image <registry/img>; if gated, approve with insta approvals approve <id>
    • Enable observe: insta observe install; view insta observe report; sync with insta observe sync