C

Cosmic CLI

CLI discovered

Details
Command
cosmic
Docs
https://www.npmjs.com/package/@cosmicjs/cli
Authentication
Personal Access Token bearer discovered Get token ↗
$ cosmic login --token cos_YOUR_TOKEN

Open Account Settings → API Tokens in the Cosmic dashboard and create a token. Tokens use the cos_ prefix and carry your full account permissions. This is the recommended auth for scripts, CI/CD, CLI login with --token, and dashboard-level API access.

Agent key bearer discovered Get token ↗
$ cosmic agent-signup --email <email> --project <name> --agent-id <id>; cosmic agent-verify <code>; cosmic agent-status

Create an agent-scoped signup session by calling `POST /v3/agents/sign-up` on https://dapi.cosmicjs.com. The response includes an agent_key with the agk_ prefix. Store it securely; it authenticates only the agent-flow endpoints and MCP agent scope.

Bucket read key $ cosmic use --bucket=<bucket> --read-key=<read-key> --write-key=<write-key> + Bucket read key $ cosmic use --bucket=<bucket> --read-key=<read-key> --write-key=<write-key> discovered
Bucket read key api_key Get key ↗

Log in to the Cosmic dashboard, open your bucket, then go to Settings → API Access to copy the bucket slug and read_key. This key is for read-only bucket access.