ZETA - Zero-Latency Editing Terminal Agent: A friendly local AI terminal agent
Project description
ZETA - Zero-Latency Editing Terminal Agent
ZETA is a friendly, local AI terminal agent designed for non-technical users. It runs completely offline using Ollama with the MiniMax M2 model, making it perfect for learning to code without relying on external APIs.
โจ Features
๐ฏ Ask โ Act โ Explain Flow
- Smart Clarification: Detects vague inputs and asks helpful clarifying questions with numbered options
- Safe Operations: Never edits files without your confirmation
- Plain English Explanations: Every action is explained in simple, understandable terms
- Learning Log: All interactions are logged to
zeta_log.mdfor your learning journey
๐ Teaching Mode
- Toggle with
--teachflag or usezeta teachcommand - Detailed explanations with definitions (e.g., "HTML is the skeleton of a webpage")
- Interactive learning sessions
๐ Critic Loop (Optional)
- Enable with
--criticflag - Reviews code for bugs, style, and security issues
- Provides scores (1-10) and suggests fixes for scores below 8
๐ ๏ธ Powerful Tools
- ReadFile: Read any file in your project
- WriteFile: Create or edit files (with automatic parent directory creation)
- RunCommand: Execute shell commands safely
- ListFiles: Browse your project structure
๐ Installation
Prerequisites
- Python 3.8+ installed
- Ollama installed and running
- MiniMax M2 model pulled in Ollama:
ollama pull minimax-m2:cloud
Install ZETA
From PyPI (Recommended):
pip install zeta-cli
โ ๏ธ Windows Users: PATH Issue Fix
On Windows, if zeta command is not found, use the Python module method instead:
# Instead of: zeta --version
python -m zeta --version
# Instead of: zeta run "task"
python -m zeta run "task"
Or check your setup:
.\scripts\check_setup.ps1
See WINDOWS_SETUP.md for detailed Windows setup instructions.
From Source:
# Clone or download this repository
cd zeta_cli
# Install in development mode
pip install -e .
# Or install dependencies manually
pip install click langchain-ollama langchain langgraph rich
๐ Usage
Basic Commands
# Run a task
zeta run "make a to-do app"
# With teaching mode
zeta run "create a calculator" --teach
# With critic mode
zeta run "write a Python script" --critic
# Combine both modes
zeta run "build a webpage" --teach --critic
# Interactive teaching session
zeta teach
# View your learning log
zeta log
Example Flow
$ zeta run "make a to-do app"
๐ค I need a bit more information!
What kind of to-do app would you like?
1. A simple HTML webpage with JavaScript
2. A Python terminal application
3. A command-line tool
Choose an option [1]: 1
Great choice! Let's make a simple HTML webpage with JavaScript.
[ZETA processes your request...]
[Displays created files and explanation]
Would you like to learn how this works? [y/N]: y
[Shows detailed lesson about HTML and JavaScript]
๐ Teaching Mode Examples
Basic Teaching Session
$ zeta teach
๐ Teaching Mode
Learn coding concepts in detail
What would you like to learn about?
Type 'exit' to end the session
You: What is HTML?
๐ Lesson: HTML stands for HyperText Markup Language. Think of it as the skeleton
of a webpage - it defines the structure and content...
You: How does JavaScript work?
๐ Lesson: JavaScript is like the brain of your webpage. It makes things interactive...
Teaching Mode with Tasks
$ zeta run "create a button" --teach
[Creates button.html]
Explanation: I created an HTML file with a button element. HTML uses tags like
<button> to create interactive elements. The button I created will display
"Click me!" when viewed in a browser. When teaching mode is enabled, I'll explain
that HTML provides structure, while JavaScript (which we can add) makes it do
things when clicked.
Would you like to learn how this works? [y/N]: y
๐ Critic Mode
When enabled, ZETA reviews your code:
$ zeta run "write a Python function to add numbers" --critic
[Creates add.py]
Code Review:
Score: 7/10
Issues:
- Missing type hints
- No error handling for non-numeric inputs
Suggestions:
- Add type hints: def add(a: int, b: int) -> int:
- Add try/except for invalid inputs
Would you like me to fix these issues? [y/N]
๐ Learning Log
All your interactions are saved to zeta_log.md:
## 2024-01-15 14:30:22
**Action:** User task: make a to-do app
**Explanation:** I created a simple HTML to-do app with a clean interface...
**Lesson:** HTML provides structure, CSS makes it pretty, and JavaScript
makes it interactive. Think of it like building a house: HTML is the frame,
CSS is the paint, and JavaScript is the electricity that makes lights work.
---
View your log anytime:
zeta log
๐๏ธ Project Structure
zeta_cli/
โโโ zeta.py # Main CLI application
โโโ setup.py # Installation configuration
โโโ README.md # This file
โโโ zeta_log.md # Auto-generated learning log
๐ง Configuration
ZETA uses the Ollama model minimax-m2:cloud by default. To use a different model, edit the MODEL_NAME constant in zeta.py:
MODEL_NAME = "your-model-name"
๐จ Features in Detail
1. Vague Task Detection
ZETA automatically detects when your request is too vague:
$ zeta run "make a chatbot"
๐ค I need a bit more information!
What kind of chatbot would you like?
1. A simple terminal-based chatbot
2. A web-based chatbot with HTML interface
3. A Python script chatbot
2. Safe File Operations
ZETA never modifies files without confirmation:
[Before writing file.html]
Would you like me to create/modify file.html? [y/N]: y
โ File created successfully!
3. Encouraging Language
ZETA uses friendly, encouraging messages:
- "Great choice!"
- "Nice! Your app is live."
- "Let's do this!"
- "Awesome work!"
4. Plain English Explanations
No jargon without explanation:
- โ "Created a REST API endpoint"
- โ "Created a REST API endpoint - that's like a mailbox where your app can receive requests and send back data"
๐ Troubleshooting
Ollama Connection Issues
If you see connection errors:
- Make sure Ollama is running:
ollama serve - Verify the model is installed:
ollama list - Pull the model if needed:
ollama pull minimax-m2:cloud
Model Not Found
If the model isn't available:
# List available models
ollama list
# Pull the MiniMax M2 model
ollama pull minimax-m2:cloud
# Or use a different model by editing zeta.py
๐ Documentation
- README.md - User guide and installation instructions (you are here)
- PRD.md - Complete Product Requirements Document with detailed specifications
- PROJECT_REPORT.md - Comprehensive project development report
๐งช Testing
ZETA includes a comprehensive test suite covering all core functionality:
# Install test dependencies
pip install -e .[test]
# Run all tests
pytest tests/ -v
# Run with coverage report
pytest tests/ --cov=zeta --cov-report=term-missing
# Run specific test file
pytest tests/test_tools.py -v
Test Coverage
The test suite includes:
- Unit Tests: Individual component testing (tools, logger, agent)
- Integration Tests: End-to-end workflow testing
- CLI Tests: Command-line interface testing
- Error Handling: Edge cases and error recovery
Current coverage: 79% (and improving!)
๐ค Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Development Setup
- Clone the repository
- Install in development mode:
pip install -e .[test] - Run tests:
pytest tests/ -v - Make your changes and ensure tests pass
- Submit a pull request
CI/CD
The project uses GitHub Actions for continuous integration:
- Automated Testing: Runs on push/PR across Python 3.8-3.11 and multiple OS
- Code Quality: Linting with flake8, formatting checks with black/isort
- Package Building: Automated package verification
- Release Automation: Automated PyPI releases on GitHub releases
Pre-commit Hooks
Code quality is enforced via pre-commit hooks:
# Install pre-commit hooks
pip install pre-commit
pre-commit install
# Or use the setup script
# Linux/Mac:
./scripts/setup_pre_commit.sh
# Windows:
.\scripts\setup_pre_commit.ps1
Hooks include:
- Code formatting (black, isort)
- Linting (flake8)
- Type checking (mypy)
- Running tests (pytest)
- File checks (trailing whitespace, end-of-file, etc.)
Performance Benchmarks
Run performance benchmarks:
python tests/benchmarks.py
This measures:
- Vague detection performance
- Tool execution speed
- File operation performance
- Agent initialization time
- Tool parsing performance
Examples
See the examples/ directory for:
- Basic usage patterns
- Demo workflow scripts (bash and PowerShell)
- Real-world examples
Run demo workflows:
# Linux/Mac
./examples/demo_workflow.sh
# Windows
.\examples\demo_workflow.ps1
๐ License
MIT License - feel free to use ZETA for any purpose.
๐ Acknowledgments
๐ก Tips for Non-Technical Users
- Start Simple: Begin with basic tasks like "create a text file" or "make a simple webpage"
- Use Teaching Mode: Always use
--teachwhen learning something new - Ask Questions: ZETA loves to explain! Ask "what is X?" anytime
- Review Your Log: Check
zeta logregularly to review what you've learned - Be Specific: The more details you provide, the better ZETA can help
Happy Coding! ๐
Remember: Every expert was once a beginner. ZETA is here to help you learn at your own pace!
๐ Links
- PyPI Package: https://pypi.org/project/zeta-cli/
- GitHub Repository: https://github.com/SukinShetty/Zeta-CLI
- Author: Sukin Shetty
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zeta_cli-1.0.2.tar.gz.
File metadata
- Download URL: zeta_cli-1.0.2.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5b77ad65673e04f29ebc6406fbd510a5a8e4fbb564144f044ce9725597704c
|
|
| MD5 |
59b4cc5b6aef9be4db4abc59a162a32b
|
|
| BLAKE2b-256 |
2ed0267c4a77235f6b84b5a2e1472b05a4669a70af10506ca87cb6d56da4ef16
|
File details
Details for the file zeta_cli-1.0.2-py3-none-any.whl.
File metadata
- Download URL: zeta_cli-1.0.2-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eaa251d4e8312bb60cff627dab1b93f892f135a04de69c104f469347d077848
|
|
| MD5 |
b644d122b0a7431e2e43452e2c1e1114
|
|
| BLAKE2b-256 |
95fed9b2a96c841b556ec5b10262e0bc230eeb1da64eb1b06675f89f9c2d7232
|