Docs

Contexts

A context names the host crab talks to and the session it uses there — the local host, Cloud as you, or Cloud as an API key for an org.

Every command talks to the host its context names.

Context Host
default The local host on this machine, http://127.0.0.1:7777. Always there, and cannot be replaced.
cloud Cloud, once crab login has run.

Switching

crab context ls
crab context use default
crab --context cloud ls
  • crab context use <name> switches every later command; --context <name> switches one. With none in use, crab talks to default.
  • --org <org> acts for an org, by handle or id, in place of the context's account.
  • crab status says where crab is talking, as whom, and on which plan.

Signing in

crab login
crab login --device
  • crab login keeps its session as the context cloud; --name keeps it under another name. crab logout forgets it.
  • --device, or a machine where no browser opens, requests a dedicated agent key. It prints a link and a code and waits while a person signed in to CrabTalk reviews the connection name, account, permissions and daily budget. The code lasts 30 minutes. The approved key is kept in the context and managed under Settings → API keys; normal browser login keeps a personal session.
  • Agent keys initially request the standard read permissions and a $5 daily budget. The approver can change both. Priced services require their own grants; session-only operations remain unavailable. Reconnect existing agent sessions to obtain a dedicated key, then revoke the old session under Settings → Security.

Agent setup

For an agent with shell access:

  1. Run crab --version. If the command is unavailable, install the public CLI and ensure its installation directory is on PATH.
  2. Run crab --context cloud status. If it succeeds and shows the intended account, reuse that connection. If the context is missing or authentication is required, run crab login --device.
  3. For device sign-in, give the person the printed approval link and code, and keep the login process running while they approve. The sign-in and credential details are under Signing in.
  4. After login succeeds, run crab --context cloud status again. Confirm the Cloud host is answering and the intended account is shown before reporting CLI setup complete.

If a step fails, report the command and error. This verifies CLI access; connect the host's MCP client separately when the task needs native MCP tools.

With an API key

crab key create ci
crab context add ci https://api.crabtalk.ai --token-stdin --org <org>
  • crab context add keeps a Cloud context for an API key read from stdin. --user <user> in place of --org deploys under a person.
  • --json prints JSON, and is on whenever stdout is not a terminal. A command that asks for confirmation refuses without a terminal unless --yes is given.

Contexts are kept in ~/.crab/contexts.toml, readable by its owner alone.

Image destination

By default, images upload directly to the context's host. Add --registry to use an OCI registry for that context:

crab context add local http://localhost:7777 --registry localhost:5001
crab --context local deploy

crab deploy --build --registry <registry> overrides it for one source deployment. image = "owner/service" in crab.toml identifies the published artifact; the context's registry selects optional OCI transport for source builds. crab publish targets the account in image, using the context's server and credentials. Published-image deployment instead uses the selected context's account as its destination.