Your API has hundreds of endpoints.
Now they're all CLI commands.

Point OnlyCLI at any OpenAPI spec. Get a native binary with every operation as a typed command -- flags, help text, pagination, and shell completion included.

go install github.com/onlycli/onlycli/cmd/onlycli@latest
terminal
$ onlycli generate --spec api.github.com.yaml --name github --auth bearer --out ./gh
Generated CLI project at ./gh
  Groups: 43
  Commands: 1107
  Auth: bearer (env: GITHUB_TOKEN)

$ cd gh && go build -o gh . && ./gh repos get --owner golang --repo go
{"id":23096959,"name":"go","full_name":"golang/go","stargazers_count":128000,...}

$ ./gh issues list-for-repo --owner golang --repo go --state open --format table
ID       TITLE                          STATE   CREATED
71234    proposal: spec: add ...        open    2025-12-01
71198    cmd/go: module cache ...       open    2025-11-30
1,107 commands from the GitHub API spec
35x fewer tokens than MCP for AI agents
1 command to generate them all
0 runtime dependencies

Start in 30 seconds

1

Install

$ go install github.com/onlycli/onlycli/cmd/onlycli@latest
2

Generate

$ onlycli generate \
    --spec your-api.yaml \
    --name myapi --out ./cli
3

Build & use

$ cd cli && go build -o myapi .
$ ./myapi --help
$ ./myapi users list --format table

Every operation in your spec becomes a command. Every parameter becomes a flag. That's it.

Why OnlyCLI?

Complete coverage, zero effort

  • Every endpoint becomes a CLI command
  • Params, query strings, bodies mapped to typed --flags
  • Help text auto-generated from spec descriptions

One binary, ship anywhere

  • Compiled Go binary, zero runtime deps
  • No interpreter, VM, or node_modules
  • Copy to a server, container, or laptop

AI agents use it natively

  • Agents call --help to discover commands
  • Execute and read structured stdout directly
  • No MCP server, no schema injection, no token waste

Everything you need, built in

Not just commands and flags. Generated CLIs ship with the features you'd build yourself -- so you don't have to.

7 output formats

--format json|yaml|table|csv|pretty|jsonl|raw -- tables, JSON, or diff-friendly YAML.

GJSON transforms

--transform "#.full_name" -- project fields inline without reaching for jq.

Auto-pagination

--page-limit 10 auto-detects Link header, cursor, offset, and page-number schemes. One flag, complete results.

File & stdin input

--data @payload.json or --data @- for stdin. Readable commands, repeatable CI.

OAuth2 built in

Device flow for login, client credentials for CI. Tokens saved per profile.

Multi-profile config

--profile staging -- switch dev, staging, and prod without re-exporting secrets.

Retry with backoff

--max-retries 3 -- exponential backoff for 429s and 5xx. Respects Retry-After.

Dry-run mode

--dry-run -- prints method, URL, headers, body without sending.

Smart shell completion

Bash, zsh, fish, PowerShell. Enums surface as completion candidates.

Go template output

--template '{{.login}}' -- custom formatting beyond field projection.

Nested body flags

--name.first John -- builds nested JSON, no heredocs needed.

HTTP/2 + compression

Multiplexed requests, auto gzip decompression out of the box.

Real-world: GitHub REST API

The full GitHub API spec has 1,107 operations across 43 groups. OnlyCLI generates a complete CLI in under 5 seconds.

# Generate from the official GitHub spec
$ onlycli generate \
    --spec https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml \
    --name github --auth bearer --out ./github-cli

# Build and authenticate
$ cd github-cli && go build -o gh .
$ export GITHUB_TOKEN=ghp_xxx

# List repos as a table
$ ./gh repos list-for-user --username octocat --format table

# Create an issue with flags
$ ./gh issues create --owner myorg --repo myrepo --title "Bug" --body "Details here"

# Search with field projection
$ ./gh search repos --q "language:go stars:>1000" --sort stars --transform "#.full_name"

# Paginate automatically
$ ./gh repos list-for-user --username octocat --page-limit 5 --format csv

How it compares

OnlyCLI curl Restish MCP tools
Typed commands per endpoint Yes No Yes Varies
Single binary, no runtime Yes Yes Yes No
Table / YAML / CSV output Yes No No No
Auto-pagination (Link, cursor, offset) Yes No No No
GJSON field transforms Yes No No No
Works offline, no server Yes Yes Yes No
35x fewer tokens than MCP ~200 tok Low Low 55K+ tok
Streaming (SSE / NDJSON) Yes Manual No Varies

Built for AI agents -- 35x cheaper than MCP

A GitHub MCP server loads 55,000 tokens into every prompt. Three services eat 72% of your context window on idle. OnlyCLI generates a binary that agents call like any command -- --help costs ~200 tokens. See the full cost breakdown.

# Agent discovers available commands
$ ./gh --help
$ ./gh repos --help

# Agent calls a specific operation
$ ./gh repos get --owner golang --repo go --format json

# Agent reads structured JSON from stdout
{"id":23096959,"name":"go","full_name":"golang/go",...}

Stable names. Predictable flags. Structured output. The agent learns the surface once, not on every turn.

Open source, MIT licensed

License: MIT GitHub stars

Contributions welcome -- bug reports, new features, and docs improvements all help.