Skip to main content
The Hexclave CLI is published as @hexclave/cli and provides the hexclave command for project setup, development environments, configuration, deployments, administration, and team management.

Install and quickstart

Install the CLI globally if you want to use hexclave from any project:
Terminal
You can also run it without a global install:
Terminal
For a project-local installation, add @hexclave/cli as a development dependency and run it with your package manager:
Terminal
The CLI stores login credentials locally. For CI and other automation, use the environment variables described below instead of putting secrets in command history.

Authentication and environment

Run hexclave login to authenticate in a browser. The CLI stores the resulting refresh token locally. hexclave logout removes the stored token. The preferred current environment variables are: STACK_API_URL, STACK_DASHBOARD_URL, STACK_PROJECT_ID, and STACK_SECRET_SERVER_KEY are retained as backwards-compatible aliases for the corresponding HEXCLAVE_* variables. If both names for one setting are set to different values, the CLI reports an error. The CLI credential variables are currently named STACK_CLI_REFRESH_TOKEN and STACK_CLI_ANON_REFRESH_TOKEN. Use STACK_CLI_REFRESH_TOKEN for CI or other noninteractive login, and set STACK_CLI_ANON_REFRESH_TOKEN to link an anonymous session during login. The CLI defaults to Hexclave Cloud (https://api.hexclave.com and https://app.hexclave.com) when endpoint variables are not set. The root --json option enables JSON output for commands that support it. Commander also provides -V, --version and -h, --help on every command; the automatically generated help option is omitted from the individual option tables below.

Command reference

hexclave init

Synopsis
Description Initialize Hexclave in a project. The wizard can create a development-environment config, create a cloud project, or link an existing config or cloud project. Options Behavior and authentication Without mode or link flags, the command is interactive. Noninteractive environments must provide an explicit mode or link option. Incompatible combinations such as --config-file with --select-project-id are rejected. The command writes project setup files, registers the Hexclave MCP server, and can run the Claude setup agent unless --no-agent is used.
Terminal

hexclave doctor

Synopsis
Description Check that Hexclave is correctly wired up in a project. Options Behavior and authentication The command reads package.json, detects or validates the framework, runs integration checks, prints pass/fail/warning results, and exits with status 1 if any check fails.
Terminal

hexclave fix

Synopsis
Description Use an AI agent to fix a Hexclave error in the current project. Options Behavior and authentication If no error is supplied, the CLI reads stdin or prompts interactively. Error input is limited to 8,000 characters. In noninteractive environments, provide --error; confirmation is required unless --yes is supplied.
Terminal

hexclave login

Synopsis
Description Log in to Hexclave through the browser-based CLI authentication flow. Options None. Behavior and authentication The refresh token is saved as STACK_CLI_REFRESH_TOKEN in the CLI credentials file. Set STACK_CLI_ANON_REFRESH_TOKEN before logging in to attach the login to an existing anonymous session; the anonymous token is removed after a successful link.

hexclave logout

Synopsis
Description Remove the locally stored CLI refresh token. Options None. Behavior and authentication This removes the local credential. It does not require an API request.

hexclave whoami

Synopsis
Description Show the currently logged-in Hexclave CLI user. Options Behavior and authentication Requires a login session. Human output includes user identity, email verification, anonymous/restricted status, team count, API URL, and dashboard URL.

hexclave project

Manage projects.

hexclave project list

Synopsis
Description List projects owned by the current user. By default, both cloud and development-environment projects are included. Options Behavior and authentication --cloud and --local cannot be combined. Listing cloud projects requires a login session; listing local development-environment projects uses local state. Human-readable output contains the project ID, display name, and [cloud] or [local] target.
Terminal

hexclave project create

Synopsis
Description Create a new cloud project. Options Behavior and authentication The command currently creates cloud projects only, so --cloud is required. It requires a login session. Missing display names can be entered interactively; in a noninteractive environment, provide --display-name.
Terminal

hexclave config

Manage project configuration files.

hexclave config pull

Synopsis
Description Pull the selected cloud branch configuration into a local TypeScript file. Options Behavior and authentication This command requires hexclave login; secret-server-key-only authentication is rejected. The target must have a .ts extension. Existing files are protected unless --overwrite is supplied.
Terminal

hexclave config push

Synopsis
Description Push a local JavaScript or TypeScript config file to a cloud branch. Options Behavior and authentication This command accepts either hexclave login or HEXCLAVE_SECRET_SERVER_KEY authentication. GitHub Actions metadata is inferred from GITHUB_REPOSITORY, GITHUB_REF_NAME, and GITHUB_SHA when available. Explicit GitHub source metadata requires all corresponding source options.
Terminal

hexclave dev

Synopsis
Description Run a command with Hexclave development-environment credentials. Options and arguments Behavior and authentication The CLI starts or reuses the development dashboard, creates a development-environment session, injects the project’s API URL, dashboard URL, project ID, and related environment variables into the child process, then forwards signals and cleans up when the child exits. The command accepts the config path supplied by the user; current project setup uses hexclave.config.ts.
Terminal

hexclave deploy

Synopsis
Description Deploy a service defined under deploy.services in hexclave.config.ts. The CLI uploads the service source, waits for Vercel to accept the deployment, and prints the run ID without waiting for the remote build to finish. Options Behavior and authentication Authentication uses HEXCLAVE_SECRET_SERVER_KEY when set, which is recommended for CI; otherwise it uses the hexclave login session. Every secret referenced by the service must be supplied, and unknown secret keys are rejected. Secret values are sent to the deployment target and are not persisted by Hexclave.
Terminal

hexclave exec

Synopsis
Description Execute JavaScript as an async function with a preconfigured HexclaveServerApp available as hexclaveServerApp. Options Behavior and authentication Pass exactly one JavaScript argument. Cloud execution requires hexclave login and intentionally rejects HEXCLAVE_SECRET_SERVER_KEY authentication. Development-environment execution resolves access from the supplied config file. Non-undefined return values are printed as formatted JSON; undefined prints nothing.
Terminal

hexclave team

Manage teams. Team operations require a login session. Where a team ID is optional, the CLI can resolve the team interactively or from the available team context.

hexclave team list

Synopsis
Description List the current user’s teams. Options

hexclave team create

Synopsis
Description Create a team. Options Behavior and authentication Missing display names prompt interactively and are required in noninteractive environments.

hexclave team members list

Synopsis
Description List members of a team. Options

hexclave team members remove

Synopsis
Description Remove a member from a team. Options Behavior and authentication Destructive actions require confirmation interactively and require --yes in noninteractive environments.

hexclave team invite

Synopsis
Description Invite a user to a team. Options Behavior and authentication Missing email addresses prompt interactively and are required in noninteractive environments.

hexclave team invitations list

Synopsis
Description List invitations sent by a team. Options

hexclave team invitations revoke

Synopsis
Description Revoke a team invitation. Options Behavior and authentication Destructive actions require confirmation interactively and require --yes in noninteractive environments.

hexclave team invitations received

Synopsis
Description List invitations received by the current user. Options

hexclave team invitations accept

Synopsis
Description Accept an invitation received by the current user. Options

hexclave team leave

Synopsis
Description Leave a team. Options Behavior and authentication Leaving a team is destructive. It requires confirmation interactively and requires --yes in noninteractive environments.

hexclave team update

Synopsis
Description Update a team. Options Behavior and authentication Missing display names prompt interactively and are required in noninteractive environments.

hexclave team delete

Synopsis
Description Delete a team. Options Behavior and authentication Deleting a team is destructive. It requires confirmation interactively and requires --yes in noninteractive environments.