# OnlyCLI

> Turn any OpenAPI spec into a native CLI binary. No MCP, no bloat, no runtime dependencies, ONLY CLI.

- **Type:** MCP server
- **Install:** `agentstack add mcp-onlycli-onlycli`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [OnlyCLI](https://agentstack.voostack.com/s/onlycli)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [OnlyCLI](https://github.com/OnlyCLI)
- **Source:** https://github.com/OnlyCLI/OnlyCLI
- **Website:** https://onlycli.github.io/OnlyCLI/

## Install

```sh
agentstack add mcp-onlycli-onlycli
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# OnlyCLI

[](https://github.com/onlycli/onlycli/actions/workflows/ci.yml)
[](https://goreportcard.com/report/github.com/onlycli/onlycli)
[](LICENSE)

**Turn any OpenAPI spec into a complete CLI. One command. One binary. 35x fewer tokens than MCP.**

  

Every endpoint in the GitHub REST API (1,107 operations) becomes a typed CLI command with flags, help text, and shell completion.

## Install

```bash
go install github.com/onlycli/onlycli/cmd/onlycli@latest
```

Or download a pre-built binary from [Releases](https://github.com/onlycli/onlycli/releases).

## Quick Start

```bash
# 1. Generate -- point at any OpenAPI 3.x spec (local file or URL)
onlycli generate \
  --spec https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml \
  --name petstore --out ./petstore-cli

# 2. Build
cd petstore-cli && go mod tidy && go build -o petstore .

# 3. Use
./petstore pet find-pets-by-status --status available --format table
./petstore --help
```

That's it. Every operation in the spec is now a CLI command.

## What You Get

Every generated CLI ships with:

| Capability | How |
|---|---|
| Every endpoint as a command | Grouped by tag, named by operationId |
| All parameters as `--flags` | Path, query, header, and request body fields |
| 7 output formats | `--format json\|yaml\|table\|csv\|pretty\|jsonl\|raw` |
| Field projection | `--transform "#.name"` via [GJSON](https://github.com/tidwall/gjson) |
| Go template output | `--template '{{.login}}'` |
| Auto-pagination | `--page-limit N` auto-detects Link, cursor, offset, page-number |
| Streaming | `--stream` for SSE and NDJSON responses |
| File input | `--data @payload.json` or `--data @-` for stdin |
| OAuth2 authentication | Device flow (interactive) + client credentials (CI) |
| Multi-profile config | `config set staging.token xxx && --profile staging` |
| Retry with backoff | `--max-retries 3` for transient 429/5xx errors |
| Dry-run mode | `--dry-run` prints the request without sending |
| HTTP/2 + gzip | Modern transport, automatic content decompression |
| Shell completion | `completion bash\|zsh\|fish\|powershell` with enum hints |
| Cross-platform | Linux, macOS, Windows; amd64, arm64 |

## Examples

Pre-generated CLIs from live public specs:

| Example | Source Spec | Groups | Commands |
|---|---|---|---|
| [petstore](examples/petstore/) | [Swagger Petstore](https://petstore3.swagger.io/) | 3 | 19 |
| [github](examples/github/) | [GitHub REST API](https://docs.github.com/rest) | 43 | 1,107 |

Regenerate them yourself:

```bash
make generate-example
```

## Comparison

| | OnlyCLI | curl | Restish | MCP tools |
|---|---|---|---|---|
| Typed commands per endpoint | **Yes** | No | Yes | Varies |
| Single distributable binary | **Yes** | Yes | Yes | No |
| Output formatting (table/yaml/csv) | **Yes** | No | No | No |
| Multi-scheme pagination | **Yes** | No | No | No |
| Streaming (SSE/NDJSON) | **Yes** | Manual | No | Varies |
| Works offline, no server process | **Yes** | Yes | Yes | No |
| Token cost for AI agents | **Low** | Low | Low | High |

Detailed write-ups: [vs Stainless](https://onlycli.github.io/OnlyCLI/compare/vs-stainless/) &middot; [vs Restish](https://onlycli.github.io/OnlyCLI/compare/vs-restish/) &middot; [vs curl/HTTPie](https://onlycli.github.io/OnlyCLI/blog/onlycli-vs-curl-httpie/)

## For AI Agents: 35x Cheaper Than MCP

A GitHub MCP server loads **55,000 tokens** into every prompt. Three services consume **72% of your context window** on idle. At scale, that is **$51,000/month** in pure schema overhead.

OnlyCLI takes the opposite approach:

1. Generate a binary once from the spec
2. Agent calls `./cli --help` to discover commands (**~200 tokens**)
3. Agent runs `./cli repos get --owner x --repo y` and reads stdout

Stable command names, predictable flags, structured JSON output. No MCP server, no schema injection, no connection management. [See the full cost analysis](https://onlycli.github.io/OnlyCLI/token-cost/).

## Development

```bash
git clone https://github.com/onlycli/onlycli.git && cd onlycli
make test          # unit + integration tests
make lint          # golangci-lint
make check         # fmt + vet + lint + test
make build         # build to bin/onlycli
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide and [ARCHITECTURE.md](ARCHITECTURE.md) for codebase structure.

## License

[MIT](LICENSE)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [OnlyCLI](https://github.com/OnlyCLI)
- **Source:** [OnlyCLI/OnlyCLI](https://github.com/OnlyCLI/OnlyCLI)
- **License:** MIT
- **Homepage:** https://onlycli.github.io/OnlyCLI/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-onlycli-onlycli
- Seller: https://agentstack.voostack.com/s/onlycli
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
