Data is the lifeblood of modern business, but accessing and processing it often remains a bottleneck. Data science and analytics teams spend countless hours writing complex scripts to fetch, clean, and analyze information. The problem? These scripts often live in isolated notebooks or repositories, are difficult for others to run, and suffer from the classic "it works on my machine" syndrome.
What if you could transform any data analysis script or ETL pipeline into a robust, shareable, and standardized command-line tool in minutes? What if you could empower teammates—from fellow engineers to product managers—to run complex data workflows with a single, intuitive command?
Welcome to the agentic way of building CLIs with cli.do. It's time to stop wrestling with ad-hoc scripts and start building scalable, accessible data tools.
If you're on a data team, this probably sounds familiar:
These challenges prevent data teams from scaling their impact. The solution isn't to write more documentation; it's to turn your business logic into accessible, distributable tools.
cli.do reimagines the command-line interface. Instead of a tedious local utility you have to build, package, and distribute yourself, cli.do treats your CLI as an API.
You define your command's logic and its parameters as part of an Agentic Workflow. Our platform instantly handles the rest:
You write the core logic; we build, host, and serve the production-ready tool.
Let's say you have a Python script that analyzes user engagement for a specific date range and cohort.
The "Before" Script (analyze.py):
# analysis_script.py
import pandas as pd
# PROBLEM: Parameters are hardcoded and must be manually changed for each run.
START_DATE = "2023-11-01"
END_DATE = "2023-11-30"
COHORT = "new_users"
OUTPUT_PATH = f"/tmp/report_{COHORT}.csv"
def run_analysis():
print(f"Fetching data from {START_DATE} to {END_DATE} for cohort: {COHORT}...")
# Pretend we are fetching data from a database or data lake
# df = fetch_data(START_DATE, END_DATE, COHORT)
# results = process_data(df)
print(f"Analysis complete. Report saved to {OUTPUT_PATH}")
# results.to_csv(OUTPUT_PATH)
# To run this, a user must edit the file and then execute `python analysis_script.py`
run_analysis()
This is brittle and impossible for a non-technical user to operate. Now, let's turn this into a powerful CLI using cli.do.
The "After" CLI-as-an-API (with a hypothetical Python SDK):
# Using a Python SDK conceptually similar to the @do-sdk/agent
from do_sdk import Agent
import pandas as pd
# Define your CLI as an Agent
# This command will be available under the 'data' namespace
cli = Agent('data.cli.do')
# Create a 'run-engagement' command
@cli.on('run-engagement', {
'start_date': { 'type': 'string', 'required': True },
'end_date': { 'type': 'string', 'required': True },
'cohort': { 'type': 'string', 'default': 'all_users' },
'format': { 'type': 'string', 'default': 'json' }
})
async def run_analysis(args):
"""
Fetches and analyzes user engagement data for a given period and cohort.
"""
print(f"Fetching data from {args.start_date} to {args.end_date} for cohort: {args.cohort}...")
# Your actual data fetching and analysis logic goes here
# df = await fetch_data(args.start_date, args.end_date, args.cohort)
# results = process_data(df)
message = f"Analysis for cohort '{args.cohort}' completed successfully."
return { 'status': 'success', 'message': message, 'output_format': args.format }
# That's it! Your CLI is now live.
With that simple agent definition, you've created a globally accessible tool. Anyone on your team can now open their terminal and run:
> do data run-engagement --start-date 2023-11-01 --end-date 2023-11-30 --cohort new_users
They get instant help and argument information with --help. The execution is logged. And you can control access with the full power of the .do platform's authentication system.
By adopting the CLI-as-an-API model, data teams can:
Stop passing scripts around. Start distributing power. cli.do bridges the gap between your complex business logic and the people who need to use it, turning your data analysis into a scalable, on-demand service.
Ready to transform your data workflows? Discover cli.do and start building CLIs the agentic way.