Welcome to Day 5 of the AI Task Helper Agent (Gemini Edition) series!
Yesterday, you upgraded your agent with multi-step reasoning. Today, we make it feel like a real tool by adding a command-line interface (CLI).
By the end of this tutorial, you’ll be able to run:
python -m src.main "Plan my 2-week JavaScript study schedule"
Or even:
python -m src.main "Build a personal website" --mode simple
This turns your project into a usable, everyday AI assistant.
Goal for Today
Transform your agent from a Python script into a professional-looking CLI tool using argparse, so users can:
- Input goals directly in the terminal
- Choose simple (1-step) or reasoned (2-step) planning
- Get clean, structured outputs instantly
1. Why a CLI Is Useful
Adding a CLI:
Makes your agent feel like a real application
No need to modify Python files to run goals.
Easy to integrate into workflows later
Automate tasks using cron, shell scripts, or Zapier command runners.
Encourages users to interact with your agent
People prefer typing commands over editing code.
If you’re new to productivity with AI tools, you might enjoy this beginner-friendly guide:
ChatGPT for Beginners: 7 Easy Ways to Boost Productivity with AI
https://tooltechsavvy.com/chatgpt-for-beginners-7-easy-ways-to-boost-productivity-with-ai/
2. Use argparse to Parse User Input
We will support:
1. A positional argument
The user’s goal (required)
2. A flag:
--mode simple
or--mode reasoned (default)
This gives you flexibility to test both versions of your agent.
3. Implement the CLI in main.py
Here is the full Day 5 version of your CLI code.
src/main.py (Day 5)
import argparse
from agent import TaskHelperAgent
def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description="AI Task Helper Agent (Gemini)"
)
parser.add_argument(
"goal",
type=str,
help="Your task or goal, e.g. 'Learn Python in 2 weeks'",
)
parser.add_argument(
"--mode",
type=str,
choices=["simple", "reasoned"],
default="reasoned",
help="Planning mode: simple (1-step) or reasoned (2-step)",
)
return parser
def main():
parser = build_parser()
args = parser.parse_args()
agent = TaskHelperAgent()
if args.mode == "simple":
plan = agent.plan_task(args.goal)
else:
plan = agent.plan_task_reasoned(args.goal)
print("\n=== AI Task Helper Agent ===")
print(f"Goal: {args.goal}\n")
print(plan)
if __name__ == "__main__":
main()
4. Example
Example 1 — Reasoned Mode (default)
python -m src.main "Learn Python basics in 3 weeks"
Example 2 — Simple Mode (1-step planner)
python -m src.main "Build a personal website" --mode simple
Both commands instantly produce your agent’s structured plan.
Additional Guides
Using AI to automate workflows:
https://tooltechsavvy.com/how-to-use-chatgpt-and-zapier-to-automate-your-content-calendar/
A beginner-friendly intro to automation paths & workflows:
https://tooltechsavvy.com/how-to-use-zapier-filters-and-paths-for-complex-automations/
Congratulations — Your Agent Is Now a Real Command-Line Tool!
Today, you elevated your AI Task Helper from a simple script to a fully interactive CLI application.
Now your agent can:
- Accept user input from the terminal
- Run in different planning modes
- Produce clean, structured outputs
- Fit into real-world workflows
In Day 6, we’ll add memory so your agent can recall past tasks:
--history
Save all plans
Build continuity across sessions



