|
| 1 | +# Getting Started with AI Commit |
| 2 | + |
1 | 3 | Get started with this Blueprint using one of the options below: |
2 | 4 |
|
3 | 5 | --- |
4 | 6 |
|
5 | | -### **Option 1:** |
| 7 | +## Installation |
| 8 | + |
| 9 | +### Prerequisites |
| 10 | + |
| 11 | +Before you begin, make sure you have: |
| 12 | + |
| 13 | +1. **Python 3.10 or higher** installed |
| 14 | +2. **Git** installed and configured |
| 15 | +3. **fzf** installed for the terminal UI (see [installation guide](https://github.com/junegunn/fzf#installation)) |
| 16 | +4. Either: |
| 17 | + - **Jan AI** installed for local inference ([install guide](https://jan.ai/)) |
| 18 | + - Or **Ollama** as an alternative local inference option ([install guide](https://ollama.ai/download)) |
| 19 | + |
| 20 | +### Install from PyPI |
| 21 | + |
| 22 | +The easiest way to install AI Commit is via pip: |
| 23 | + |
| 24 | +```bash |
| 25 | +pip install ai-commit |
| 26 | +``` |
| 27 | + |
| 28 | +### Install from Source |
| 29 | + |
| 30 | +Alternatively, you can install from source: |
| 31 | + |
| 32 | +```bash |
| 33 | +git clone https://github.com/mozilla-ai/ai-commit.git |
| 34 | +cd ai-commit |
| 35 | +pip install -e . |
| 36 | +``` |
| 37 | + |
| 38 | +## Setup |
| 39 | + |
| 40 | +### For Inference with Jan AI (Default) |
| 41 | + |
| 42 | +1. Install and launch Jan AI from [jan.ai](https://jan.ai/) |
| 43 | +2. Download a model (like llama 3.1) through the Jan AI interface |
| 44 | +3. Ensure the Jan AI application is running |
| 45 | +4. (Optional) Set a custom model: |
| 46 | + ```bash |
| 47 | + export JAN_MODEL="your-preferred-model" |
| 48 | + ``` |
| 49 | + |
| 50 | +### For Inference with Ollama |
| 51 | + |
| 52 | +1. Start the Ollama service |
| 53 | +2. Pull a model (we recommend llama3.1): |
| 54 | + ```bash |
| 55 | + ollama pull llama3.1 |
| 56 | + ``` |
| 57 | +3. (Optional) Set a custom model: |
| 58 | + ```bash |
| 59 | + export OLLAMA_MODEL="your-preferred-model" |
| 60 | + ``` |
| 61 | + |
| 62 | +## Usage |
| 63 | + |
| 64 | +### Basic Usage |
| 65 | + |
| 66 | +1. Make changes to your files in a git repository |
| 67 | +2. Run: |
| 68 | + ```bash |
| 69 | + ai-commit |
| 70 | + ``` |
| 71 | +3. Select one of the generated commit messages using the arrow keys or number keys |
| 72 | +4. Press Enter to commit with the selected message, or Esc to cancel |
| 73 | + |
| 74 | +### Advanced Options |
| 75 | + |
| 76 | +```bash |
| 77 | +# Use Ollama instead of Jan AI |
| 78 | +ai-commit --ollama |
| 79 | + |
| 80 | +# Show performance analytics |
| 81 | +ai-commit --analytics |
| 82 | + |
| 83 | +# Use vim-style navigation in fzf |
| 84 | +ai-commit --vim |
| 85 | + |
| 86 | +# Use number selection for messages |
| 87 | +ai-commit --num |
6 | 88 |
|
| 89 | +# Set the maximum characters for commit messages |
| 90 | +ai-commit --max_chars 100 |
| 91 | +``` |
7 | 92 |
|
| 93 | +## What's Next? |
8 | 94 |
|
9 | | -### **Option 2:** |
| 95 | +- See the [Step-by-Step Guide](step-by-step-guide.md) to understand how AI Commit works |
| 96 | +- Learn about [customization options](customization.md) to tailor it to your needs |
0 commit comments