# Codio (Production)
Codio is an internal CLI for automated Git workflows with local Ollama-powered Conventional Commit generation.
This README is for production/internal usage only.
## Developer / Maintainer
- Name: Morshedul Islam Munna
- GitHub: https://github.com/morshedulmunna
- LinkedIn: https://www.linkedin.com/in/morshedulmunna/
- Website: https://morshedulmunna.com/
- YouTube: https://www.youtube.com/@rustcmunna
## Purpose
Codio standardizes team commits by:
- generating validated Conventional Commit messages from real diffs
- enforcing commit message structure before commit
- supporting fully automated local workflows (`add -> gen -> push`)
## Prerequisites
- Git repository (run inside repo root or any subdirectory)
- Local Ollama daemon (`http://localhost:11434`)
- Installed local model (default: `qwen2.5-coder`)
- Configured Git identity (`user.name`, `user.email`)
## Install / Update
From this folder:
```bash
./install.sh
```
Update after changes:
```bash
./install.sh --force
```
Uninstall:
```bash
./uninstall.sh
```
## Operational Commands
Stage files:
```bash
codio add .
# or
codio add src/main.rs README.md
```
Generate commit message from staged diff and commit:
```bash
codio gen
```
Generate + edit message before commit:
```bash
codio gen --edit
```
Push current branch:
```bash
codio push
```
Full automation (stage all + generate + commit + push):
```bash
codio git
```
Diagnostics / runtime health:
```bash
codio status
```
## Flags
Global flags (available for all commands):
- `--model <name>`: Ollama model (default: `qwen2.5-coder`)
- `--scope <scope|auto>`: explicit or inferred scope
- `--staged-only`: fail when nothing staged
- `--max-chars <n>`: diff truncation budget (300..=200000, default 12000)
- `--dry-run`: print final message, skip commit/push actions
- `--no-body`: subject only
- `--verbose`: verbose logs
- `--no-progress`: disable spinner/progress UI
## Safety and Validation
Codio includes production safety controls:
- redacts sensitive diff lines before prompting Ollama
- omits sensitive file content (`.env`, key/secret-like files)
- validates commit format before commit:
- `type(scope): summary`
- allowed types: `feat`, `fix`, `docs`, `refactor`, `perf`, `test`, `chore`, `build`, `ci`
- subject length <= 72 chars
- body structure with blank line + bullet lines
- auto-coerces non-conforming model output into valid Conventional format
## Recommended Team Flow
1. `codio status` to verify environment/model/repo state.
2. `codio git` for normal feature work.
3. Use `codio gen --edit` when you need manual wording control.
4. Use `--dry-run` in sensitive branches before final commit.
## Troubleshooting
`codio status` should be your first check.
Common issues:
- Ollama unreachable:
- Start service: `ollama serve`
- Model missing:
- Install model: `ollama pull qwen2.5-coder`
- Push failed / upstream missing:
- `git push -u origin <branch>`
- No staged changes for `codio gen`:
- Stage first via `codio add ...` or use `codio git`