Skip to main content
ollim-bot is a standard Python project managed with uv. This guide covers setting up a development environment, running the bot locally, and understanding the project structure and conventions.

Prerequisites

  • uvcurl -LsSf https://astral.sh/uv/install.sh | sh (automatically installs the required Python version)
  • A Discord bot token (see the quickstart)
  • Google OAuth credentials (see Google integration setup) if using Google integrations

Setup

1

Clone the repository

2

Install dependencies

The first command installs ollim-bot and claude-history as global commands. claude-history is a CLI tool required by subagents. uv sync installs dev dependencies (pytest, ruff, ty). Pre-commit hooks enforce linting and type checking on every commit.
3

Configure environment variables

Copy the example file and fill in your values:
4

Run the bot

On startup, the bot checks Claude authentication — if not logged in, it DMs you an OAuth link via the Discord REST API. See the quickstart for the full startup flow. The bot also checks for an existing instance via a PID file at ~/.ollim-bot/state/bot.pid and exits if one is already running.

Running tests

Dev dependencies include pytest, pytest-asyncio, and pytest-cov. See Testing for the test philosophy and conventions.

Linting and type checking

ollim-bot uses ruff for linting and formatting, and ty for type checking. Pre-commit hooks run both automatically on every commit.
The pre-commit config runs ruff --fix (auto-fixes safe lint issues), ruff format, and ty check on staged Python files. CI runs the same checks — see below.

CI

GitHub Actions runs on every push and pull request to main:
  • Lint jobruff check, ruff format --check, ty check
  • Test jobpytest across Python 3.11, 3.12, and 3.13

Project structure

The source lives under src/ollim_bot/. Each file owns a single domain — there are no utils, helpers, or common modules.

CLI subcommands

The ollim-bot command doubles as both the bot runner and a CLI for managing routines, reminders, and Google integrations. Running ollim-bot with no arguments starts the Discord bot. Subcommands route to their respective modules: See the CLI reference for full flag documentation.

Code conventions

These rules come from the project’s CLAUDE.md and apply to all contributions.

Hard invariants

Violating these causes runtime bugs.
Channel-sync invariant — every path into stream_chat must call both agent_tools.set_channel and permissions.set_channel. This applies to _dispatch, _check_fork_transitions, slash_fork, send_agent_dm, button handlers in views.py, and check_fork_timeout in scheduler.py.

Design rules

Dependencies

Key runtime dependencies (from pyproject.toml): Key dev dependencies:

Data directory

All persistent state lives in ~/.ollim-bot/. If this directory is a git repository, storage.py auto-commits on writes to routines, reminders, and other managed files. See Data directory for the full layout.

Next steps

Testing

Test philosophy, running tests, and the no-mocks policy.

CLI reference

Full documentation of all CLI subcommands and flags.

Architecture overview

Module map, dependency diagram, and data flow.

Adding integrations

How to add new Google services, MCP tools, and webhook specs.