sd-kimi-code 0.1.0
An open-source, Claude-Code-style terminal agent powered by Kimi AI. Interactive coding assistant with beautiful CLI.
License: MIT
Requires Python: >=3.10
Keywords: agent, ai, assistant, cli, coding, kimi, terminal

# 🤖 Kimi Code

[![PyPI version](https://badge.fury.io/py/sd-kimi-code.svg)](https://badge.fury.io/py/sd-kimi-code)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**An open-source, Claude-Code-style terminal agent powered by Kimi AI.** 

Get an interactive coding assistant right in your terminal with beautiful CLI, tool integration, and natural language programming.

```
╭──────────────────────────────────────────────╮
│  ██╗  ██╗██╗███╗   ███╗██╗    ██████╗ ██████╗ ██████╗ ███████╗  │
│  ██║ ██╔╝██║████╗ ████║██║  ██╔════╝██╔═══██╗██╔══██╗██╔════╝  │
│  █████╔╝ ██║██╔████╔██║██║  ██║     ██║   ██║██║  ██║█████╗    │
│  ██╔═██╗ ██║██║╚██╔╝██║██║  ██║     ██║   ██║██║  ██║██╔══╝    │
│  ██║  ██╗██║██║ ╚═╝ ██║██║  ╚██████╗╚██████╔╝██████╔╝███████╗  │
│  ╚═╝  ╚═╝╚═╝╚═╝     ╚═╝╚═╝   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝  │
╰──────────────────────────────────────────────╯

🔥 kimi > create a Python web scraper for news articles
🔥 kimi > add unit tests to my FastAPI project  
🔥 kimi > help me debug this React component
```

## ✨ Features

- 🎨 **Beautiful Interactive CLI** - Claude Code-style terminal interface
- 🤖 **Powered by Kimi AI** - Advanced language model with coding expertise
- 🛠️ **Tool Integration** - File operations, shell commands, git integration
- 💬 **Natural Language** - Just describe what you want to build
- 🚀 **Instant Setup** - One command installation and configuration
- 📁 **Context Aware** - Understands your project structure and files
- 🔄 **Streaming Responses** - Real-time AI responses as you type

## 🚀 Quick Start

### Installation

```bash
pip install sd-kimi-code
```

### Setup

1. **Get your Kimi API key** from [Moonshot AI Platform](https://platform.moonshot.cn)

2. **Configure kimi-code:**
   ```bash
   kimi init --provider kimi
   # Enter your API key when prompted
   ```

3. **Start coding!**
   ```bash
   # Interactive mode (like Claude Code)
   kimi
   
   # Or one-shot commands
   kimi run "create a Python file that calculates fibonacci numbers"
   ```

## 💡 Usage Examples

### Interactive Mode
```bash
$ kimi

🔥 kimi > create a Flask web app with user authentication
🔥 kimi > add error handling to my existing code
🔥 kimi > help me optimize this database query
🔥 kimi > exit
```

### Command Mode
```bash
# File operations
kimi run "create a README.md for my Python project"
kimi run "add type hints to all functions in src/"

# Development tasks  
kimi run "write unit tests for my calculator.py file"
kimi run "create a Dockerfile for this Node.js app"
kimi run "add logging to my FastAPI application"
```

### Built-in Commands
- `help` - Show available commands and examples
- `clear` - Clear the terminal screen  
- `exit`, `quit` - Exit interactive mode
- `config` - Show current configuration

## 🔧 Configuration

### Providers
Currently supports:
- **Kimi** (Moonshot AI) - Recommended
- **OpenAI** (GPT models) - Coming soon

### Environment Variables
```bash
export KIMI_CODE_API_KEY="your-api-key"
export KIMI_CODE_MODEL="moonshot-v1-8k"  # or moonshot-v1-32k
```

### Config File
Located at `~/.kimi-code/config.toml`:
```toml
provider = "kimi"
api_key = "your-api-key"  
model = "moonshot-v1-8k"
max_tokens = 8000
temperature = 0.0
```

## 🛠️ Available Tools

Kimi Code can:
- 📝 **Create & edit files** - Write, modify, and organize your code
- 🔍 **Read & analyze code** - Understand existing projects  
- 💻 **Run shell commands** - Execute terminal operations
- 🌳 **Browse directories** - Navigate project structures
- 🔄 **Git integration** - Commit, branch, and manage repositories
- 🐛 **Debug & test** - Help troubleshoot and write tests

## 🎯 Use Cases

- **Rapid Prototyping** - Quickly build MVPs and proof of concepts
- **Code Generation** - Create boilerplate, APIs, and complete applications  
- **Debugging Help** - Get assistance troubleshooting errors
- **Learning** - Understand new frameworks and best practices
- **Refactoring** - Improve code quality and structure
- **Documentation** - Generate README files, comments, and docs

## 📋 Requirements

- Python 3.10 or higher
- Kimi API key from [Moonshot AI](https://platform.moonshot.cn)
- Terminal with Unicode support (for best experience)

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create a feature branch: `git checkout -b feature-name`
3. Make your changes and add tests
4. Submit a pull request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments

- Inspired by [Claude Code](https://claude.ai) by Anthropic
- Powered by [Kimi](https://kimi.moonshot.cn) by Moonshot AI
- Built with [Rich](https://github.com/Textualize/rich) for beautiful terminal output

## 🔗 Links

- [Documentation](https://github.com/yourname/kimi-code/wiki)
- [Issues & Bug Reports](https://github.com/yourname/kimi-code/issues) 
- [Feature Requests](https://github.com/yourname/kimi-code/discussions)
- [Kimi API Documentation](https://platform.moonshot.cn/docs)

---

**Made with ❤️ for developers who love beautiful, powerful tools.**

```bash
pip install -e .              # from repo root
kimi init --provider kimi     # configure API key
kimi "add unit tests for src/utils.py"
```