Early access

autocurl early access is now open.

Sign up for early access
autocurl Docs

Getting Started

Install autocurl, author requests in JavaScript, compile to .autocurl format, and execute requests directly from your terminal in under 2 minutes.

This guide walks you through installing autocurl, authoring your first request collection in JavaScript, generating human-readable .autocurl files, and executing requests interactively.


Step 1: Install autocurl

autocurl is distributed as a single static binary with zero external runtime dependencies. It utilizes the native curl binary already installed on your system.

The easiest way to install and keep autocurl updated:

brew install autocurl

To update autocurl in the future:

brew upgrade autocurl

Option B: Quick Shell Installer

For Linux servers, CI/CD runners, or environments without Homebrew:

curl -fsSL https://raw.githubusercontent.com/anshuman/autocurl/main/install.sh | bash

Option C: Manual Binary Download

Standalone binaries are available from GitHub Releases for all major platforms:

Operating SystemArchitecture
macOSApple Silicon (M1/M2/M3/M4) & Intel x86_64
Linuxx86_64 & ARM64 (aarch64)
Windowsx86_64 standalone executable (.exe)

Verifying Installation

Check that autocurl is accessible in your shell:

$ autocurl --version
autocurl 0.1.0 (x86_64-apple-darwin)

Requirements: autocurl relies on the standard curl executable. Ensure curl is available in your $PATH (available by default on macOS, modern Linux distributions, and Windows 10/11).


Step 2: Define your API requests in JavaScript

Create a file named requests.js (or index.js) in your project directory. Export an array of request objects:

// requests.js
export default [
  {
    name: "Health Check",
    method: "GET",
    url: "https://api.github.com/zen",
  },
  {
    name: "Fetch User Profile",
    method: "GET",
    url: "https://api.github.com/users/octocat",
    headers: {
      Accept: "application/vnd.github.v3+json",
      "User-Agent": "autocurl-client",
    },
  },
  {
    name: "Create Test Issue",
    method: "POST",
    url: "https://httpbin.org/post",
    headers: {
      "Content-Type": "application/json",
    },
    body: {
      title: "Found a bug in API",
      severity: "medium",
    },
  },
];

Step 3: Compile to plain .autocurl curl file

Run the compiler against your JavaScript file:

autocurl requests.js

autocurl evaluates the definitions and writes requests.autocurl:

# Health Check
curl -X GET \
  "https://api.github.com/zen"

# Fetch User Profile
curl -X GET \
  "https://api.github.com/users/octocat" \
  -H "Accept: application/vnd.github.v3+json" \
  -H "User-Agent: autocurl-client"

# Create Test Issue
curl -X POST \
  "https://httpbin.org/post" \
  -H "Content-Type: application/json" \
  -d '{"title":"Found a bug in API","severity":"medium"}'

Step 4: Pick and execute interactively

Pass the .autocurl file to autocurl to launch the interactive selector:

autocurl requests.autocurl

autocurl opens an interactive prompt in your terminal:

? Select a request to run:
  ❯ Health Check
    Fetch User Profile
    Create Test Issue

(Press ↑/↓ to move, Enter to execute, Ctrl+C to exit)

Select a request and press Enter. autocurl invokes native curl and prints the response status, headers, and body directly to your terminal.


Next: Using autocurl effectively → Learn the .autocurl specification, terminal picker shortcuts, direct execution flags, and real-world examples.

On this page