CLI overview
Interact with Hex via the command line.
- Available on the Team and Enterprise plans.
- Hex CLI is currently in beta. Commands and configuration are subject to change.
The Hex CLI manages Hex projects, cells, runs, data connections, and workspace resources from the command line. This can be used directly or via an local AI agent to automate Hex workflows, create and modify notebook cells, trigger project runs, and inspect workspace state.
Installation
To install the Hex CLI, we recommend installing via Homebrew:
brew install hex-inc/hex-cli/hex
Alternatively, you can manually install using the following command:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hex-inc/hex-cli/releases/latest/download/hex-installer.sh | sh
Verify the installation using:
hex --version
The Hex CLI will automatically check for updates and prompt you any time an update is available. Hex CLI releases are hosted on Github.
Authentication
To get started:
hex auth login
This will open a web browser to select and log into the workspace you wish to use for the CLI. Credentials are stored securely in your system keyring.
If your workspace has a custom URL (such as for single tenant or EU customers), specify the base URL as part of the login command:
hex auth login -H https://myorganization.hex.tech
You can verify authentication with:
hex auth status
hex projects list
Using the CLI with multiple accounts or workspaces
If you are part of multiple workspaces, you log into each of them separately using the Hex CLI. When logging in, specify a profile name which will be used for each account:
hex auth login workspace1
hex auth login workspace2
hex auth login euworkspace -H https://eu.hex.tech
Switch the currently active account using hex auth switch <profile_name>. The currently active account is global and shared across shell sessions.
Usage
The CLI documents itself with a --help command:
hex --help
# subcommands are also documented using the `--help` flag
hex auth --help
Usage: hex [OPTIONS] [COMMAND]
Commands:
auth Manage authentication with Hex
cells Manage project cells
collections Manage project collections
config Manage CLI configuration
connections Manage data connections
groups Manage workspace groups
logs View CLI logs
projects Manage Hex projects
run Run a Hex project
runs Manage project runs
users Manage workspace users
Options:
-p, --profile <PROFILE> Profile to use (from ~/.config/hex/config.toml) [env: HEX_PROFILE=]
--json Output as JSON (for scripting)
-q, --quiet Suppress non-essential output
-v, --verbose Show verbose output for debugging
--no-color Disable colored output
-h, --help Print help
-V, --version Print version
Configuration for AI agents
AI agents which can interact with your command line, such as Claude Code, can be instructed to use the hex CLI to accomplish tasks. Skills files may be bundled as part of the Hex CLI in future.