The CLI signs in with a browser approval, the same pattern as many device logins: the terminal shows a code, you confirm it on the Hive3 approval page, and the CLI receives an API key that belongs to your account. This page covers each step of that flow, the permission choices, the files and environment variables the CLI uses, and what to do when something fails.
A CLI key is an ordinary API key owned by the account that approved it. It follows the same scopes, managed-account rules and rate limits as a key you create in the app. Approving a login needs Honey Bee+ or above.
#Sign in with browser approval
Run hive3 login
Start the loginhive3 loginThe CLI asks Hive3 for a login request and prints an approval URL and a code. The URL never contains the code.
Terminal outputOpen this URL to approve Hive CLI access: https://app.hive3.tech/cli/authorize Code: ABCD-EF2G (type it on the approval page)It then opens the URL in your default browser, unless you pass
--no-open, and waits, polling every 2 seconds.Sign in on the approval page
If you are not signed in, the page shows Sign in first. Choose a sign-in method, then continue.
Enter the code
Under Enter the code, type the code from your terminal into CLI code. Codes have the form
XXXX-XXXX. The field ignores case, spaces and dashes, and codes never contain the charactersI,O,0or1. If the page says the code does not match an active CLI login, start a new login from your terminal.Review and approve
The Approve login card shows the account you approve as, the request name (see
--label), the access toggle, and the Granted scopes list. The Approve login button stays disabled until the code you typed matches the request. Select it to approve, or Cancel to refuse.If your account is below Honey Bee, the card shows A Honey Bee subscription is required to create API keys. and the button stays disabled.
Return to the terminal
After approval the page says Hive CLI approved. The terminal stores the key and prints:
Terminal outputHive CLI authenticated as API key hive_sk_… Credential stored at /home/you/.config/hive/config.json.
#Timing
| What | Limit |
|---|---|
| Code lifetime | 10 minutes from the moment hive3 login starts. After that the page shows CLI login expired and the terminal prints Hive CLI login expired. Run hive3 login again. |
| CLI wait time | --timeout-ms, default 600000 (10 minutes). Then the terminal prints Hive CLI login timed out. |
| Collecting the key | After you approve, the CLI has 2 minutes to collect the key. It polls every 2 seconds, so this only matters if you close the terminal; run hive3 login again if it expires. |
| Key lifetime | 90 days from approval. Expired keys return invalid_api_key; run hive3 login again. |
| Code lookups | 10 per minute per signed-in account on the approval page, and 10 login starts per minute per IP address. |
#Choose Read only or Full access
When you run hive3 login without --access or --scope, the approval page shows two choices. Read only is selected by default. Your choice decides which scopes the key gets.
| Scope | Read only | Full access | Covers |
|---|---|---|---|
account:read | Yes | Yes | Account, profile, wallets, notifications, builders |
account:write | No | Yes | Profile and settings, uploads, data export, wallets, NFT visibility, notification state |
posts:read | Yes | Yes | Posts and comments |
posts:write | No | Yes | Create, edit, archive and like posts and comments |
resources:read | Yes | Yes | Events, courses, content, quests, jobs, participants, search |
resources:write | No | Yes | Create, edit and archive resources, RSVP, enroll, review participants |
communities:read | Yes | Yes | hive3 capabilities, members, applications, reads on managed accounts |
communities:moderate | No | Yes | Review applications, change roles, remove members |
communities:write | No | Yes | Writes on managed accounts, membership, access type |
broadcasts:read | Yes | Yes | Broadcast drafts, sends and audience |
broadcasts:write | No | Yes | Create, edit, test, send and cancel broadcasts |
tickets:read | Yes | Yes | Ticket setup and your own tickets |
tickets:write | No | Yes | Edit ticket name, description, price and status |
ai:read | Yes | Yes | AI assistant settings and documents |
ai:write | No | Yes | Change the assistant, add and remove documents |
credentials:read | Yes | Yes | Credentials, yours and claimable ones |
credentials:write | No | Yes | Award custom credentials |
Read only grants 8 scopes and Full access grants 17. Neither grants account:destroy. Keys created before the broadcast, ticket, AI and credential scopes existed do not include them; sign in again to get them.
Scopes are necessary but not sufficient. For anything on another account you also need your live role there. See scopes.
#Login options
| Flag | What it does |
|---|---|
--access <mode> | Preselects the bundle: read or full. The page shows the granted scopes without the toggle. Omit it to choose in the browser. |
--scope <scope> | Advanced. Requests one exact scope; repeat the flag for several. The page shows exactly those scopes and no toggle. |
--label <label> | Name shown on the approval card and used as the key's name in the app. Default Hive CLI; at most 80 characters. |
--no-open | Prints the URL and code without opening a browser. |
--timeout-ms <ms> | How long the CLI waits for approval. Default 600000. Must be a positive number. |
--api-url <url> | API base URL for this login. Default $HIVE_API_URL, then https://app.hive3.tech/api/v1. |
--app-url <url> | Approval site URL. Default $HIVE_APP_URL, then https://app.hive3.tech. |
-h, --help | Prints the login usage. |
--accesscannot be combined with--scope. The CLI stops with--access cannot be combined with --scope. Use one permission bundle or exact scopes.--scope account:destroyis refused: the server answersHive API error 400 (invalid_request): scopes must contain supported public API scopes.The CLI never receives permission to delete an account.- Scope names must be one of the 17 in the table above.
--api-urland--app-urlare for local and staging setups. The server uses an--app-urlonly when it has the same origin as its own site address. Plainhttpis accepted only forlocalhost,127.0.0.1and::1; otherwise the CLI refuses to send credentials over an insecure connection.
hive3 login --access read --label "Reporting script" --no-open
hive3 login --scope posts:read --scope resources:read --label "Read-only sync"#Where the CLI stores your key
The CLI keeps one credential file named config.json.
| Where | Location |
|---|---|
Any platform, when HIVE_CONFIG_HOME is set | $HIVE_CONFIG_HOME/config.json |
| macOS | ~/Library/Application Support/Hive/config.json |
| Windows | %APPDATA%\Hive\config.json (AppData\Roaming\Hive under your home folder if APPDATA is not set) |
| Linux and others | $XDG_CONFIG_HOME/hive/config.json, or ~/.config/hive/config.json |
The file holds five fields:
{
"apiBaseUrl": "https://app.hive3.tech/api/v1",
"apiKey": "hive_sk_…",
"createdAt": "2026-10-27T18:00:00.000Z",
"keyPrefix": "hive_sk_…",
"scopes": ["account:read", "posts:read"]
}- The key is stored in plain text and protected by file permissions: the directory is created with mode
0700(an existing directory keeps its permissions) and the file with mode0600, so only your user can read it. - The CLI writes the file through a private staging directory and an atomic rename, so no predictable temporary file appears even when
HIVE_CONFIG_HOMEis a shared directory. - The key is never printed, logged or placed on a command line. Do not paste the file into chat, tickets or prompts.
- The same directory holds
update-check.json, which stores when the CLI last checked npm. - If the file is not valid JSON the CLI prints
Hive CLI config is malformed. Run hive3 login again.If it lacks a key or API URL, it printsHive CLI config is missing credentials. Run hive3 login again.
#Environment variables
| Variable | Effect |
|---|---|
HIVE_API_URL | API base URL for hive3 login only. Default https://app.hive3.tech/api/v1. |
HIVE_APP_URL | Approval site URL for hive3 login only. Default https://app.hive3.tech. |
HIVE_CONFIG_HOME | Directory that holds config.json and update-check.json. Use it to keep separate credentials, for example one per project. |
HIVE_NO_UPDATE_CHECK | Set to 1 or true to turn off the daily update check. |
HIVE_API_URL and HIVE_APP_URL are read at login time only. Every later command uses the API URL stored in config.json, so changing HIVE_API_URL afterwards does not redirect an existing key. To use another API URL, sign in again.
#Sign out and revoke a key
hive3 logouthive3 logout revokes the stored key on the server, prints Revoked the server credential., deletes the local file and prints Removed Hive CLI credential at <path>. It takes no options.
To revoke a key in the app, for example one from a lost laptop:
Open the key list
SettingsHelp & feedbackDeveloper API keysManage API keys opens the page titled API Keys.
Find the key
Under Active keys, CLI keys appear under the name you chose with
--label(defaultHive CLI) with their prefix and when they were last used.Revoke it
Choose Revoke on that key. Requests with it return
401 invalid_api_keyimmediately.
Signing in again replaces the local file but does not revoke the previous key. After you switch from Read only to Full access, revoke the earlier key in the app or run hive3 logout before the new hive3 login.
#Act as a different account
A CLI key belongs to the account that approved it and reaches every account where that account is owner, admin or moderator. To act as a different signed-in user, run hive3 logout, then hive3 login and approve as that user. For accounts you help run, use --account or --owner-type/--community-id instead. See CLI command reference.
#Updates
The CLI checks npm for a newer release at most once every 24 hours, only when stderr is a terminal, CI is not set and HIVE_NO_UPDATE_CHECK is not 1 or true. After a command succeeds it prints on stderr:
Hive CLI update available: 0.4.0 → 0.4.1
Run `hive3 update` to install it.hive3 update --checkreports the latest version without installing it. If you are current it printsHive CLI <version> is already the latest version.hive3 updatelooks up the latest version, prints it, and installs exactly that version withnpm install --global @hive3/cli@<version>. The version is validated before it reaches npm.- The check only reads public package metadata from npm. It never sends your Hive credentials and adds no signature check beyond npm's own.
#Troubleshooting
| Message or symptom | Cause and fix |
|---|---|
Your Hive plan doesn't include API access: the API and CLI need Honey Bee or above. | The key owner's account is below Honey Bee (plan_required). Upgrade under Settings in the app. The same key works again afterwards. |
| A Honey Bee subscription is required to create API keys. on the approval page | The approving account is below Honey Bee. Upgrade, then run hive3 login again. If the plan drops after you approve but before the CLI collects the key, the terminal prints Hive CLI login was denied in the browser. |
Hive CLI login expired. Run hive3 login again. | The code was older than 10 minutes, or approved more than 2 minutes before the CLI collected it. Start again. |
Hive CLI login was denied in the browser. | Someone selected Cancel, or the plan check above failed. |
Hive CLI login timed out. | You did not approve before --timeout-ms elapsed. Start again, or raise the timeout. |
Hive CLI login was already completed. Run hive3 login again. or Hive CLI login request was not found. | The request was already used, or was cleaned up. Start a new login. |
| That code does not match an active CLI login. | The code was mistyped, expired, or already used. Check it against the terminal or start again. |
Too many attempts. Try again shortly. | More than 10 code lookups in a minute on the approval page. Wait a minute. |
Hive API error 429 (rate_limited): Too many CLI login requests. | More than 10 login starts in a minute from one IP address. Wait a minute. While waiting for approval, the CLI honors Retry-After on a 429 and keeps polling, so shared networks usually recover without action. |
Not logged in. Run hive3 login first. | No credential file at the expected location. Check HIVE_CONFIG_HOME, or run hive3 login. Exit code 1. |
Hive API error 401 (invalid_api_key): … | The key is revoked, expired (90 days) or belongs to an account that is unavailable. Run hive3 login again. |
Hive API error 403 (insufficient_scope): … Required scopes: … | The key lacks a scope. Sign in again with --access full or --scope. |
Hive API error 403 (forbidden): … | The key has the scope but your account has no current role on that target. Check hive3 capabilities. |
| The browser does not open | Common on servers and containers. Copy the URL from the terminal and open it on any machine, or use --no-open. |
Refusing to send Hive credentials over an insecure connection. | --api-url or the stored URL uses plain http for a host other than localhost. Use https. |
For a failing request, Requests, errors and limits lists every error code.