autopilot CLIThe autopilot CLI is the command-line companion to Autopilot's Secrets feature. Use it to pull decrypted secret files into a local directory — typically your project root or a CI workspace — without copying anything by hand.
The clever bit: the CLI itself never sees your encryption key. It opens a browser, the browser does the WebAuthn PRF + decryption, and the plaintext is delivered to the CLI over a one-shot loopback HTTP server.
The CLI lives in cli/ in the github-pm repository. Build it with Go (1.21+):
cd cli
go install ./cmd/autopilotThis places an autopilot binary in $(go env GOPATH)/bin. Make sure that's on your PATH.
The CLI authenticates to the rxlab identity provider as a public OAuth PKCE client. You need an OAuth client_id registered for the CLI, which you can set via:
${UserConfigDir}/autopilot/config.env (per-user file).env in your current working directoryThe minimum is:
export AUTOPILOT_CLIENT_ID=autopilot-cli-prodFor a persistent setup, drop a config.env next to your other tool configs:
# macOS: ~/Library/Application Support/autopilot/config.env
# Linux: ~/.config/autopilot/config.env
# Windows: %AppData%\autopilot\config.env
AUTOPILOT_CLIENT_ID=autopilot-cli-prod
AUTOPILOT_AUTH_ISSUER=https://auth.rxlab.app
AUTOPILOT_BASE_URL=https://autopilot.rxlab.appautopilot loginThis runs OAuth 2.0 Authorization Code with PKCE:
http://127.0.0.1:<port>/callback with a code.{access_token, refresh_token, id_token}.${UserConfigDir}/autopilot/credentials.json with mode 0600. Refresh is automatic when within 60 seconds of expiry.To sign out and revoke your refresh token:
autopilot logoutJust run:
autopilotwith no arguments. You get a Bubble Tea TUI that walks you through:
Sign in → Feature menu → Repository → Environment → Download (all files / single file)
Keys: ↑/↓ to move, Enter to select, Esc to go back, / to filter, q to quit.
The TUI is the recommended path day-to-day; subcommands below exist for scripting.
# List all secrets-enabled repositories you have access to.
autopilot secrets list
# List environments inside a specific repository.
autopilot secrets list owner/repoIf you run autopilot secrets list from inside a git working tree whose remote matches a known repository, that repo is highlighted as (current repo).
Pull every file in an environment to the current directory:
autopilot secrets download owner/repo --env devCommon flags:
| Flag | Default | What it does |
|---|---|---|
--env <name> | (required) | Environment to pull from. |
--out <dir> | . | Where to write files. |
--file <name> | (none) | Pull only this single filename. |
--force | off | Overwrite existing files. Without it, the CLI refuses to clobber. |
--timeout <duration> | 2m | Browser handoff timeout (e.g. 5m, 30s). |
Examples:
# Pull only .env into ./.env.d, overwriting if needed.
autopilot secrets download owner/repo --env prod --file .env --out ./.env.d --force
# Allow up to 5 minutes for the browser flow if you're on a slow auth setup.
autopilot secrets download owner/repo --env staging --timeout 5mThe CLI cannot perform WebAuthn PRF itself, so it brokers decryption through the browser you're already signed in to:
127.0.0.1:<random-port> and generates a 256-bit nonce.${AUTOPILOT_BASE_URL}/dashboard/secrets/cli-decrypt?repo=…&env=…&port=…&nonce=… in your default browser.http://127.0.0.1:<port>/callback with the nonce.--out with mode 0600, and exits.The browser tab tells you "Done — you can close this tab" when it's finished.
127.0.0.1 only and reject non-loopback connections.id_token claims (nonce, iss, aud, exp) are verified locally; the token itself is fetched directly from the IdP's token endpoint over TLS (RFC 8252 §7).credentials.json is written with mode 0600; the CLI refuses to load it if the mode is laxer.0600 and the CLI refuses to overwrite existing files unless you pass --force. Filenames containing .. or starting with / are rejected."Passkey PRF unavailable" — your passkey or browser doesn't return a PRF result. Re-register the passkey on auth.rxlab.app with a PRF-capable authenticator (TouchID, FaceID, hardware key, 1Password, iCloud Keychain on iOS 17+).
Browser doesn't open — set BROWSER to your preferred command, or open the URL the CLI prints manually.
"You don't have a key for this environment" — someone with access to that environment needs to add you as a member from the Secrets dashboard before you can pull files.
CI usage — the CLI is interactive by design (it requires WebAuthn PRF), so it's not suitable for headless CI. For CI, fetch secrets through GitHub Actions encrypted secrets or a secrets manager that supports machine credentials. Autopilot Secrets is a developer-laptop and shared-environment tool.