Command-line interfaces (CLIs) are the unsung heroes of the developer world. They are powerful, fast, and form the backbone of everything from Git commands to complex cloud deployments. But let's be honest: building, distributing, and maintaining them can be a tedious chore. The boilerplate, argument parsing, versioning conflicts, and distribution headaches often overshadow the core logic you actually want to ship.
What if you could bypass all that friction? What if creating a secure, scalable, and instantly shareable CLI was as simple as defining an API endpoint?
That's the paradigm shift we're introducing with cli.do—a service that lets you build and deploy command-line interfaces the agentic way. It's time to stop thinking about CLIs as local binaries and start treating them as what they truly are: powerful APIs for your terminal.
For years, building a CLI has followed a familiar, often frustrating, pattern:
This cycle distracts from the real goal: empowering users to execute a specific piece of business logic.
cli.do flips the model on its head. Instead of building a distributable program, you define a command as an agentic workflow that lives on the cloud. We provide the do command, and your logic becomes instantly accessible through it.
Think of it as CLI as an API. You define the endpoint (your command name), the payload (your arguments), and the handler function (your business logic). We handle everything else.
With cli.do, you don't write boilerplate; you write functionality. Here’s how you can create a robust deployment command in just a few lines of TypeScript.
import { Agent } from '@do-sdk/agent';
// Define your CLI command as an Agent
const cli = new Agent('cli.do');
// Create a 'deploy' command with project and environment arguments
cli.on('deploy', {
project: { type: 'string', required: true },
env: { type: 'string', default: 'staging' },
}, async (args) => {
console.log(`Deploying ${args.project} to ${args.env}...`);
// Your deployment logic here
// await triggerDeployment(args.project, args.env);
return { status: 'success', message: `Deployment of ${args.project} to ${args.env} initiated.` };
});
// Your CLI is now live and callable:
// > do cli deploy --project my-app --env production
Notice what’s missing?
The power of cli.do extends far beyond simple deployment scripts. It's a platform for turning any piece of your operation into an accessible, auditable, and secure command-line tool. This is "Business as Code" in its most practical form.
Imagine your teams running commands like:
Each command triggers a powerful, server-side agentic workflow, but for the end-user, it's just a simple, intuitive command.
By embracing the CLI-as-an-API model with cli.do, you gain immediate, transformative benefits:
Ready to stop building CLIs the old way? Transform your complex business logic into intuitive, shareable command-line interfaces.
Get started with cli.do today and build your first CLI the agentic way.