
Installation
PyPI (recommended)
PyPI Package
uv tool install onyx-cli
Standalone Binaries
Standalone binaries for Linux, macOS, and Windows (amd64 and arm64) are attached to eachcli/v* GitHub release.
Build from Source
Requires Go 1.27+.Setup
Launch the interactive chat TUI — on first run it guides you through setup:~/.config/onyx-cli/config.json (or $XDG_CONFIG_HOME/onyx-cli/config.json if set).
To reconfigure later, use the /configure slash command inside the TUI.
Generating an Access Token
Navigate to Settings > Accounts & Access > Access Tokens (/app/settings/accounts-access)
and select New Access Token to create an access token for the CLI.
On Onyx Cloud, access tokens require an active paid subscription.


Environment Variables
Environment variables override config file values.Validate Configuration
Verify that your configuration is correct and the server is reachable:Commands
Use
--version to print the client and server versions, and --debug for verbose logging.
Interactive Chat
--agent-id or --agent-name to start the session with a specific Agent,
and --no-stream-markdown to turn off progressive Markdown rendering.
One-Shot Questions
Ask a question and get a response without entering the TUI:--agent-id to target a specific agent:
Search Documents
Search your indexed knowledge and get ranked documents without an answer:Generate Images
List Agents
Serve over SSH
Share the chat TUI with people who do not have the CLI installed:ssh your-host -p 2222 and paste their own personal access token at the login prompt.
Self-Hosted Deployment
Thedeploy command group installs and manages a self-hosted Docker Compose deployment of Onyx — a guided installer
plus upgrade, status, logs, stop, and uninstall commands:
Deploy with the Onyx CLI
Full documentation for
onyx-cli deploy and its lifecycle commands.Slash Commands (Interactive TUI)
Using as an AI Coding Assistant Skill
The Onyx CLI can be used as a tool by AI coding assistants (such as Claude Code and Cursor) to query your knowledge base directly from within your development environment. Install the bundled skill file into your project so your coding agent can discover the CLI:.agents/skills/onyx-cli/. Use --global to install it in your home directory,
--copy to copy files instead of symlinking, and --agent to target a specific agent’s skill directory.
You can also read it in the Onyx repository at
cli/internal/embedded/SKILL.md.
When the skill is invoked
The skill is triggered when you ask your AI assistant about:- Company-specific information (policies, processes, documentation)
- Internal knowledge bases or connected data sources
- Anything referencing Onyx, “search Onyx”, or querying company documents
Non-interactive behavior
When the CLI runs without a terminal, for example from an AI agent or a pipe, it prints results to stdout and progress to stderr, uses no ANSI codes or prompts, and truncates longask output at 50000 bytes (use --max-output 0 to disable). Exit codes identify the failure:
3 not configured, 4 authentication failed, 5 server unreachable, 6 rate limited.
Configuration for agents
Runonyx-cli chat once to complete first-time setup, or set environment variables,
which override the config file and are useful for CI/CD or sandboxed environments:
JSON output for structured parsing
Use--json to get NDJSON event output, which is easier for agents to parse programmatically: