The best code is no code: composing APIs and CLIs in the era of LLMs
#LLMs

The best code is no code: composing APIs and CLIs in the era of LLMs

Startups Reporter
1 min read

A technical exploration of how CLI composition outperforms traditional tool-calling for LLM agents, enabling efficient API interactions without custom code.

In early 2026, a fundamental divide exists in how developers structure tool interactions for large language models. One camp advocates defining fine-grained API tools—like dedicated functions for listing GitHub pull requests. Another growing faction champions a radical alternative: teaching models to invoke shell commands rather than proprietary protocols. This CLI-first approach unlocks Unix's core strength—command composition—allowing LLMs to construct pipelines without intermediate prompting, drastically reducing token costs while producing executable scripts humans can modify.

Consider accessing Google Docs through an agent. The conventional path involves creating API wrappers handling authentication and endpoints. But why write code when specifications exist? Tools like Restish interpret OpenAPI specs as executable programs: restish api configure cool-api https://api.rest.sh/openapi.yaml registers an API, while restish cool-api list-images calls endpoints directly. Restish even generates shell completions, transforming specs into discoverable CLIs.

Authentication posed another hurdle. Instead of coding OAuth flows, oauth2c serves as a universal OAuth 2.0 client. A wrapper script combines these tools: oauth2c "https://accounts.google.com/..." | restish google drive-files-list replaces hundreds of lines of Python. For secure token storage on macOS, the security CLI enables biometric protection via security add-generic-password -T"" ..., ensuring refresh tokens require device passcode access.

This paradigm shines against services lacking machine-readable APIs. To scrape Google Groups, developers capture network activity as HAR files (cloudflare/har-sanitizer), then prompt LLMs to generate clients from the traffic patterns. While not yet combined with spec generation, this demonstrates how CLI composition enables "adversarial interoperability"—building interfaces where none exist.

The implications are profound. By treating APIs and authentication standards as languages with CLI interpreters, developers avoid maintaining brittle integration code. Agents produce pipelines compatible with human operators, while token efficiency improves through native command chaining. As exemplified by bmwalters/gdrive-client, this approach reduces surface area for bugs and shifts focus from writing glue code to composing powerful toolchains.

Comments

Loading comments...