Skip to main content
ancha login connects the CLI to your hosted workspace at app.ancha.io. You approve the computer in your browser, and the CLI saves an API key for it. After that, ancha run keeps running your agent on your computer, while the tools and their data run in your workspace. The first line of every run says so.

Example

Output
The browser opens a page titled Allow this computer? with your computer’s name and the same code. Sign in first if it asks you to. Check that the codes match, then click Approve. The CLI finishes:
Output
On a machine without a browser, use --no-browser and open the printed link anywhere you are signed in.

What it saves

Approving creates an API key named after your computer. You can see and revoke it under Settings in the console. The CLI saves it with the workspace URL in ~/.config/ancha/credentials.json, readable only by you. XDG_CONFIG_HOME or ANCHA_CREDENTIALS_FILE move the file. ANCHA_API_KEY in the environment takes precedence over the file.

After signing in

  • ancha whoami shows the workspace commands use; ancha whoami --verify also checks that the server accepts the key.
  • ancha run, ancha doctor and ancha world up start with running on hosted https://app.ancha.io/t/<workspace> (from ancha login; --local to run here).
  • --local on any command uses a server on this computer instead, for one command. ancha logout forgets the login.
  • A key the server rejects fails the command with AUTH_INVALID and exit 2. Run ancha login again.

Errors

For CI, skip login and set ANCHA_SERVER_URL and ANCHA_API_KEY. See Login and API keys and CI.