Contributing
Contributions are welcome. Here's how to get started.
Getting Started
- Fork the repository
- Clone your fork:bash
git clone https://github.com/your-username/zero-ichi cd zero-ichi - Install dependencies:bash
pip install uv uv sync
Development Workflow
Create a new branch for your feature or fix:
bashgit checkout -b feature/my-cool-featureMake your changes. All source code lives under
src/.Format and Lint your code:
bashuv run ruff format . uv run ruff check .IMPORTANT
CI will fail if code is not formatted or has lint errors.
Run the bot to test your changes:
bashuv run zero-ichi --debug --auto-reloadThe bot supports auto-reload — file changes are picked up without restarting.
Project Structure
See Architecture for a full breakdown.
src/commands/— Add new commands here.src/core/— Core logic (client, middleware, logger, etc.).src/ai/— AI agent, context, memory, and tools.src/locales/— Translation JSON files.src/config/— Static settings loaded fromconfig.json.
Pull Requests
- Keep PRs focused on a single feature or fix.
- Use clear, descriptive titles.
- Describe what you changed and why.
- If you added a feature, include a screenshot or usage example.
Database Migrations (Alembic)
Runtime persistence uses SQLAlchemy with Alembic migration support.
bash
# Apply migrations
uv run alembic upgrade head
# Create a new migration
uv run alembic revision -m "your migration message"Default database is SQLite (data/zeroichi.db) unless DATABASE_URL is set.
Adding a Command
Create a new file in the appropriate src/commands/<category>/ directory:
python
from core.command import Command
class MyCommand(Command):
name = "mycommand"
description = "Does something cool"
usage = "/mycommand <arg>"
async def execute(self, msg, bot, args, prefix):
await bot.reply(msg, "Hello!")Commands are auto-discovered — no registration needed.
Adding Translations
Translation files live in src/locales/.
- Copy
src/locales/en.jsontosrc/locales/<code>.json. - Update
_meta.labelwith the language name. - Translate the values.
- Submit a PR.
Reporting Bugs
Please use GitHub Issues to report bugs. Include:
- Steps to reproduce
- Expected vs actual behavior
- Logs or screenshots
