Login
Connect the CLI to your contract.dev account.
contract.dev loginThe CLI prints a one-time code and opens the browser at the activation page. Approving there mints an API key bound to your account, saved to ~/.contract.dev/credentials.json.
One-time code: ABCD-1234
Opening https://app.contract.dev/activate?code=ABCD-1234
Waiting for approval...
Logged in as you@example.com| Flag | Description |
|---|---|
--no-browser | Print the activation URL instead of opening the browser. |
--api-url <url> | Sign in against another deployment (e.g. http://localhost:3000). |
whoami
Show which account and workspace the CLI acts as, and where the credentials come from:
contract.dev whoamiyou@example.com (workspace: Acme)
Auth: ~/.contract.dev/credentials.json → https://app.contract.devlogout
Delete the saved credentials:
contract.dev logoutCI environments
Skip the browser flow in CI by setting environment variables instead:
| Variable | Description |
|---|---|
CONTRACT_DEV_API_KEY | API key used for authentication. Takes precedence over saved credentials. |
CONTRACT_DEV_WORKSPACE | Workspace (id or slug) to act on. |
CONTRACT_DEV_STAGENET | Stagenet (name or id) for stagenet commands. |
CONTRACT_DEV_RPC_URL | Direct stagenet RPC URL — stagenet commands work with this alone, no login needed. |
A stagenet’s RPC URL is a connection string, not a credential — it lets you talk to that stagenet’s chain, but never grants access to your account or workspace.
Last updated on