apic

module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT

README ¶


apic

apic is epic: run API requests from plain .http files, in the terminal, in CI, or from an AI agent, on any platform, with one static binary.

CI Docs Latest release MIT licence

apic ui --demo

apic demo                        # terminal 1: a fake API, a project in ./apic-demo
cd apic-demo                     # terminal 2
apic run login                   # POST, capture the token
apic run whoami                  # reuse the token, check assertions
apic run auth.http --json | jq   # a file as a flow, one JSON line each
apic test                        # Gherkin features, same requests
claude mcp add api -- apic mcp   # an agent calls them as tools
apic ui --demo                   # or just the UI on the fake API

Install

brew install hungovercoders/tap/apic                              # macOS / Linux
go install github.com/hungovercoders/apic/cmd/apic@latest         # Go 1.26+
curl -fsSL https://raw.githubusercontent.com/hungovercoders/apic/main/install.sh | sh
irm https://raw.githubusercontent.com/hungovercoders/apic/main/install.ps1 | iex   # Windows

Packages, the Docker image and the GitHub Action: getting started.

Documentation

Everything is on apic.sh: getting started, the course, the CLI reference, the .http format and authentication.

Contributing

Read CONTRIBUTING.md first, AGENTS.md if you are an AI agent, and docs/README.md for the routing table for every doc in this repo. Report a credential that escapes privately (SECURITY.md).

Pipeline status

slopstopper

🔒 Security

DAST SAST Licences Secrets Dependency CVEs Dependency Review

🧹 Hygiene

Auto-label PRs Complexity CSP Exceptions Docs Accuracy Docs Size Docs Structure Privacy Statement Entry Files

✅ Reliability

Accessibility Broken Links Core Web Vitals E2E llms.txt robots.txt SEO Sitemap Smoke

🤖 Operational

Deployed Checks Workflow Failures

Licence

MIT; every release archive, package and image ships the notices for Go and the modules the binary links.

Directories ¶

Path Synopsis
cmd
apic command
Command apic runs .http request files for humans and AI agents.
Command apic runs .http request files for humans and AI agents.
internal
assert
Package assert parses and evaluates `# @assert` expressions: `<selector> <op> <value>`, `<selector> exists` / `not exists`, a predicate such as `<selector> isInteger` or `not isEmpty`, `<selector> length <op> <n>` and `<selector> matchesSchema <file>`.
Package assert parses and evaluates `# @assert` expressions: `<selector> <op> <value>`, `<selector> exists` / `not exists`, a predicate such as `<selector> isInteger` or `not isEmpty`, `<selector> length <op> <n>` and `<selector> matchesSchema <file>`.
auth
Package auth applies authentication to outgoing requests, driven by the `# @auth <type> [args]` directive or the `auth.default` setting in apic.yaml.
Package auth applies authentication to outgoing requests, driven by the `# @auth <type> [args]` directive or the `auth.default` setting in apic.yaml.
bdd
Package bdd runs Gherkin feature files against a project's .http requests with a fixed step vocabulary, using godog embedded in the binary.
Package bdd runs Gherkin feature files against a project's .http requests with a fixed step vocabulary, using godog embedded in the binary.
cli
Package cli wires the apic commands together.
Package cli wires the apic commands together.
curlimport
Package curlimport turns a curl command line into a `.http` request block, the reverse of `apic curl`: the common flags map onto the request line, headers, body and auth; the rest is reported, never fatal.
Package curlimport turns a curl command line into a `.http` request block, the reverse of `apic curl`: the common flags map onto the request line, headers, body and auth; the rest is reported, never fatal.
datafile
Package datafile reads the rows of a data-driven run, `apic run --data`: a CSV file whose header row names the columns, or a JSON array of objects.
Package datafile reads the rows of a data-driven run, `apic run --data`: a CSV file whose header row names the columns, or a JSON array of objects.
demoapi
Package demoapi backs `apic demo`: a tiny, fully in-memory HTTP API and its matching example .http project (embedded from project/), so apic can be tried with no network access and no git clone.
Package demoapi backs `apic demo`: a tiny, fully in-memory HTTP API and its matching example .http project (embedded from project/), so apic can be tried with no network access and no git clone.
env
Package env loads environment variable files:
Package env loads environment variable files:
history
Package history keeps the last few responses of each named request, per environment, so "what did this return yesterday?" has an answer.
Package history keeps the last few responses of each named request, per environment, so "what did this return yesterday?" has an answer.
httpfile
Package httpfile parses the common subset of the `.http` request file format used by VS Code REST Client, JetBrains HTTP Client, kulala.nvim and httpyac, plus apic's own `# @capture` / `# @assert` comment directives.
Package httpfile parses the common subset of the `.http` request file format used by VS Code REST Client, JetBrains HTTP Client, kulala.nvim and httpyac, plus apic's own `# @capture` / `# @assert` comment directives.
lessons
Package lessons reads the runnable blocks out of the course pages: the fenced code blocks under website/src/content/docs/learn (and the migration guides) that an `<!-- learn -->` comment marks as something a reader types.
Package lessons reads the runnable blocks out of the course pages: the fenced code blocks under website/src/content/docs/learn (and the migration guides) that an `<!-- learn -->` comment marks as something a reader types.
lsp
Package lsp is apic's language server: `apic lsp` speaks the Language Server Protocol over stdio, so any editor with an LSP client gets the diagnostics, completion, hover, code lenses and formatting the VS Code extension has, from the same code the CLI runs.
Package lsp is apic's language server: `apic lsp` speaks the Language Server Protocol over stdio, so any editor with an LSP client gets the diagnostics, completion, hover, code lenses and formatting the VS Code extension has, from the same code the CLI runs.
mcp
Package mcp exposes a project's requests to AI agents over the Model Context Protocol (stdio, or streamable HTTP behind a token), so an agent can discover and call an API without shelling out.
Package mcp exposes a project's requests to AI agents over the Model Context Protocol (stdio, or streamable HTTP behind a token), so an agent can discover and call an API without shelling out.
openapi
Package openapi scaffolds .http files from an OpenAPI 3 document: one file per tag, one named request per operation, path parameters as {{vars}} and an example body derived from the schema.
Package openapi scaffolds .http files from an OpenAPI 3 document: one file per tag, one named request per operation, path parameters as {{vars}} and an example body derived from the schema.
output
Package output renders run results for humans (coloured, readable) and for machines (one JSON object per result).
Package output renders run results for humans (coloured, readable) and for machines (one JSON object per result).
phrase
Package phrase turns `# @step` phrases such as `a user named {name} exists` into anchored regular expressions whose capture groups map to variables.
Package phrase turns `# @step` phrases such as `a user named {name} exists` into anchored regular expressions whose capture groups map to variables.
postman
Package postman turns a Postman collection (v2.1, or v2.0 where the shapes coincide) and its environments into .http files and env files: folders become files, requests become named requests, variables become http-client.env.json, and the trivial forms of pm.test scripts become `# @assert` and `# @capture` lines.
Package postman turns a Postman collection (v2.1, or v2.0 where the shapes coincide) and its environments into .http files and env files: folders become files, requests become named requests, variables become http-client.env.json, and the trivial forms of pm.test scripts become `# @assert` and `# @capture` lines.
project
Package project discovers .http files under a directory and indexes their requests by name.
Package project discovers .http files under a directory and indexes their requests by name.
report
Package report renders a self-contained HTML report of an `apic run` or an `apic test`: one file, inline CSS, no JavaScript needed to read it, light and dark through prefers-color-scheme.
Package report renders a self-contained HTML report of an `apic run` or an `apic test`: one file, inline CSS, no JavaScript needed to read it, light and dark through prefers-color-scheme.
runner
Package runner executes parsed requests: it resolves variables, sends the request, evaluates captures and assertions, and persists captured values to the session.
Package runner executes parsed requests: it resolves variables, sends the request, evaluates captures and assertions, and persists captured values to the session.
selector
Package selector extracts values from an HTTP response using the small selector language shared by `# @capture` and `# @assert`:
Package selector extracts values from an HTTP response using the small selector language shared by `# @capture` and `# @assert`:
session
Package session persists values captured from responses between apic invocations, so `apic run login` followed by `apic run get-user` works the way it does in a GUI client.
Package session persists values captured from responses between apic invocations, so `apic run login` followed by `apic run get-user` works the way it does in a GUI client.
snippet
Package snippet renders a resolved request as code that sends the same thing without apic: a curl command, an HTTPie command, PowerShell's Invoke-RestMethod, Python requests, JavaScript fetch or Go net/http.
Package snippet renders a resolved request as code that sends the same thing without apic: a curl command, an HTTPie command, PowerShell's Invoke-RestMethod, Python requests, JavaScript fetch or Go net/http.
suggest
Package suggest ranks the names a user probably meant when the one they typed matches nothing: request ids, environment names and the like.
Package suggest ranks the names a user probably meant when the one they typed matches nothing: request ids, environment names and the like.
template
Package template substitutes `{{expr}}` placeholders.
Package template substitutes `{{expr}}` placeholders.
ui
Package ui is the interactive terminal UI behind `apic ui`: a request list on the left, a tabbed detail pane on the right, and a status bar.
Package ui is the interactive terminal UI behind `apic ui`: a request list on the left, a tabbed detail pane on the right, and a status bar.
scripts
agenteval command
Command agenteval runs the skill's evals (skills/apic/evals/evals.json) through the Claude Code CLI against fresh `apic demo` projects, once with the skill installed and once without, and scores what the agent did rather than only what it answered: whether the task's outcome holds in the API or the files, which files it changed, whether it opened a secret file, how many requests it sent and how many selector or directive errors it hit on the way.
Command agenteval runs the skill's evals (skills/apic/evals/evals.json) through the Claude Code CLI against fresh `apic demo` projects, once with the skill installed and once without, and scores what the agent did rather than only what it answered: whether the task's outcome holds in the API or the files, which files it changed, whether it opened a secret file, how many requests it sent and how many selector or directive errors it hit on the way.
clidocs command
Command clidocs generates the "Commands and flags" section at the end of docs/cli.md and the man pages, from apic's own command tree, so the reference cannot drift from what the binary accepts.
Command clidocs generates the "Commands and flags" section at the end of docs/cli.md and the man pages, from apic's own command tree, so the reference cannot drift from what the binary accepts.
episodes command
Command episodes builds the course's YouTube episodes.
Command episodes builds the course's YouTube episodes.
errdocs command
Command errdocs writes docs/errors.md from runner.Catalogue and httpfile.Codes, so an error's code, exit status, hint and documentation live in one table in the code and cannot drift from the page.
Command errdocs writes docs/errors.md from runner.Catalogue and httpfile.Codes, so an error's code, exit status, hint and documentation live in one table in the code and cannot drift from the page.
internal/record
Package record is what the course's recorders share.
Package record is what the course's recorders share.
learncheck command
Command learncheck runs the commands in the course pages so a lesson cannot rot: it builds apic, starts `apic demo` in a scratch directory, then extracts every fenced block in the site's learn/*.md and migrate/*.md that is preceded by an `<!-- learn -->` comment (internal/lessons) and runs it there with `sh -e`, in page order (the course first, then the migration guides).
Command learncheck runs the commands in the course pages so a lesson cannot rot: it builds apic, starts `apic demo` in a scratch directory, then extracts every fenced block in the site's learn/*.md and migrate/*.md that is preceded by an `<!-- learn -->` comment (internal/lessons) and runs it there with `sh -e`, in page order (the course first, then the migration guides).
schemas command
Command schemas generates the JSON schemas for the files apic reads and writes: apic.yaml, http-client.env.json (and the private file, same shape) and .apic/session.json.
Command schemas generates the JSON schemas for the files apic reads and writes: apic.yaml, http-client.env.json (and the private file, same shape) and .apic/session.json.
shot command
Command shot regenerates the terminal screenshots in docs/assets from real apic output: it serves the demo API in-process, runs the requests the docs talk about, and renders the frames the CLI and the UI produce as SVG.
Command shot regenerates the terminal screenshots in docs/assets from real apic output: it serves the demo API in-process, runs the requests the docs talk about, and renders the frames the CLI and the UI produce as SVG.
skilldocs command
Command skilldocs writes skills/apic/references/cheatsheet.md from the site's cheatsheet.md, the one page an agent needs when it writes a request.
Command skilldocs writes skills/apic/references/cheatsheet.md from the site's cheatsheet.md, the one page an agent needs when it writes a request.
tapes command
Command tapes records the course's VHS tapes the same way every time.
Command tapes records the course's VHS tapes the same way every time.
Package skills carries the Agent Skill that `apic skill` prints and installs: skills/apic in this repository, compiled into the binary so a project gets it from `apic init` or `apic skill install` without the repository or a network.
Package skills carries the Agent Skill that `apic skill` prints and installs: skills/apic in this repository, compiled into the binary so a project gets it from `apic init` or `apic skill install` without the repository or a network.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL