onecli CLI lets you manage your OneCLI instance from the terminal. Create agents, add secrets, configure access, all with JSON output that AI agents can parse and act on.
GitHub: github.com/onecli/onecli-cli
Why a CLI for managing OneCLI?
The dashboard is great for humans. But when an AI agent needs to set up its own environment (create its identity, register the secrets it needs, check its current access), it shouldn’t need a human clicking through a UI. Theonecli CLI gives agents (and the frameworks that orchestrate them) a programmatic interface to manage the OneCLI server. An agent orchestrator can spin up a new agent, assign it credentials for specific services, and configure rules, all in a single script, no browser required.
This is especially useful for:
- Agent bootstrapping, where an orchestrator creates an agent identity and assigns secrets before the agent starts working
- Dynamic provisioning: spin up short-lived agents with scoped access for specific tasks, then clean up after
- CI/CD pipelines that automate agent and secret management as part of your deployment
- Self-healing agents that detect a missing credential, check their own status, and request what they need
Install
Quick start
Commands
Run
Wrap a coding agent process with OneCLI gateway access. See the Coding Agents guide for the full walkthrough.Projects
Manage projects (isolated workspaces for agents, secrets, and rules). See the Projects guide for details.--confirm flag is required to prevent accidental deletion. You cannot delete your last remaining project.
Most commands accept --project (or -p) to target a specific project. Without it, the active project from onecli config set project is used, or the default project.
Agents
Manage agent identities. Agents belong to a project and see all secrets in that project.Secrets
Manage credentials stored in the vault.--type flag accepts anthropic, openai, or generic. For anthropic and openai types, the gateway handles header injection automatically. For generic secrets, you must specify injection flags.
When creating or updating a generic secret, the available injection flags are:
| Flag | Description |
|---|---|
--header-name | Inject as an HTTP header (e.g. Authorization) |
--value-format | Header value template (default: {value}, e.g. Bearer {value}) |
--param-name | Inject as a URL query parameter (e.g. key) |
--param-format | Param value template (default: {value}) |
--header-name and --param-name are mutually exclusive: each secret injects as either a header or a query parameter, not both.
Apps
Manage OAuth app connections so the OneCLI gateway can handle token exchange on behalf of agents. After configuring an app, useapps list to get the credential stubs docs URL your MCP server needs to start.
Rules
Manage policy rules that control what agents can access. See the Rules guide for details on how rules work.| Flag | Description |
|---|---|
--name | Display name for the rule |
--host-pattern | Host to match (e.g. api.anthropic.com) |
--path-pattern | URL path to match (e.g. /v1/*) |
--method | HTTP method: GET, POST, PUT, PATCH, DELETE |
--action | block or rate_limit |
--agent-id | Scope to a specific agent (omit for all agents) |
--rate-limit | Max requests per window (required for rate_limit) |
--rate-limit-window | Time window: minute, hour, or day |
--enabled | Enable or disable the rule (default: true) |
--json | Raw JSON payload (overrides individual flags) |
--dry-run | Validate without executing |
Organization
Organization-scoped commands manage resources that apply across all projects. These mirror the project-levelsecrets, rules, and apps commands but operate at the org level — no --project flag needed.
Org Secrets
--type, injection flags (--header-name, --param-name, etc.), and --json override as project-level secrets.
Org Rules
--host-pattern, --action, --rate-limit, etc.).
Org Permissions
Manage granular tool-level permissions for app providers at the org level.toolId and a permission value: allow, manual_approval, or block.
Org Connections
Org Apps
Manage BYOC (bring your own credentials) app configuration at the org level.Auth
Authenticate with the OneCLI server.Config
Read and write configuration values.Output
All output is JSON. Use--fields to select specific fields, or --quiet to extract a single value:
jq or string manipulation.
Environment variables
| Variable | Description |
|---|---|
ONECLI_API_KEY | API key (overrides stored key) |
ONECLI_API_HOST | API base URL (default: https://app.onecli.sh) |
ONECLI_ENV | dev or production |