Under the Hood

CC is built entirely in Python with no heavy frameworks. Here's what's running beneath the surface.

SQLite Database

All CC data lives in a single SQLite database at ~/.cc-cli/cc_cli.db.

This includes your projects, environments, versions, databases, modules, settings, app state, and switch logs — everything CC needs to work, stored locally on your machine. No cloud, no external service.

The database is created automatically on first run and survives CC updates since it lives outside the package directory.

~/.cc-cli/
  cc_cli.db       ← all your data
  logs/
    cc.log        ← rotating log file

Custom Mini-ORM

CC uses a lightweight ORM built from scratch — no SQLAlchemy, no Django ORM. It lives in base/arm/ and was designed to feel familiar to anyone who's worked with Odoo's ORM.

Models are defined as Python classes:

class Environment(BaseEntity):
    _name = "environment"

    name        = Property(type=str, unique=True, required=True)
    project_id  = Property(relation="project")
    version_id  = Property(relation="version")
    branch_name = Property(type=str)
    database_id = Property(relation="database")
    module_ids  = Property(one2many="module", inverse_name="environment_id")

The ORM handles:

  • Auto schema syncsync_schema() creates or migrates tables on startup based on model definitions

  • Many-to-one relations — foreign keys resolved to full objects on access

  • One-to-many relationsenvironment.module_ids returns an EntityList

  • EntityList — a list subclass with .mapped(), .filtered(), and single-record attribute passthrough (like Odoo's recordset)

  • search() / find_by() — domain-based and keyword-based queries

  • create() / update() / delete() — full CRUD

Auto Schema Migration

On every startup, CC calls sync_schema() which compares the current model definitions against the live SQLite schema and applies any missing columns or tables. No migration files to manage.

App State

The active project/environment is tracked in an AppState model rather than a flag on the project itself. This enables multi-version mode — one active slot per Odoo version, each stored as a separate row.

Shell Integration

cc switch needs to change your terminal's working directory — something a subprocess can't do on its own. CC writes shell commands to a named pipe that a small shell function (installed by the installer) reads and executes in the parent shell. That's how cc cd and branch checkouts actually work.

Last updated

Was this helpful?