{"id":49182933,"url":"https://github.com/apideck-libraries/cli","last_synced_at":"2026-04-23T02:04:47.946Z","repository":{"id":344073567,"uuid":"1180019693","full_name":"apideck-libraries/cli","owner":"apideck-libraries","description":"Beautiful, agentic-friendly CLI for Apideck Unified API.","archived":false,"fork":false,"pushed_at":"2026-04-16T08:58:23.000Z","size":286,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T10:36:22.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apideck-libraries.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-12T16:06:40.000Z","updated_at":"2026-04-16T08:57:44.000Z","dependencies_parsed_at":"2026-03-13T07:24:49.524Z","dependency_job_id":null,"html_url":"https://github.com/apideck-libraries/cli","commit_stats":null,"previous_names":["apideck-libraries/cli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/apideck-libraries/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apideck-libraries","download_url":"https://codeload.github.com/apideck-libraries/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apideck-libraries%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32162614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"online","status_checked_at":"2026-04-23T02:00:06.710Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-23T02:04:25.875Z","updated_at":"2026-04-23T02:04:47.932Z","avatar_url":"https://github.com/apideck-libraries.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apideck CLI\n\nBeautiful, agentic-friendly CLI for [Apideck Unified API](https://www.apideck.com).\n\nOpenAPI is the source of truth — no SDK dependency, no code generation. Humans get a polished TUI. AI agents get token-efficient progressive disclosure.\n\n\u003e Read the [blog post](https://www.apideck.com/blog/mcp-server-eating-context-window-cli-alternative)\n\n## Features\n\n- **OpenAPI-native** — Parses the unified Apideck OpenAPI spec directly. No generated code, no SDK dependency.\n- **Beautiful TUI explorer** — Interactive API playground in the terminal.\n- **AI agent-ready** — `apideck agent-prompt` outputs a token-optimized prompt (~80 tokens vs ~3,600 for MCP).\n- **Permission layers** — Auto-classified operations (read/write/dangerous) with built-in safety rails.\n- **DX Ready** — Styled output, interactive wizards, spinners, semantic colors, adaptive themes.\n\n## Install\n\n### Homebrew\n\n```bash\nbrew install apideck-libraries/tap/apideck\n```\n\n### Go\n\n```bash\ngo install github.com/apideck-libraries/cli/cmd/apideck@latest\n```\n\n### Docker\n\n```bash\ndocker run -e APIDECK_API_KEY=xxx -e APIDECK_APP_ID=xxx -e APIDECK_CONSUMER_ID=xxx apideck/cli accounting invoices list\n```\n\n### From source\n\n```bash\ngit clone https://github.com/apideck-libraries/cli.git\ncd cli\nmake build\n./bin/apideck --help\n```\n\n## Quick Start\n\n### 1. Configure authentication\n\n```bash\n# Option A: Environment variables\nexport APIDECK_API_KEY=your-api-key\nexport APIDECK_APP_ID=your-app-id\nexport APIDECK_CONSUMER_ID=your-consumer-id\n\n# Option B: Interactive setup wizard\napideck auth setup\n```\n\n### 2. Start using the API\n\n```bash\n# List available API groups\napideck --list\n\n# List invoices\napideck accounting invoices list\n\n# Create a contact\napideck crm contacts create --name \"Jane Doe\" --email \"jane@example.com\"\n\n# Get a specific invoice\napideck accounting invoices get --id inv_001\n\n# Use a specific connector\napideck accounting invoices list --service-id xero\n```\n\n### 3. Explore interactively\n\n```bash\n# Launch the TUI explorer\napideck explore\n\n# Scoped to a specific API\napideck accounting explore\n```\n\n## Usage\n\n```bash\n# Discovery\napideck --list                              # List available API groups\napideck accounting --list                   # List resources + operations\napideck accounting invoices --help          # Show operations + params\n\n# API calls\napideck accounting invoices list --limit 10\napideck accounting invoices create --customer-id \"cus_123\" --total 150\napideck crm contacts list --output json\n\n# Complex requests via raw JSON\napideck accounting invoices create --data '{\"customer_id\": \"cus_123\", \"line_items\": [...]}'\napideck accounting invoices create --data @invoice.json\n\n# Management\napideck auth status                         # Show credential sources\napideck sync                                # Update to latest API spec\napideck info                                # Spec version, cache status\napideck history                             # Recent API calls timeline\napideck permissions                         # Show/edit permission config\n```\n\n### Output Formats\n\nThe CLI auto-detects your environment:\n\n| Context | Default | Override with |\n|---------|---------|---------------|\n| Interactive terminal | `table` | `--output json\\|yaml\\|csv` |\n| Piped / non-TTY | `json` | `--output table\\|yaml\\|csv` |\n\n```bash\n# Select specific fields\napideck accounting invoices list --fields id,customer,total\n\n# Raw API response\napideck accounting invoices list --raw\n\n# Quiet mode (no spinners, no status lines)\napideck accounting invoices list -q -o json\n```\n\n### Pagination\n\n```bash\n# Manual pagination\napideck accounting invoices list --cursor \"next_page_token\"\n\n# Fetch all pages automatically\napideck accounting invoices list --all\n\n# Limit total pages fetched\napideck accounting invoices list --all --max-pages 10\n```\n\n## Permission Engine\n\nOperations are auto-classified based on HTTP method:\n\n| HTTP Method | Level | Behavior |\n|-------------|-------|----------|\n| GET, HEAD, OPTIONS | `read` | Auto-approved |\n| POST, PUT, PATCH | `write` | Confirmation prompt |\n| DELETE | `dangerous` | Blocked unless overridden |\n\nOverride defaults in `~/.apideck-cli/permissions.yaml`:\n\n```yaml\ndefaults:\n  read: allow\n  write: prompt\n  dangerous: block\n\noverrides:\n  accounting.payments.create: dangerous   # upgrade: payments are sensitive\n  crm.contacts.delete: write              # downgrade: allow with prompt\n```\n\nUse `--yes` to skip write prompts. Use `--force` to override dangerous blocks.\n\n## AI Agent Integration\n\nThe Apideck CLI is designed to be the most efficient way for AI agents to interact with the Apideck API.\n\n### Agent prompt (~80 tokens)\n\n```bash\napideck agent-prompt\n```\n\nOutputs a token-optimized prompt that teaches any AI agent how to use the CLI. Compare this to loading a full OpenAPI spec (~50,000 tokens) or MCP tool schemas (~3,600 tokens per API).\n\n### Progressive disclosure\n\nAgents discover capabilities lazily — only loading what they need:\n\n```bash\napideck --list                              # What APIs exist?\napideck accounting --list                   # What resources?\napideck accounting invoices create --help   # What parameters?\n```\n\n### Install as a Claude Code skill\n\n```bash\napideck skill install\n```\n\nThis writes a skill file to `~/.claude/skills/apideck.md` so Claude Code automatically knows how to use the Apideck CLI.\n\n### Non-TTY behavior\n\nWhen running in a non-interactive environment (CI/CD, agent frameworks):\n- `read` operations execute normally\n- `write` / `dangerous` operations fail with exit code 1 and structured JSON error\n- Use `--yes` and `--force` flags to allow operations programmatically\n\n## Why Not curl, OpenAPI, or MCP?\n\nThe obvious question: AI agents can already read OpenAPI specs and make HTTP requests with curl. Why build another tool?\n\nBecause **\"can\" ≠ \"should\"**. Agents *can* write raw assembly too — we still give them Python.\n\n### Context Window Explosion\n\nA typical OpenAPI spec is **5,000–50,000+ tokens**. An AI agent that loads the full spec to list customers just burned thousands of tokens on endpoints it will never use.\n\n**Apideck CLI**: `apideck agent-prompt` → ~80 tokens. Progressive disclosure via `--list` and `--help` means the agent only loads what it needs, when it needs it.\n\n### Auth Is a Nightmare\n\nAn AI agent using curl must parse security schemes, manage token storage and refresh, and construct auth headers correctly every time. One mistake = leaked credentials or broken auth.\n\n**Apideck CLI**: Auth is configured once and injected automatically. The agent never sees or handles credentials directly.\n\n### No Safety Rails\n\nGive an AI agent curl and it can `DELETE /accounting/invoices/{id}` just as easily as `GET /accounting/invoices`. There's no distinction between reading data and destroying it.\n\n**Apideck CLI**: Auto-classified permission layers. GET is auto-approved. POST/PUT prompts for confirmation. DELETE is blocked unless explicitly allowed. Safety is structural, not an afterthought.\n\n### Discovery Is Wasteful\n\nWith curl + OpenAPI, every API call requires: load spec → parse → search → extract params → construct request → execute → parse response. That's 7 steps of repeated token-burning work.\n\n**Apideck CLI**: `apideck accounting invoices list --limit 10`. One step.\n\n### Why Not MCP?\n\n| Dimension | curl + OpenAPI | MCP | **Apideck CLI** |\n|-----------|---------------|-----|-----------------|\n| Context cost | ~5,000–50,000 tokens | ~3,600 tokens/API | **~80 tokens** |\n| Auth handling | Manual, per-request | Per-server, inconsistent | **Automatic** |\n| Safety/Permissions | None | Optional, per-server | **Built-in** |\n| Discovery | Load entire spec | Schema dump upfront | **Lazy, progressive** |\n| Runtime deps | None | Server process | **None (static binary)** |\n| Agent compatibility | Any (shell) | MCP clients only | **Any (shell)** |\n| Custom code needed | Yes | Yes, per server | **None** |\n\nThe best AI agent interface isn't a new protocol — it's the oldest one we have: a well-designed command-line tool.\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────┐\n│                    apideck binary                     │\n│                                                      │\n│  ┌──────────┐  ┌──────────┐  ┌───────────────────┐  │\n│  │  Parser   │  │  TUI     │  │  Agent Interface  │  │\n│  │ OpenAPI   │  │ Explorer │  │  --help/--list    │  │\n│  │ libopenapi│  │ bubbletea│  │  agent-prompt     │  │\n│  └────┬─────┘  └────┬─────┘  └────────┬──────────┘  │\n│       │              │                 │             │\n│  ┌────▼──────────────▼─────────────────▼──────────┐  │\n│  │              Command Router                     │  │\n│  │  spec → operations → subcommands + flags        │  │\n│  └────────────────────┬───────────────────────────┘  │\n│                       │                              │\n│  ┌────────────────────▼───────────────────────────┐  │\n│  │           Permission Engine                     │  │\n│  │  read / write (prompt) / dangerous (block)      │  │\n│  └────────────────────┬───────────────────────────┘  │\n│                       │                              │\n│  ┌────────────────────▼───────────────────────────┐  │\n│  │           Auth Manager                          │  │\n│  │  env vars \u003e config file \u003e setup wizard          │  │\n│  └────────────────────┬───────────────────────────┘  │\n│                       │                              │\n│  ┌────────────────────▼───────────────────────────┐  │\n│  │           HTTP Client + Response Formatter      │  │\n│  │  retry · rate-limit · JSON/table/YAML/CSV       │  │\n│  └────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────┘\n```\n\n## Tech Stack\n\n| Component | Choice |\n|---|---|\n| Language | Go |\n| CLI framework | [Cobra](https://github.com/spf13/cobra) |\n| TUI framework | [Bubbletea](https://github.com/charmbracelet/bubbletea) + [Lipgloss](https://github.com/charmbracelet/lipgloss) |\n| Interactive forms | [Huh](https://github.com/charmbracelet/huh) |\n| OpenAPI parsing | [libopenapi](https://github.com/pb33f/libopenapi) |\n| HTTP client | net/http + [retryablehttp](https://github.com/hashicorp/go-retryablehttp) |\n\n## Development\n\n```bash\n# Build\nmake build\n\n# Run\nmake run\n\n# Test\nmake test\n\n# Clean\nmake clean\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapideck-libraries%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapideck-libraries%2Fcli/lists"}