mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-26 11:49:36 +00:00
3.4 KiB
3.4 KiB
Hanzo Dev REPL - Usage Guide
You're Connected! Now Here's How to Use It:
Available Commands in the REPL:
help - Show all available commands
status - Show agent status
task <description> - Execute a task
review <file> - Review a code file
generate <desc> - Generate code
debug <issue> - Debug an issue
test <module> - Generate tests
optimize <code> - Optimize performance
exit - Exit the REPL
Example Usage:
hanzo-dev> status
Agent Status:
primary: ready
critic_1: ready
hanzo-dev> task review the Python files in this directory
[Agents will start reviewing...]
hanzo-dev> generate a simple REST API with FastAPI
[Agents will generate code...]
hanzo-dev> review src/main.py
[Agents will review the file...]
hanzo-dev> debug why is my server not starting
[Agents will help debug...]
hanzo-dev> test add unit tests for the user module
[Agents will generate tests...]
How It Works:
- Primary Agent: Handles main coding tasks
- Critic Agent: Reviews and improves code (System 2 thinking)
- MCP Tools: Both agents can use file operations, search, etc.
- Networking: Agents can communicate with each other
Quick Start Commands to Try:
# Check status
hanzo-dev> status
# Simple task
hanzo-dev> task list all Python files in the current directory
# Generate code
hanzo-dev> generate a hello world Flask app
# Review code
hanzo-dev> review README.md
# Get help
hanzo-dev> help
Tips:
- Use
taskfor general requests - Use
generatefor creating new code - Use
reviewfor code review - Use
debugfor troubleshooting - Use
testfor test generation - Use
optimizefor performance improvements
Advanced Usage:
# Multi-step task
hanzo-dev> task create a user authentication system with JWT tokens
# Code review with specific focus
hanzo-dev> review src/auth.py focus on security vulnerabilities
# Generate with requirements
hanzo-dev> generate REST API with CRUD operations for a blog system
# Debug with context
hanzo-dev> debug TypeError in line 42 of app.py when calling user.save()
Exiting:
hanzo-dev> exit
Shutting down agents...
Goodbye!
Troubleshooting:
If you see "Unknown command", make sure to:
- Use one of the commands listed above
- Start with a command word (task, generate, review, etc.)
- Type
helpto see all available commands
Example Session:
$ hanzo dev --orchestrator gpt-4
[... startup messages ...]
hanzo-dev> help
Available commands:
help - Show this help message
status - Show agent status
task - Execute a task
review - Review code
generate - Generate code
debug - Debug issues
test - Generate tests
optimize - Optimize code
exit - Exit REPL
hanzo-dev> status
Agents: 2 active (primary, critic_1)
MCP Tools: Enabled
Network: Connected
hanzo-dev> task explain what this project does
[Agents analyze the project...]
This project is a Python SDK for Hanzo AI that provides...
hanzo-dev> generate a simple calculator class
[Agents generate code...]
```python
class Calculator:
def add(self, a, b):
return a + b
def subtract(self, a, b):
return a - b
def multiply(self, a, b):
return a * b
def divide(self, a, b):
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
hanzo-dev> exit ✓ Agents shut down successfully