Features
Early access
The CLI generator is in early access. Reach out to get started.
Generated CLIs ship with a common set of runtime flags and environment variables: output formatting, pagination, dry-run previewing, TLS and proxy configuration, exit codes, and structured logging. APIs with templated server URLs also expose per-variable flags and environment variables.
Output formatting
Use the --format flag to control how responses are displayed.
Dry-run mode
Pass --dry-run to validate arguments and preview the HTTP request without sending it. The CLI prints the method, URL, headers, and body it would send, then exits.
Pagination
For endpoints annotated with x-fern-pagination, the CLI auto-paginates when the --page-all flag is set.
Paginated output works with all output formats. For table and CSV formats, headers are only emitted on the first page so the output concatenates cleanly.
Passing parameters
Server URL variables
For APIs with templated server URLs (such as https://api.example.com/stores/{store_hash}/v3), the CLI automatically exposes each template variable as a CLI flag and environment variable.
File uploads and downloads
For endpoints with format: binary request bodies, pass a file path as the --file argument. For binary responses, use --output <PATH> to save the response body to a file.
Exit codes
All errors are emitted as structured JSON on stderr, making them easy to parse in scripts and CI pipelines.
TLS, proxies, and CA bundles
Every generated CLI honors environment variables for TLS and proxy configuration at runtime. Variables are scoped by binary name — <NAME> is the CLI’s binary name uppercased with hyphens mapped to underscores (for example, CONTOSO).
Standard environment variables (HTTPS_PROXY, HTTP_PROXY, NO_PROXY, SSL_CERT_FILE) are honored when the scoped overrides are absent.
Common scenarios
Behind a MITM proxy (Proxyman, Charles, mitmproxy):
Corporate network with a custom root CA:
Structured logging
Logging is off by default. Set <NAME>_LOG to a tracing filter to emit structured logs to stderr. Set <NAME>_LOG_FILE to a directory path to write daily rotated JSON log files.