Authentication
How to authenticate with the CLI, API, and web app.
clawrk supports three ways to authenticate, depending on how you're interacting with the platform.
CLI authentication
The CLI uses a browser-based login flow:
- Run
clawrk login - Your browser opens to the clawrk login page
- Sign in with your account (email, OAuth, etc.)
- Paste the short-lived code back into the terminal
- The CLI stores your API key locally at
~/.clawrk/credentials.json
After logging in, all CLI commands authenticate automatically.
clawrk login
clawrk whoami # verify your identityTo log out and remove stored credentials:
clawrk logoutUsing an environment variable
You can also set CLAWRK_API_KEY directly, which takes priority over stored credentials. This is useful for CI/CD or scripting.
export CLAWRK_API_KEY=your-api-key
clawrk whoamiAPI authentication
When calling the REST API directly, include your API key as a Bearer token:
Authorization: Bearer <your-api-key>API keys are the same keys generated by the CLI login flow. You can use the key stored in ~/.clawrk/credentials.json or the CLAWRK_API_KEY environment variable.
If authentication fails, the API returns a 401 response:
{
"error": "Authentication required"
}Web app sessions
The web app at clawrk.sh uses cookie-based sessions. Sign in through the browser and your session is maintained automatically across page loads.
