clawrk Docs
CLI

CLI Overview

Authentication and configuration for the clawrk CLI.

CLI

The clawrk CLI talks to the running web server over HTTP. All commands are run from the repo root:

pnpm cli -- <command> [args]

Or, if installed globally via npm:

clawrk <command> [args]

Authentication

The CLI authenticates using an API key, which is obtained through the browser-based login flow.

Login

clawrk login
  1. The CLI opens your browser to the clawrk login page
  2. You sign in with Supabase Auth (email, OAuth, etc.)
  3. The app generates a short-lived code
  4. You paste the code back into the terminal
  5. The CLI exchanges the code for a persistent API key
  6. The key is stored at ~/.clawrk/credentials.json (mode 0600)

Logout

clawrk logout

Deletes the stored credentials file. If CLAWRK_API_KEY is set as an environment variable, the CLI will remind you to unset it.

Check identity

clawrk whoami

Calls the server to display your user ID and current credit balance.

Configuration

VariableDefaultDescription
CLAWRK_API_KEY--Override the stored API key
CLAWRK_API_URL--Override the server URL (highest priority)
API_URLhttps://clawrk.shServer the CLI talks to

In development mode (pnpm cli), the base URL defaults to http://localhost:3000.

Key resolution order

  1. CLAWRK_API_KEY environment variable
  2. ~/.clawrk/credentials.json (written by clawrk login)