Skip to main content

Documentation Index

Fetch the complete documentation index at: https://staplehire.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Use staplehire login for local development, or set STAPLEHIRE_KEY for agents, scripts, and CI.
staplehire login
staplehire whoami

Quickstart

login opens your browser, completes PKCE OAuth, validates the key, and writes STAPLEHIRE_KEY to .env in the current directory.
staplehire login
Verify the active key and organization:
staplehire whoami
Example output:
{
  "user": { "id": "usr_...", "email": "you@company.com" },
  "organization": { "id": "org_...", "name": "Acme Corp" }
}

API key priority

The CLI resolves your API key in this order.
PrioritySourceExample
1--api-key flagstaplehire --api-key sh_live_xxx roles list
2STAPLEHIRE_KEY env varexport STAPLEHIRE_KEY=sh_live_xxx
3.env in cwdWritten by staplehire login

Use an API key in CI

Do not run browser login in automation. Create an API key in Staplehire settings and expose it as STAPLEHIRE_KEY.
export STAPLEHIRE_KEY=sh_live_xxx
staplehire doctor -q
staplehire whoami | jq '.organization.id'

Log out

staplehire logout
Example output:
{ "logged_out": true, "env_path": "/path/to/project/.env", "key_removed_from_env": true }

Common errors

ErrorFix
AuthenticationErrorRun staplehire login or set STAPLEHIRE_KEY
PermissionErrorConfirm the key belongs to the right organization
ValidationErrorCheck the command flags and field names

FAQ

Where does staplehire login store credentials?

It writes STAPLEHIRE_KEY to .env in the current directory.

Can I pass an API key for one command?

Yes. Use --api-key before the subcommand.

Is staplehire init still supported?

Yes, but it is a deprecated alias for staplehire login. Related: Install the Staplehire CLI · Use the Staplehire CLI in CI · CLI errors