opencli
Get started

Install and run.

A single binary, no daemon. Build from source or grab a prebuilt archive, sign in your way, then launch the terminal UI or drive it headless from a script.

Sixty-second start

01

Clone and install

Builds in release and links opencli onto your PATH.

git clone https://github.com/ryan-mt/opencli && cd opencli
make install
02

Sign in

Opens a browser for OAuth, or prompts for an API key.

opencli login
03

Run

Launches the terminal UI. Add resume to reopen a session.

opencli

Prefer a prebuilt binary

Grab the archive for your platform from the latest release and put opencli on your PATH.

Latest release
Linux x86-64opencli-x86_64-unknown-linux-gnu.tar.gz
macOS Intelopencli-x86_64-apple-darwin.tar.gz
macOS Apple Siliconopencli-aarch64-apple-darwin.tar.gz
Windows x86-64opencli-x86_64-pc-windows-msvc.zip

Sign in your way

Four doors in: a subscription or an API key, OpenAI or Anthropic. OAuth uses PKCE and tokens refresh themselves.

Subscription, OpenAI

opencli login signs in with a ChatGPT Plus, Pro, Team, or Enterprise account over OAuth.

Subscription, Anthropic

Claude Pro or Max signs in over OAuth after you acknowledge the terms notice.

API key

Paste an OpenAI or Anthropic key, or let opencli pick up OPENAI_API_KEY and ANTHROPIC_API_KEY from the environment.

sign in
opencli login                                 # OpenAI OAuth (ChatGPT subscription)
opencli login --api-key --provider openai     # paste an OpenAI key
opencli login --api-key --provider anthropic  # paste an Anthropic key
opencli status                                # who am I, and on what plan
opencli logout

Two ways to talk to it

Run opencli with no subcommand for the full terminal UI. Or go headless for scripts, cron, and systemd. Same agent either way.

opencli, opencli resume, opencli chat, opencli run

headless
opencli chat "write a fibonacci function in Python"
opencli chat --model gpt-5.5-pro --reasoning high "refactor module X"
echo "read CLAUDE.md and summarize" | opencli chat
opencli run --cwd /srv/project --prompt-file nightly-task.md

Configuration

Settings live in config.json under your config directory. A project can override the safe behavioural fields with its own .opencli/config.json.

model
Default model, for example gpt-5.5 or claude-opus-4-8.
reasoning_effort
low, medium, high, or xhigh.
verbosity
low, medium, or high.
auto_approve_read
Auto-approve read-only tools.
auto_approve_write
Auto-approve write tools. False by default.
fallback_models
Ordered list used for transparent failover.
config.json
{
  "model": "gpt-5.5",
  "reasoning_effort": "medium",
  "verbosity": "medium",
  "auto_approve_read": true,
  "auto_approve_write": false,
  "fallback_models": []
}

Security-sensitive keys like default_permission_mode, the auto-approve flags, and providers are global-only, so a cloned repo cannot disable approvals or redirect the model.

Build from source

You need stable Rust, and ripgrep is recommended since it powers the grep tool. Then link it into your PATH, or run it in dev mode.

from source
git clone https://github.com/ryan-mt/opencli && cd opencli
make install      # build release + link to PATH
make link-dev     # OR dev mode, re-runs cargo on each call
make unlink       # remove the link