Metadata-Version: 2.4
Name: hanzo-cli
Version: 0.1.0
Summary: Unified CLI for Hanzo AI - Local, Private, Free AI Infrastructure
Project-URL: Homepage, https://hanzo.ai
Project-URL: Repository, https://github.com/hanzoai/python-sdk
Project-URL: Documentation, https://docs.hanzo.ai/cli
Project-URL: Changelog, https://github.com/hanzoai/python-sdk/blob/main/pkg/hanzo-cli/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/hanzoai/python-sdk/issues
Author-email: Hanzo AI <dev@hanzo.ai>
Keywords: agents,ai,cli,hanzo,llm,local-ai,mcp,private-ai
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.23.0
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: all
Requires-Dist: hanzo-a2a>=0.1.0; extra == 'all'
Requires-Dist: hanzo-agents>=0.1.0; extra == 'all'
Requires-Dist: hanzo-cluster>=0.1.0; extra == 'all'
Requires-Dist: hanzo-mcp>=0.1.0; extra == 'all'
Requires-Dist: hanzo-miner>=0.1.0; extra == 'all'
Requires-Dist: hanzo-network>=0.1.0; extra == 'all'
Requires-Dist: hanzo-repl>=0.1.0; extra == 'all'
Requires-Dist: hanzoai>=1.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: repl
Requires-Dist: hanzo-repl>=0.1.0; extra == 'repl'
Description-Content-Type: text/markdown

# Hanzo CLI

Unified command-line interface for Hanzo AI - Local, Private, Free AI Infrastructure.

## Features

- 🤖 **AI Chat** - Interactive chat with multiple LLM providers
- 🛠️ **MCP Tools** - Access to 70+ Model Context Protocol tools
- 🌐 **Agent Networks** - Distributed AI agent orchestration
- ⛏️ **Mining** - Contribute compute and earn rewards
- 🔐 **Authentication** - Secure access with Hanzo IAM
- 📊 **Monitoring** - Real-time cluster and agent status
- 🎨 **Beautiful UI** - Rich terminal interface with syntax highlighting

## Installation

```bash
# Basic installation
pip install hanzo

# With all features
pip install hanzo[all]

# With specific features
pip install hanzo[repl]     # Interactive REPL
pip install hanzo[cluster]  # Local AI cluster
pip install hanzo[network]  # Agent networks
```

## Quick Start

### Authentication

```bash
# Login with email/password
hanzo auth login

# Use API key
export HANZO_API_KEY=your-key
hanzo auth status
```

### AI Chat

```bash
# Interactive chat
hanzo chat

# Quick question
hanzo ask "What is the capital of France?"

# With specific model
hanzo chat --model claude-3.5-sonnet

# Start REPL (like Claude Code)
hanzo chat --repl
```

### Local AI Cluster

```bash
# Start local cluster
hanzo serve

# Or with options
hanzo cluster start --models llama-3.2-3b --port 8000

# Check status
hanzo cluster status

# Start as node
hanzo cluster node start --blockchain --network
```

### MCP Tools

```bash
# List available tools
hanzo mcp tools

# Run a tool
hanzo mcp run read_file --arg file_path=README.md

# Start MCP server
hanzo mcp serve

# Install in Claude Desktop
hanzo mcp install
```

### Agent Networks

```bash
# Dispatch work to network
hanzo network dispatch "Analyze this codebase and suggest improvements"

# Start local swarm
hanzo network swarm --agents 5

# List available agents
hanzo network agents
```

### Mining

```bash
# Start mining
hanzo miner start --wallet 0x... --models llama-3.2-3b

# Check earnings
hanzo miner earnings --wallet 0x...

# View leaderboard
hanzo miner leaderboard
```

## Configuration

### Environment Variables

```bash
# API Keys
export HANZO_API_KEY=your-hanzo-key
export ANTHROPIC_API_KEY=your-anthropic-key
export OPENAI_API_KEY=your-openai-key

# Preferences
export HANZO_DEFAULT_MODEL=claude-3.5-sonnet
export HANZO_USE_LOCAL=true
```

### Configuration File

```bash
# Initialize config
hanzo config init

# Set values
hanzo config set default_model claude-3.5-sonnet
hanzo config set mcp.allowed_paths /home/user/projects

# View config
hanzo config show
```

## Advanced Usage

### Interactive REPL

The REPL provides direct access to all MCP tools and AI capabilities:

```bash
# Start REPL
hanzo repl start

# With IPython interface
hanzo repl start --ipython

# With TUI interface
hanzo repl start --tui
```

In the REPL:
```python
# Direct tool access
>>> read_file(file_path="config.json")
>>> search(query="TODO", path=".")

# Chat with AI
>>> chat("Create a FastAPI server with authentication")

# AI uses tools automatically
>>> chat("Find all Python files and create a dependency graph")
```

### Tool Management

```bash
# Install custom tools
hanzo tools install my-tool

# Create new tool
hanzo tools create my-custom-tool

# List installed tools
hanzo tools list --installed
```

### Dashboard

```bash
# Start interactive dashboard
hanzo dashboard
```

## Command Reference

### Main Commands

- `hanzo auth` - Authentication management
- `hanzo chat` - Interactive AI chat
- `hanzo cluster` - Local AI cluster management
- `hanzo mcp` - Model Context Protocol tools
- `hanzo agent` - Agent management
- `hanzo network` - Agent network operations
- `hanzo miner` - Mining operations
- `hanzo tools` - Tool management
- `hanzo config` - Configuration management
- `hanzo repl` - Interactive REPL

### Quick Aliases

- `hanzo ask <question>` - Quick AI question
- `hanzo serve` - Start local cluster
- `hanzo dashboard` - Open dashboard

## Examples

### Complex Workflows

```bash
# Analyze project and create documentation
hanzo network dispatch "Analyze this Python project and create comprehensive documentation" --agents 3

# Start mining with specific configuration
hanzo miner start --wallet 0x123... --models "llama-3.2-3b,mistral-7b" --min-stake 100

# Create and deploy an agent
hanzo agent create researcher --model gpt-4
hanzo agent start researcher --task "Research best practices for API security"
```

### Integration with Other Tools

```bash
# Use with pipes
echo "Explain this error" | hanzo chat --once

# Process files
find . -name "*.py" | xargs hanzo mcp run analyze_code

# Combine with jq
hanzo network jobs --json | jq '.[] | select(.status=="completed")'
```

## Troubleshooting

### Common Issues

1. **No LLM provider configured**
   ```bash
   export ANTHROPIC_API_KEY=your-key
   # or
   hanzo auth login
   ```

2. **Local cluster not running**
   ```bash
   hanzo cluster start
   # or
   hanzo serve
   ```

3. **Permission denied for MCP tools**
   ```bash
   hanzo config set mcp.allowed_paths /path/to/allow
   ```

### Debug Mode

```bash
# Enable debug output
export HANZO_DEBUG=true
hanzo chat

# Verbose logging
hanzo --verbose chat
```

## Contributing

See the main [Hanzo Python SDK](https://github.com/hanzoai/python-sdk) repository.

## License

BSD-3-Clause - see LICENSE file for details.