Releases: rizukirr/apic
v0.2.2
apic v0.2.2
A feature release centered on importing existing Postman collections into apic, plus recursive folder validation and full HTTP-method coverage.
New: apic convert — import Postman collections
Bring an existing Postman Collection into apic as per-endpoint contract files.
apic convert --postman MyAPI.postman_collection.json [--destination <dir>]
- All export versions supported: v1.0.0, v2.0.0, and v2.1.0 (auto-detected).
- Mirrors your collection's folders — each Postman folder becomes a directory, each request becomes one JSON contract (
folder/request_name.json), at any nesting depth. --destinationis optional — defaults to the working directory from.apic/config.toml. Paths are confined to the working directory; existing files are never overwritten.- Robust parser — only the fields apic uses are read, so any real-world collection imports cleanly regardless of Postman features it uses (auth, scripts, events, cookies, …). Those unused fields are ignored.
- No silent data loss on methods — see HEAD/OPTIONS below.
Recursive folder validation
apic validate can now validate a whole subtree:
apic validate -f auth/ # validates every contract under auth/, recursively
apic validate -f auth/login # single contract (unchanged)
apic validate # everything (unchanged)
A query ending in / means "validate this folder"; without the slash, resolution is the usual single-contract behavior. Validation output now uses forward-slash paths consistently across platforms.
--filename → --find
The long flag is renamed on the commands that resolve an existing contract: read, open, remove, validate now use --find (the flag does a fuzzy find, not a filename). create keeps --filename since it names a new file. The short -f is unchanged everywhere, so existing -f usage keeps working.
Scripts using the long form
--filenameon read/open/remove/validate must switch to--find.
HEAD and OPTIONS methods
HEAD and OPTIONS are now first-class HTTP methods across apic — in contracts, the read/validate rendering (HEAD cyan, OPTIONS white), and the TUI method cycler. apic convert maps them natively. Any method apic still doesn't model (e.g. TRACE, CONNECT, custom verbs) is imported as GET with a clear warning, so nothing is downgraded silently:
warning: request "Debug" uses method TRACE, unsupported by apic — imported as GET
Converted 3 contract(s) into out (1 warning)
Notes
- Existing contracts are fully compatible — no migration needed.
- Verified on Linux, macOS, and Windows;
cargo fmt,clippy -D warnings, and the full test suite (199 tests) pass.
Full changelog: v0.2.1...v0.2.2
v0.2.1
apic v0.2.1
A patch release that fixes opening the project template in the interactive TUI.
🐛 Bug fixes
apic open --template no longer fails to open the TUI (#15)
Running apic open --template aborted before the editor could start:
Error: /path/to/.apic/template.json is not a valid contract: missing field `name` at line 87 column 1
Root cause
.apic/template.json is a partial overlay — by design it only carries the
fields a project wants to override, so required fields such as name are
usually absent. The open --template path parsed that file directly as if it
were a complete contract, so any partial template failed validation and the TUI
never launched.
Fix
The template is now merged onto the built-in default before it is parsed,
so every required field is present:
- The partial
.apic/template.jsonis overlaid onto the embedded
contract.jsondefault (overlay values win; the default fills every gap),
then validated and handed to the TUI as a complete contract. - The merge helper (
template::merge_onto_default) is reused for this path
instead of the create-time seeder, which intentionally blanks the built-in's
scalar values and was the wrong tool for editing an existing template. apic open -f <contract>continues to read and parse the targeted file
directly, unaffected by this change.
📦 Changes
- fix: open template on tui not working (#15)
Full changelog: v0.2.0...v0.2.1
⬇️ Installation
Prebuilt binaries are attached below for Linux, macOS, and Windows. Each
archive ships with a matching .sha256 checksum.
| Platform | Asset |
|---|---|
| Linux (x86_64) | apic-v0.2.1-x86_64-unknown-linux-gnu.tar.gz |
| Linux (aarch64) | apic-v0.2.1-aarch64-unknown-linux-gnu.tar.gz |
| macOS (Intel) | apic-v0.2.1-x86_64-apple-darwin.tar.gz |
| macOS (Apple Silicon) | apic-v0.2.1-aarch64-apple-darwin.tar.gz |
| Windows (x86_64) | apic-v0.2.1-x86_64-pc-windows-msvc.zip |
Example (Linux/macOS):
tar -xzf apic-v0.2.1-x86_64-unknown-linux-gnu.tar.gz
./apic --version # apic 0.2.1Or build from source:
cargo install --git https://github.com/rizukirr/apic --tag v0.2.1apic v0.2.0
apic v0.2.0
An interactive terminal UI is now the default way to author contracts. Run apic create or apic open and edit your contract in place, with the same rendering you get from apic read.
New
- Interactive authoring TUI — the default surface for
apic createandapic open. A borderless, table-based view with two-level navigation: move between rows, focus a cell, then edit. The external editor remains available behind--editor. - Inline editing for every field — type into text cells, cycle enums, and toggle booleans without leaving the table. Name and Description drop straight into insert mode on Enter.
- JSON example editor — open a request/response example in an inline modal, or auto-generate one from the schema with
g. - Schema editing — add nested schema fields with a context-aware
akey, toggleobject/object[]types, and add or delete list rows in place. - Response editing — add responses, edit their status code and description, and switch body type through expandable titles. A new response drops straight into its code cell.
- Selectable section titles — VARIABLE / QUERY / HEADERS titles are selectable so empty sections still accept new entries.
- Tab / Shift-Tab move to the next/previous cell while typing, staying in insert mode.
- Accurate unsaved-changes detection — the status line compares against a saved baseline instead of guessing, so the dirty marker reflects real edits.
Behavior
apic createseeds builtin scalar defaults and empty arrays, so a fresh contract is valid and ready to edit.
Quality of life
- The selected row is centered in the viewport with bottom padding, and scrolling follows the cursor so the active field stays in view.
- Cursor styling makes focus obvious: red row cursor, yellow on the focused cell, white-bold method and expand markers.
- Bordered confirm / help popups, with explicit quit and delete confirmations.
- Queued input is coalesced into a single redraw per burst for snappier navigation and typing.
Under the hood
- Upgraded to ratatui 0.30 via ratatui-textarea, consolidating on a single crossterm 0.29.
Install
cargo install apic-cliOr download a prebuilt binary for your platform from the assets below (macOS arm64/x64, Linux x64) and verify with the matching .sha256.
Full changelog: v0.1.1...v0.2.0
v0.2.0-beta03
Third beta of the interactive authoring TUI. See v0.2.0-beta01 for the full TUI overview and v0.2.0-beta02 for the create-experience fixes.
⚠️ Beta — please try it and report issues.
Changes since beta02
Faster cell entry — while typing in a cell, Tab commits the value and jumps to the next cell (staying in insert mode on text cells so you can keep typing); Shift+Tab goes to the previous cell. Rip through a row's fields without leaving insert mode.
Dependencies brought current — upgraded to ratatui 0.30 (via the official ratatui-textarea 0.9 widget, replacing the unmaintained tui-textarea). The crate now resolves to a single crossterm 0.29, dropping the previous dual-version workaround. No behavior change beyond the snappier editor; this is groundwork for the upcoming 0.2.0 stable.
Install
Prebuilt binaries for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon), and Windows (x86_64) are attached below — each with a .sha256.
From source:
cargo install --git https://github.com/rizukirr/apic --tag v0.2.0-beta03
v0.2.0-beta02
Second beta of the interactive authoring TUI, fixing the create experience and adding array-body support. See v0.2.0-beta01 for the full TUI overview.
⚠️ Beta — please try it and report issues.
Changes since beta01
Sane create defaults (#13)
- A new contract now keeps the template's scalar defaults and starts arrays empty — no more
POST ///, blank name, or junk empty rows in VARIABLE/QUERY/REQUEST. Your.apic/template.jsonstill overlays its own headers/responses/etc. - The
REQcolumn renders✓/ blank, exactly likeapic read(instead oftrue/false). - A request/response with no fields shows
(none)instead of an empty table or(no example provided).
Array request/response bodies (#12)
- The body
typeis a toggle betweenobjectandobject[]— expand aREQUEST/RESPONSEtitle and pressEnteron thetyperow (no free text). g(generate example) is array-aware: anobject[]body generates a one-element array[ { … } ].
Install
Prebuilt binaries for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon), and Windows (x86_64) are attached below — each with a .sha256.
From source:
cargo install --git https://github.com/rizukirr/apic --tag v0.2.0-beta02
v0.2.0-beta01
First beta of the interactive authoring TUI — a new in-terminal editor for creating and editing contracts, now the default for apic create and apic open. The external-editor workflow is unchanged and still available via --editor.
⚠️ Beta — please try it out and report any issues.
Interactive authoring TUI
apic create <file> and apic open <file> open an editor that renders the contract exactly like apic read — same header, VARIABLE/QUERY/HEADERS/REQUEST/RESPONSE sections, nested ├─/└─ fields, and inline JSON examples — and lets you edit it in place.
Navigation
↑/↓(orj/k) select a row ·Entersteps into its cells ·←/→(orh/l) move between cells ·Escsteps back.
Editing
Enter/iedit a text cell;Entercycles the HTTP method, toggles arequiredflag, or toggles a bodytypebetweenobjectandobject[].Enteron theMETHOD urlline edits protocol / host / path;Enteron aREQUEST/RESPONSEtitle edits its code / description / type;Esccollapses.
Structure
aadds a row to the current section — a nested field when you're on anobjectfield, or a new response on the+ add responseline.ddeletes the selected row, with a confirmation popup.
Examples
Enteron an example opens a multiline JSON editor.ggenerates a sample example from the schema (a one-element array forobject[]bodies).
Saving
Ctrl-Svalidates the contract and writes it. An accurate unsaved-changes indicator and a quit-confirmation guard against accidental loss.?shows the full key map.
Keep your own editor? apic create/open --editor "<cmd>" (e.g. --editor "code --wait") preserves the $VISUAL/$EDITOR flow.
Under the hood
- Renders identically to
apic readby reusing its formatting; no changes to the on-disk contract format or toread/validate/list. - Adds
ratatuiandtui-textareafor the TUI.
Install
Prebuilt binaries for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon), and Windows (x86_64) are attached below — each with a .sha256 checksum.
From source:
cargo install --git https://github.com/rizukirr/apic --tag v0.2.0-beta01
v0.1.1
apic v0.1.1
Template validation: catch a broken project template before it bites you.
New
apic validate --template— validates your project's.apic/template.json(as it merges onto the built-in default), printingok/FAILand exiting non-zero on failure, so it can gate CI or a pre-commit hook. Mutually exclusive with--filename.
Behavior change
apic createnow fails on an invalid project template. Previously, if.apic/template.jsonexisted but was malformed (bad JSON, or an overlay that merged into an invalid contract),createprinted a warning and silently scaffolded from the built-in template. It now aborts with an error and writes nothing, so a broken template can't go unnoticed.- The zero-config path is unchanged: no project, a missing template file, or a freshly seeded template still use the built-in template silently. Only an existing-but-invalid template is a hard error.
Under the hood
validate --templateandcreateshare a single definition of a "valid template" (merge_onto_default), so they can never disagree.
Install
cargo install apic-cliOr download a prebuilt binary for your platform from the assets below (macOS arm64/x64, Linux x64) and verify with the matching .sha256.
Full changelog: v0.1.0...v0.1.1
v0.1.0-beta.2
apic 0.1.0-beta.2 (beta)
Changes since beta.1:
- list: replace --depth with fuzzy --filter
- Multipart support: file fields with optional accept (ACCEPT column)
- BREAKING: request is now { schema, example }; responses gain optional
example and schema became optional
- read --example shows raw JSON payloads; default view shows examples
beneath schema tables
- list defaults to relative paths
v0.1.0-beta.1
apic 0.1.0-beta.1 (beta)