Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why I built a CLI when I already had a VS Code extension

HTTP Forge started as a VS Code extension. That was the right place to start: the editor is where you write the code, so it's where you want to inspect responses and fix requests. But the extension had a ceiling. A GUI can't run on a build server, can't be piped into jq , and can't be driven cheaply by an AI agent. The more I used HTTP Forge for real work, the more the missing piece was obvious:…

HTTP Forge began as a VS Code extension, an ideal starting point. However, the extension had limitations. It couldn't run on build servers, be piped into tools like jq, or be easily driven by AI agents. The most glaring gap was the absence of a command-line interface (CLI). This prompted the creation of a CLI, explaining its purpose and when it's still advantageous to use the extension or the MCP server instead.

The CLI isn't a separate implementation but rather a thin adapter to the same core engine (@http-forge/core) as the extension and the MCP server. This core engine handles execution, collections, suites, discovery, and more.

There are three key reasons to have a CLI:

1. Continuous Integration (CI) doesn't run GUIs—no editor, no display, no interactive prompts. A deterministic exit code and machine-readable report are necessary. The CLI provides this, with commands like `http-forge run suite smoke-tests --environment staging --reporter junit:results/junit.xml --exit-code`.

2. AI agents work more efficiently with a CLI than a tool schema. A CLI requires fewer tokens and provides a more natural interface for agents. It enables low token usage while maintaining structure where needed.

3. The CLI is scriptable, allowing output to be piped for further processing. For instance, `http-forge run suite smoke-tests --output json | jq '.failedRequests[].name'` can be used to fail only if the auth suite is broken.

The CLI also promotes a local-first approach, running locally without the need for a login or a background service. This makes it suitable for air-gapped environments, reproducibility, cost savings, and an easy onboarding experience for HTTP Forge.

While the CLI offers many benefits, it does have some limitations. It's not a TUI or a deployment tool, and it doesn't hide errors. Its purpose is to turn HTTP Forge from a tool that's only used manually into one that can be automated.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 30 October →