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.--agent flag, then ONECLI_AGENT, then onecli config set agent, then the project’s default agent.
Projects
Manage projects (isolated workspaces for agents, secrets, and connections). See the Projects guide for details.--confirm must repeat the project ID 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. An agent belongs to a project and uses only the credentials you grant it (see Agent access).agents secrets, set-secrets, set-secret-mode, agents connections get|set) still ship for pre-grants self-hosted servers; updated servers answer 410 Gone pointing at grants.
Grants
Attach credentials to agents — the write path for per-agent access. A bare attach grants full access;--allow/--ask narrow a connection to named tools (ids from apps permission-definition). Writes take effect immediately.
--allow and --ask (all-blocked = detach instead), and a tool can’t be in both lists — the server rejects either with 422. --ask requires a plan with manual approvals. Grants are the intent; agents credentials and apps connections agent-access show the effective result after organization rules apply.
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. --value and --file are mutually exclusive; use --file for multi-line values like Codex’s auth.json.
When creating or updating a generic secret, the available injection flags are:
--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.
App blocklists
Some apps ship predefined blocklist hosts (e.g. public registries) you can activate; you can also add custom deny rules per app:Policy
Policy rules are authored at the organization level — see Org Policy below and the Policy rules guide. At project scope, rules are compiled from grants; the one project-scope policy read is the effective reflection:onecli policy rules ..., policy default, policy publish, policy status) still ships for pre-grants self-hosted servers; updated servers answer 410 Gone pointing at grants (project access) and onecli org policy (organization rules). The even older onecli rules family serves servers that predate the policy engine.
Organization
Organization-scoped commands manage resources that apply across all projects. These mirror the project-levelsecrets and apps commands — and carry the full policy rule console — at the org level, with no --project flag needed. They require the admin or owner role.
Org Secrets
--type, injection flags (--header-name, --param-name, etc.), and --json override as project-level secrets.
Org Policy
user/group identities via --identities (never a specific agent). Requires an org API key with the admin role. The older onecli org rules family serves self-hosted servers that predate the policy engine (updated servers answer 410 Gone).
Org Connections
Org Apps
Manage BYOC (bring your own credentials) app configuration at the org level.onecli org policy default get|set. (The retired onecli org settings family answers 410 Gone on updated servers.)
Vaults and counts
Migrate
Move a self-hosted instance’s data (secrets and agents) to OneCLI Cloud. Policy rules and grants don’t travel — they’re counted and reported as skipped so you can re-create them on the destination. Run against the self-hosted server; secrets are decrypted server-side and sent directly to Cloud over HTTPS.Auth
Authenticate with the OneCLI server.Config
Read and write configuration values.
The
agent key requires CLI 2.10 or later.
Output
All output is JSON. Use--fields to select specific fields, or --quiet to extract a single value:
jq or string manipulation.
List commands return at most 20 results by default; pass --max to raise (or lower) the cap.