UNPKG

together-code

Version:

AI-powered coding assistant that plans, then builds

120 lines (80 loc) • 3.19 kB
# Together Code 🧠 **AI-powered coding assistant that plans, then builds** A beautiful CLI tool built with React & Ink that creates detailed project plans and executes them step-by-step, using the best AI models for each task. ## Future work - Make the shortcuts it uses the same as claude code - Make sure it uses context and shows how many tokens it's using - Make sure it keeps track of how much data is in the context window - Maybe use function calls for some different tasks ## ✨ Features ### 🧠 **Planning-First Approach** - **Smart Planning**: Uses DeepSeek v3 to break down requests into logical steps - **Step-by-Step Execution**: Uses Qwen2.5-Coder for high-quality code generation - **Progress Tracking**: Visual progress indicators with real-time feedback - **User Control**: Review and approve plans before execution ### šŸŽØ **Beautiful Interface** - **ASCII Art Intro**: Clean, terminal-friendly introduction - **Immediate Input**: Start typing your request right away - **Real-time Feedback**: Live timer and token tracking during generation - **Interactive UI**: Built with React & Ink for smooth terminal experience ### šŸ“ **File Management** - **Automatic File Creation**: Parses code blocks and creates actual files - **Smart Organization**: Maintains proper directory structure - **Backup Protection**: Protects existing files with automatic backups ## Setup 1. **Install dependencies:** ```bash npm install ``` 2. **Set up your Together AI API key:** ```bash export TOGETHER_API_KEY="your-api-key-here" ``` Get your API key from [Together AI](https://api.together.xyz/) 3. **Build the project:** ```bash npm run build ``` 4. **Run the CLI:** ```bash npm start ``` Or in development mode: ```bash npm run dev ``` ## Usage ### Interactive Mode ```bash together-code ``` This will show the intro screen and prompt you for what you want to build. ### Direct Prompt ```bash together-code "Create a React component for a todo list" ``` ### Examples - `together-code "Create a simple Express.js API with CRUD operations"` - `together-code "Build a React component with TypeScript for a user profile card"` - `together-code "Generate a Python script to analyze CSV data"` ## How it Works 1. **Beautiful Intro**: Shows a colorful ASCII art intro with "TOGETHER CODE" 2. **AI Generation**: Uses Together AI's DeepSeek v3 model to generate high-quality code 3. **File Creation**: Automatically parses code blocks and creates files on your filesystem 4. **Interactive Interface**: Built with React & Ink for a smooth terminal experience ## File Structure ``` src/ ā”œā”€ā”€ components/ │ ā”œā”€ā”€ App.tsx # Main app component │ ā”œā”€ā”€ IntroScreen.tsx # ASCII art intro screen │ └── CodeGenerator.tsx # Code generation interface ā”œā”€ā”€ services/ │ ā”œā”€ā”€ togetherAI.ts # Together AI API integration │ └── fileWriter.ts # File creation utilities └── index.tsx # CLI entry point ``` ## Environment Variables - `TOGETHER_API_KEY` - Your Together AI API key (required) ## License ISC