Murli - Making CLI tools speak natively to AI agents

Murli - Making CLI tools speak natively to AI agents

June 3, 2026

While building out experiments like Riffle I started thinking about the agent experience of CLI tools. Many libraries exist that help make CLI tools more accessible and pleasant to use for humans in a terminal emulator, and the thinking here is rich and well established - clig.dev is an excellent resource on this.

But intuitively, AI agents are not consuming CLI output in the same way that humans do, so it stands to reason that when we are building CLI tools that could get called by an AI agent, we should be optimising that output for the agent and not a human. Turns out, this was not a novel idea either - Cloudflare’s wrangler rebuild and the Google Workspace CLI are practical examples where this thinking has landed. Perhaps the largest influence for me is Trevin Chow’s 10 principles for agent-native CLIs. I was also inspired by the Rust Token Killer.

From all of this, there were five areas I wanted to embed in my CLIs:

  • output decoupling: humans get formatted output, agents get structured data. Ideally the user (agent or human) should not have to specify.
  • self description: the CLI should be able to describe, at runtime, its capabilities without needing to fetch external documentation.
  • conventional vocabulary: commands, verbs, and flags should have consistent naming across tolls so that agents can generalise.
  • structured errors: an error should tell an agent what failed, why, and how to fix it. Not just say something went wrong.
  • token efficiency: don’t return noise that the agent doesn’t need.

I then turned to implementation, and whether these ideas and principles could be added automatically, without needing to explicitly code up each one. What started as an extension to spf13/cobra quickly evolved to also support urfave/cli v2, and urfave/cli v3. And since I was supporting go, why not a bunch of other languages. And so, I now have a sprawling experiment called murli. The idea behind these libraries is that by simply adding them, they extend your existing CLI library with defaults that make your CLI more agent-aware and agent-friendly. The principle is that it enables, but doesn’t enforce. Use only what you want and what makes sense to you.

If you want to try it out, play with it or even contribute, there are a bunch of supported languages and libraries on https://github.com/murli-cli, as well as a demo CLI tool where each branch shows the commits to enable for that language and library.