Skip to Content
CLILogin

Login

Connect the CLI to your contract.dev account.

contract.dev login

The 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
FlagDescription
--no-browserPrint 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 whoami
you@example.com (workspace: Acme) Auth: ~/.contract.dev/credentials.json → https://app.contract.dev

logout

Delete the saved credentials:

contract.dev logout

CI environments

Skip the browser flow in CI by setting environment variables instead:

VariableDescription
CONTRACT_DEV_API_KEYAPI key used for authentication. Takes precedence over saved credentials.
CONTRACT_DEV_WORKSPACEWorkspace (id or slug) to act on.
CONTRACT_DEV_STAGENETStagenet (name or id) for stagenet commands.
CONTRACT_DEV_RPC_URLDirect 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