Skip navigation
I'm concerned we're entering a local maxima with CLIs, they're the wrong interface for agents
0:00 / 0:47

I'm concerned we're entering a local maxima with CLIs, they're the wrong interface for agents

Rhys

@RhysSullivan64K followers

Visit on X
713 likesDownloadOriginal post

221,413 views

I'm concerned we're entering a local maxima with CLIs, they're the wrong interface for agents The right interface is regular REST APIs with CIMD (same spec that MCP uses to allow for dynamic client registration) Your agent then writes code to interact with the API (like Cloudflare codemode) Think about how this works for humans today for the following action: "I want to set a DNS record on my domain" -> You Google "Vercel set DNS records" -> Docs page tells you what buttons to press -> You press buttons on a website, those call an API Now for agents, they search Google: -> "Set DNS record on Vercel Domain" -> they land on the same docs page, except it outlines what api endpoints are used as well -> the agent then calls those api endpoints for you, credentials are dynamically inserted where the agent can run them -> (optional) set auto approval policies / require approval of all non GET options by default You don't need separate interfaces for agents, nor do you really need separate skills for them CLIs have terrible discoverability, no input / output typing, they're harder to make profiles for for allowed / disallowed tools They work as a stop gap solution, but companies should be focusing on making good docs and APIs, not CLIs I've been prototyping this over at (open source if you want to play with what this world would look like - still early on it so appreciate feedback - open source and can run completely on your machine

62 Comments

Comments from the original post on X (Twitter)

  • patagucci perf papi's profile picture

    @kenwheeler

    classic first day guy behavior

    28 likes

  • Rhys's profile picture

    @RhysSullivan

    where this really mogs CLIs is in being able to help the agent recover take this example the agent hallucinates tools.github.create_issue when it's actually tools.issues.create since you have the entire set of tools indexed, you can search the called tool path

    27 likes

  • Rhys's profile picture

    @RhysSullivan

    typo in the post: "dynamically inserted where the agent can run them" should be "dynamically inserted where the agent can't access them" at least you know my content is human

    13 likes

  • Rhys's profile picture

    @RhysSullivan

    Last thing is this needs to be invisible to the agent and the user I like executor and what I’ve built but it’s not the final form of this, companies building agents should implement their own execution environment that handles all of this automatically

    11 likes

  • swyx 🗽 @aiDotEngineer's profile picture

    @swyx

    uhhh didnt you just join a cli company haha (i love it)

    26 likes

  • Rhys's profile picture

    @RhysSullivan

    joined an agent company! i wanna try putting some of these concepts into opencode to let the agent access things like the typescript LSP without bloating its context but i think they're actually less relevant for coding agents rip-grep 100% should be a CLI, polymarket shouldn't

    34 likes

  • swyx 🗽 @aiDotEngineer's profile picture

    @swyx

    i think this is a good topic. for an essay ive been meaning to write about subagents

    5 likes

  • John McBride's profile picture

    @johncodes

    This makes no sense. > CLIs have terrible discoverability Run “tool —help”, understand the whole tool > no input / output typing There’s a whole posix completions api. Look it up. > they're harder to make profiles for for allowed / disallowed tools Distribute a specific CLI for a specific tool: CLIs are so much easier to make / build vs. expecting a server to filter tools based on an IDPs permissions in a JWT after it’s dynamically registered itself (risky anyways - confused deputy problem)

    22 likes

  • Rhys's profile picture

    @RhysSullivan

    - how do you know what literally all tools are on your system - are you going to install a CLI for every single app you want to interact with? - didn’t know about the competitions api but does that handle output typing? - how do you handle being signed in to 3 accounts of the same CLI? We’ve had APIs for interacting with services for 20+ years I don’t see why we need to start using CLIs for everything when the agents can just call APIs - my parents aren’t ever gonna figure out installing a CLI nor do they understand the risks that come with having that run on your computer

    4 likes

  • John McBride's profile picture

    @johncodes

    > how do you know what literally all tools are on your system Manifests, SBOMs, tool registries, env/context specific tool/path discovery, so many ways to approach this. > are you going to install a CLI for every single app you want to interact with? Are you going to ship an a web app and and client API and service and database and backend for everything you want an agent to interact with? > didn’t know about the competitions api but does that handle output typing? tool output-schema # dumps the json schema for the output tools or just have a well defined rpc that the CLI can output. Could be as simple as a JSON contract that has a few well defined blobs that can be validated. > how do you handle being signed in to 3 accounts of the same CLI? The same way the aws, gcloud, and kubectl CLIs handle this: with profiles and context switching. > my parents aren’t ever gonna figure out installing a CLI nor do they understand the risks that come with having that run on your computer Do your parents use Zoom? Surprise! It's actually a Python CLI with an windowing API! The industry has been shipping CLIs since the dawn of computing: so unnecessary to make everything a service that has to have discoverability and it's own special form of auth and all this infra to make it work. I don't disagree that APIs are how agents get real things done: they can just use well defined CLIs instead of having to round trip all the way out to a service. Keep it simple, keep it a CLI.

    13 likes

  • Burke Holland's profile picture

    @burkeholland

    I don’t know. The problem with APIs are that they are a mess of just however people think a proper REST API works. It’s 2026 and nobody knows for sure. Combine that with the fact that auth today is a mess of windows and callbacks and two factor. The appeal of CLIs is that they obscure all of this into something that is very easy to use. And CLIs are quite discoverable. “help” is a universal standard without ever being defined as one. Yes some CLIs are not great. But the answer is a better CLI. Which by the way is far easier to rollout than API changes which might break your whole platform. Especially if you employee me and I vibe coded some nonsense. 🫰 You make a good point on tool restriction. That one I’m not sure about other than I never ever use tool restrictions. But of course you do need them. I wouldn’t want an agent just going full ham on a production stripe instance. Maybe partial ham. Slightly ham. I think CLIs are the answer if nothing else because they are the simplest one.

    21 likes

  • Rhys's profile picture

    @RhysSullivan

    Ehhhhh I’m still not sure I’m convinced, imo it’s easier to get everyone having good rest APIs than CLIs With CLIs is the Wild West of how people are defining things, APIs are very structured there just needs to be a forcing factor getting people to adopt it Along with that for agents running outside of local environments it’s a lot easier to integrate with APIs than CLIs and most CLIs are calling APIs anyways so may as well cut out the middleman

    3 likes

  • Claudius Maximus's profile picture

    @ClaudiusMaxx

    CLIs win right now because they already exist and agents can use them today. APIs are the better long-term interface but "better" doesn't matter if nobody's built the agent-native API layer yet. the pragmatic answer is both. CLIs for now, APIs once the tooling catches up.

    8 likes

  • Rhys's profile picture

    @RhysSullivan

    yeah my concern is that we get stuck in this 'CLIs are better' mindset and it stalls adoption of better approaches i.e companies are pivoting to making their CLIs really good rather than their APIs, along with that now agent companies aren't focused on the execution layer

    2 likes

  • Brenner's profile picture

    @BrennerSpear

    @ClaudiusMaxx I’m not worried we’ll get stuck Enterprises care a lot about Allowlisting / Blocklisting certain actions, which is not possible with a CLI, but can be done with a configurable MCP / interface

  • Claudius Maximus's profile picture

    @ClaudiusMaxx

    @RhysSullivan enterprise demand will force the transition. once a CISO asks "can you restrict which commands this agent runs" the CLI-only crowd either builds a permission layer or loses the contract. market pressure solves this faster than any standard will

    1 like

  • Tommy D. Rossi's profile picture

    @__morse

    nah cli is gonna win. agents want to stay as high as possible in the stack. browser and apps would be optimal. but too slow and bulky. so next best thing is cli

    7 likes

  • Rhys's profile picture

    @RhysSullivan

    Them calling an API is no different than calling a CLI though

    2 likes

  • Tommy D. Rossi's profile picture

    @__morse

    agents try to imitate humans, why would you use an API if there is a CLI?

    2 likes

  • Rhys's profile picture

    @RhysSullivan

    99% of apps don't have a CLIs today but they do have APIs, something like the pup cli from datadog shouldn't exist since your agent should just be calling the api instead is much more efficient for the agent to discover the api call it needs, CIMD Oauth to store credentials, and then call it via codemode

    6 likes