Principles for agent-native CLIs

twitter.com

38 points by blumpy22 4 hours ago


wolttam - 3 hours ago

Getting agents used to using `--force` to bypass prompts seems like a bad idea. `--force` is for when the action failed (or would fail) for some reason and you want it to definitely happen this time.

I think `--yes` or `--yes-do-the-dangerous-thing` is leagues better.

rahimnathwani - an hour ago

This guy took inspiration from gog cli (steipete's cli for Google Workspace, which predates gws cli and is apparently more agent-friendly and token-efficient):

https://github.com/mvanhorn/cli-printing-press

He made a whole bunch of agent-friendly CLIs: https://printingpress.dev/

https://github.com/mvanhorn/printing-press-library/tree/main...

tfrancisl - 2 hours ago

I dont want "agent-native CLIs" to proliferate because I'd rather we design CLIs for human use and programmatic (automation) use first. Agents are good at vomiting json between tool calls, I am not, and never will be.

Too many tools stray so wildly from UNIX principles. If we design for agents first we will likely see more and more of this.

debarshri - 2 hours ago

I think every CLI is agent native when invoked from claude or any coding agents.

I was really suprised today. We at adaptive [1], is an access management platform to access psql, mysql, vms, k8s etc. When you use `adaptive connect <db-name>` it would connect create just-in-time tunnel and connect the user to the database. You cannot do traditional psql operation etc. That design is by choice.

Today I was trying to invoke it via claude, and, god damn, it found a way to connect. It create a pseudo shell in python, pass the queries and treat our cli like a tool. This would have been humanly not possible. Partly because, you would like about risks, good practice/bad practice, would be scared to execute and write code like that, and it just did it and acheived the goal.

[1] https://adaptive.live

isityettime - 11 minutes ago

I broadly agree with the article. But I think it's wrong about the failures of past command-line interface design. The author writes:

> There's a deeper assumption underneath all of it. The classic Command Line Interface Guidelines treat a human at a terminal as the primary user, with agents as a tolerated secondary audience. That's no longer the right default. Cloudflare puts it directly in their post: "Increasingly, agents are the primary customer of our APIs." Their whole schema approach is built around that. HeyGen launched their CLI with "agent" in the marketing copy. Design for agents first, and humans benefit. Designing for humans first and bolting on agent support is what produces the inconsistent, prompt-prone, stdout-only CLIs the first five principles exist to correct.

I don't think that's true at all. If you're someone who has lived in the terminal for a few years, you will have a sense of taste that naturally leads you to do the right thing. If you've used Git and systemctl and you know why p7zip feels alien on Unix and you have cursed a command where `-h` doesn't mean help, nobody needs to tell you basically any of this. If you've ever met jq, you don't need anyone to tell you that `--json` is a very valuable thing to have. You also don't need anyone to tell you what a uniform hierarchy of flags and options with different scopes should look like; if you've used a program that uses subcommands, even a shitty one, you know what a good one should look like.

When command-line tools (or inconsistent collections thereof) are difficult for AI in the ways the article describes, it's because they're shit. When command-line tools are shit, it's because nobody is taking the design of those interfaces seriously at all, typically some combination of:

  - the interface isn't "designed" at all, it's just naively evolved.
  - you're leaving writing a CLI tool to someone who tolerates the command-line but doesn't live in it
  - the object is treated as only a human/interactive interface or only a programming interface when in fact it's always both
  - your suite of tools has diffuse ownership and nobody thinks command-line interfaces are important enough to have standards for
If you treat a GUI as unseriously as that, it invariably turns to a pile of shit, too!

Anybody who ought to be writing one has already internalized all the right norms. Most of it comes for free from living in the shell. Put one person in charge and it'll be uniform. If you can't, writing a style guide and enforcing it with linters and tests is a great idea. But this is just taking command-line interfaces seriously as interfaces. It has pretty much nothing to do with AI except at the edges (e.g., json-flavored companion to --help).

jiehong - 2 hours ago

This reminds me that agents sometimes really like heredoc in shells, and waste tokens retrying with a file.

walski - an hour ago

Definitively super human ultra intelligence by the end of Q4!!!!11 Also not able to use tools, which are not explicitly built for machine consumption.

sandermvanvliet - 2 hours ago

Is it me or are all these articles about using AI effectively and building for AI just, you know, things that we should have been doing all along?

It feels like most of the “rules” are “don’t be an ass to your consumer”.

ChrisArchitect - 2 hours ago

Non-x link: https://trevinsays.com/p/10-principles-for-agent-native-clis

arian_ - an hour ago

[dead]