Skip to main content
Onyx CLI terminal interface The Onyx CLI is a terminal interface for chatting with your Onyx Agents and searching your knowledge base. It provides an interactive chat TUI for people and non-interactive commands for scripts and AI coding agents. The CLI is available on all editions.

Installation

Or with pip:

PyPI Package

uv tool install onyx-cli

Standalone Binaries

Standalone binaries for Linux, macOS, and Windows (amd64 and arm64) are attached to each cli/v* GitHub release.

Build from Source

Requires Go 1.27+.

Setup

Launch the interactive chat TUI — on first run it guides you through setup:
This prompts for your Onyx server URL and personal access token (PAT), tests the connection, and saves config to ~/.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.
Accounts & Access page showing the Access Tokens section Create Access Token modal with token name and expiration options

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

Use --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:
Use --agent-id to target a specific agent:

Search Documents

Search your indexed knowledge and get ranked documents without an answer:

Generate Images

Image commands use the image generation provider your admin configured in Onyx.

List Agents

Prints a table of available Agent IDs, names, and descriptions.

Serve over SSH

Share the chat TUI with people who do not have the CLI installed:
Users connect with ssh your-host -p 2222 and paste their own personal access token at the login prompt.

Self-Hosted Deployment

The deploy 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:
The skill is written to .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
It is not used for general programming questions or questions about code in the current repository.

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 long ask 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

Run onyx-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:

Keyboard Shortcuts