Monday, May 12, 2025

4 minutes

Posted by

Orlando Kalossakas

CTO & Co-Founder

Ship to production in one command: introducing the Toolhouse CLI

Today, we're thrilled to usher a new era of simplicity by introducing the Toolhouse CLI, agent files, and a new streaming API.

The Toolhouse CLI: meeting developers where they are

CLIs respond to a clear developer need: make me configure and use your platform in the environment I use. Engineers live in their IDEs and terminals, and they will need to incorporate your technology in their existing workflows. Besides, they find distracting and time consuming to switching their focus away from their development environment.

We built the Toolhouse CLI with two principles in mind: simplicity and magic.

In the Toolhouse CLI (or th for short), users define an agent in a Toolhouse agent specification file (referred to as "th files" for short). Each th file is a YAML file with a configuration that the CLI can read. The file contains the prompt, a CLI-generated chat ID, and default values for variables, bundles, and other metadata.

To get started:

th login: This command ensures the CLI has your API key through browser authentication. As you may expect, Toolhouse handles all the details for you, and you’ll find this flow particularly satisfying to use (though you’ll only need it once!)

The API key is then stored in your home directory in a dot file named .toolhouse.

From there, you can type:

th new demo.yaml or simply th new and follow the on-screen instructions.

This creates a .th file with a preloaded default template. You can then open it in your editor of choice and begin building your own agent or test it immediately with the default values using:

th run demo.yaml

This command will run your agent on the Toolhouse runtime and automatically connect it to our MCP servers. Your agent will be able to perform actions based on its prompts. All this happens seamlessly – you don’t have to build any custom integration or debug code.

This outputs a screen similar to the below output:


You can run th run as many times as you like as you iterate on your th file.

Once you are satisfied with the agent's output, you can deploy it with the command:

th deploy demo.yaml

Your agent will be immediately deployed on the Toolhouse infrastructure, and you will be able to query your agent via API because:

  • Your agent has been deployed.

  • Every deployed agent has its own endpoint that you can call via API with your API key.

This is the output to expect after a successful deployment.

⠸ Deploying agent: demo.yaml
✔ Deployed agent: demo.yaml

   ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                                                          │
   │   Agent th-agents/demo.yaml deployed successfully                                                                        │
   │                                                                                                                          │
   │   URL         <https://agents.toolhouse.ai/ff1234-1hh41nq-fa983uh-8731892>                                                 │
   │   Visibility  Private                                                                                                    │
   │   Region      us-west-1                                                                                                  │
   │   Instance    standard-1x                                                                                                │
   │                                                                                                                          │
   │                                                                                                                          │
   │   Next suggested action                                                                                                  │
   │                                                                                                                          │
   │   ┌ curl -X POST <https://agents.toolhouse.ai/ff1234-1hh41nq-fa983uh-8731892>

A new streaming API

As you just read, th deploy turns any agent into an API. This is a completely new API we’re introducing today, called the Streaming API. This API allows you to call your agent, connect it to our MCP servers, and stream its results in real time. We made the DX extremely straightforward: a simple POST call will run the agent with its default settings. You are always in control, so you can customize your API call, for example by passing specific variables or end user metadata.

In addition to autonomous use cases, the Streaming API can help you to build conversational agents, allowing you to support all the use cases you want to build.

Check out our documentation to learn how to build on top of this new API.

The future is bright for CLI users (both human and agentic)

These changes are just the beginning of a new era for agentic development. Soon, our backend-as-a-service will give you the ability to specify deployment regions and instance types, as well as bringing your own models. The th file will include even more options

Despite the prevalence of GUIs, the power, flexibility, and efficiency of CLIs have ensured their continued importance in the computing landscape.

Like human engineers, AI agents can leverage the efficiency inherent in CLIs (due to strict command patterns) and their feedback loops. Feedback is crucial; if you make a mistake, you receive a clarifying error message. If you succeed, you receive a success message with options for the next steps.

AI agents can easily generate, recover from errors, and succeed within this pattern that CLIs employ.

Furthermore, agents and humans can build and execute scripts composed of various CLI commands, allowing them to perform complex and repetitive tasks efficiently without human intervention.

The future is bright for CLI users → both human and agentic!

Monday, May 12, 2025

4 minutes

Posted by

Orlando Kalossakas

CTO & Co-Founder