π¨ Introducing Apicraft β A Unified CLI for the Complete API Development Lifecycle
If youβre a developer who lives in the terminal, chances are you juggle multiple tools:
-
curl
for quick requests - Postman or Insomnia for testing and environments
- Mock servers for frontend dev
- And maybe code snippets for fetch/axios
Wouldnβt it be great if you could do all of that in one CLI tool β with zero dependencies?
Thatβs exactly why I built Apicraft π
β¨ What is Apicraft?
Apicraft is a unified CLI tool for API development. It handles everything from testing to mocking to code generation β all inside your terminal.
π Key features:
- π Send beautifully formatted HTTP requests (GET, POST, PUT, DELETE, PATCH)
- π§ Manage environments (dev/prod) and use variable interpolation
- πΎ Save & replay requests (never retype the same curl again!)
- π Track request history and replay any request
- π Spin up mock servers from JSON files instantly
- π Generate fetch/axios/curl code from requests
- β‘ Zero dependencies β pure Node.js built-ins
π Quick Start
Install globally:
pnpm install -g @ansospace/apicraft
# or
npm install -g @ansospace/apicraft
First request:
apicraft get https://api.github.com/users/sanjaysah101
Set environments:
apicraft set baseUrl https://api.example.com
apicraft get {{baseUrl}}/users
π Mock Server Example
Need a quick backend while your team builds APIs? Just drop JSON files in a folder and run:
apicraft mock ./mocks 3000
Now you can call:
http://localhost:3000/users
π Why Apicraft?
Unlike Postman, curl, or httpie β Apicraft is:
- CLI-native
- Zero-dependency
- Git-friendly (config in version control)
- Includes built-in mocking + code generation
π‘ Why I Built This
I created Apicraft for the 100lines.dev Hackathon with a strict 300-line limit. That constraint forced me to focus only on features that matter most β and make them as compact and efficient as possible.
π¦ Try it Out
π Install from npm: @ansospace/apicraft
π GitHub repo: github.com/sanjaysah101/apicraft
Would love to hear your thoughts β what would make this CLI even more useful for your workflow? π
Top comments (0)