
Installation
PyPI (recommended)
PyPI Package
pip install onyx-cli
Build from Source
Requires Go 1.26+.Setup
Run the interactive setup to configure your server URL and API key:~/.config/onyx-cli/config.json.
Generating an Access Token
Navigate to User Settings > Accounts & Access > New Access Token (/app/settings/accounts-access)
to create an access token for the CLI.


Environment Variables
Environment variables override config file values. This is useful for CI/CD pipelines and scripting.Validate Configuration
Verify that your configuration is correct and the server is reachable:Commands
Interactive Chat
One-Shot Questions
Ask a question and get a response without entering the TUI:--agent-id to target a specific agent:
--json for structured NDJSON output (useful for scripting):
List Agents
Slash Commands (Interactive TUI)
When using the interactive chat, the following slash commands are available: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. A pre-built skill definition is available in the Onyx repository at.cursor/skills/onyx-cli/SKILL.md.
Once configured, the AI assistant can call onyx-cli ask to look up company-specific information — policies,
internal docs, connected data sources — without leaving the editor.
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
Configuration for agents
The simplest approach is to runonyx-cli configure once manually — after that,
AI assistants can invoke onyx-cli ask directly without any additional setup.
JSON output for structured parsing
Use--json to get NDJSON event output, which is easier for agents to parse programmatically: