You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every API's docs have a curl example, and every bug report has one. apic curl goes one way; the reverse (paste a curl, get a named request) is what Postman, Insomnia and Bruno all offer, and it is the quickest way to grow a project from zero.
Parses the common curl surface: -X/--request, -H/--header, -d/--data/--data-raw/--data-binary/--data-urlencode, -F/--form, -u/--user, --url, -G/--get, -b/--cookie, -A/--user-agent, -e/--referer, -k/--insecure, -L/--location, --compressed, @file bodies. Line continuations and both quote styles. Unknown flags are reported, not fatal.
Writes a ### block with # @name (from --name, else derived from method and path), # @assert status == 200, and < ./file for @file bodies. -u becomes # @auth basic, -k a comment noting --insecure.
Appends to --into (creating it if needed) or prints to stdout without --into. Rewrites the URL host as {{baseUrl}} when it matches the environment's baseUrl.
New internal/curlimport/ (tokeniser with shell quoting rules and a flag table), internal/cli/import.go.
Docs
docs/cli.md (import section), docs/cheatsheet.md, docs/cookbook.md ("Start from a curl command").
Tests
Table of curl lines to expected .http output, including tricky quoting, --data-urlencode, multi-line with backslashes, and unknown flags producing warnings.
Shipped in #103: apic import --curl '<command>' [--into file.http] [--name n], with --curl - reading stdin. The listed flags are all read (plus --json and --oauth2-bearer), both quote styles, $'…' escapes and line continuations; unknown flags and curl's own output/transport options are notes, not errors; -u becomes # @auth basic, -k a comment, -F a multipart body, @file a < ./file; the host becomes {{baseUrl}} when the environment has one; a body the parser would misread goes into a side file with --into. --json prints {"file", "name", "request", "warnings"}. Docs: cli (import), cookbook (Start from a curl command).
Activity
import: a curl command into a .http file (#48)
dataGriff commentedon Sep 20, 2026
Shipped in #103:
apic import --curl '<command>' [--into file.http] [--name n], with--curl -reading stdin. The listed flags are all read (plus--jsonand--oauth2-bearer), both quote styles,$'…'escapes and line continuations; unknown flags and curl's own output/transport options are notes, not errors;-ubecomes# @auth basic,-ka comment,-Fa multipart body,@filea< ./file; the host becomes{{baseUrl}}when the environment has one; a body the parser would misread goes into a side file with--into.--jsonprints{"file", "name", "request", "warnings"}. Docs: cli (import), cookbook (Start from a curl command).Generated by Claude Code