DEV Community

Sanjay Kumar Sah
Sanjay Kumar Sah

Posted on

Meet Apicraft โ€“ A Zero-Dependency CLI that Replaces Postman, curl, and Mock Servers

๐ŸŽจ 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
Enter fullscreen mode Exit fullscreen mode

First request:

apicraft get https://api.github.com/users/sanjaysah101
Enter fullscreen mode Exit fullscreen mode

Set environments:

apicraft set baseUrl https://api.example.com
apicraft get {{baseUrl}}/users
Enter fullscreen mode Exit fullscreen mode

๐ŸŽญ 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
Enter fullscreen mode Exit fullscreen mode

Now you can call:

http://localhost:3000/users
Enter fullscreen mode Exit fullscreen mode

๐Ÿ† 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 (1)

Collapse
 
subhadip_pahari_1cd6ddc60 profile image
subhadip pahari

great