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 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. Agents belong to a project and see all secrets in that project.all (every secret in the project) or selective (only assigned secrets). agents connections set takes the API’s raw connections array: objects with an appConnectionId and an optional provider-specific sessionPolicy (e.g. GitHub repository or Dropbox folder scoping).
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
Manage policy-engine rules (the staged draft → publish model). See the Policy rules guide for how the engine works.publishSkipped in the output). Review with onecli policy status, then onecli policy publish or --publish-all. --no-publish stages deliberately. Compare rules across draft and published by logicalId, never id.
The binary also ships an older onecli rules family for self-hosted servers that predate the policy engine (OneCLI Cloud rejects those writes with 410 Gone); run onecli rules --help there.
Organization
Organization-scoped commands manage resources that apply across all projects. These mirror the project-levelsecrets, policy, and apps commands but operate 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
agentGroup/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 (OneCLI Cloud rejects those writes with 410 Gone).
Org Connections
Org Apps
Manage BYOC (bring your own credentials) app configuration at the org level.Org Settings
Control the organization-wide policy mode:allow (default-allow: requests pass unless a rule blocks them) or deny (lockdown default-deny: requests are blocked unless a rule allows them).
Vaults and counts
Migrate
Move a self-hosted instance’s data (secrets, agents, agent-secret assignments, rules) to OneCLI Cloud. 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.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.