Metadata-Version: 2.5
Name: assista-cli
Version: 0.1.4
Summary: CLI toolkit for Odoo developers - environment diagnostics, project scaffolding, and module generation.
Project-URL: Homepage, https://assista.dev
Project-URL: Repository, https://github.com/fadilameen/assista-cli
Author: Cybrosys Technologies
License: LGPL-3.0-or-later
License-File: LICENSE
Keywords: cli,devtools,erp,odoo,odoo-development
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.10
Requires-Dist: packaging>=24
Requires-Dist: rich>=13
Requires-Dist: tomli-w>=1.0
Requires-Dist: tomli>=2.0; python_version < '3.11'
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Description-Content-Type: text/markdown

# Assista CLI

Developer tooling for Odoo: environment diagnostics, project scaffolding, and module generation.

```bash
curl -LsSf https://assista.dev/install.sh | sh
```

One command. No prerequisites — not even Python; it provisions its own runtime
and never touches your system packages, so no `sudo` and no
`externally-managed-environment` errors.

```bash
cd ~/my-odoo-project
assista init
assista doctor
```

<details>
<summary>Other ways to install</summary>

```bash
uv tool install assista-cli      # if you already have uv
pipx install assista-cli         # if you already have pipx
```

Plain `pip install` is blocked on Debian/Ubuntu 24.04+ and other distros that
implement PEP 668. The installer above sidesteps that by using its own
virtual environment.
</details>

Supports **Odoo 12.0 – 19.0**. Default target: **19.0**.

---

## Why

Odoo tells you it crashed. It does not tell you that your `psycopg2` was built for
python 3.11 while your venv is 3.12, that your PostgreSQL role lacks `CREATEDB`, or
that your `wkhtmltopdf` is the unpatched build that silently drops report footers.

`assista doctor` answers *"will my project run, and if not, exactly why"* — and every
failure it reports ends in a command you can run.

## Commands

```
assista doctor                      # diagnose everything, 38 checks across 4 tiers
assista doctor --db mydb            # include per-database checks
assista doctor --format json        # versioned contract, for CI and editors
assista doctor --explain <check-id> # what a check means

assista init                        # adopt an existing checkout
assista create myproject            # new project: source + venv + odoo.conf

assista env resolve -V 19.0 -p 3.12 # exact dependencies Odoo declares
assista env create -V 13.0          # per-version venv, correct python
assista env sync                    # reconcile against Odoo's pins
assista env list / remove

assista source pull -V 19.0         # shallow clone, shared between projects
assista source list / update

assista module create sale_ext      # models, views, security, tests, i18n, README
assista module create --owl         # with an OWL component
assista module install / upgrade

assista run                         # start the server
assista run --watch --db mydb       # restart on .py, upgrade one module on .xml
assista shell                       # interactive ORM shell

assista db list                     # databases with size and Odoo version
assista db dump / duplicate / drop / neutralize

assista test sale_ext --db mydb     # run module tests
assista doctor --compare prod.json  # diff two environments
assista --install-completion        # shell completion
```

Note: `odoo-bin db` only exists from Odoo 16.0. On 12.0-15.0 the `db` commands
refuse with the version that added them and what to use instead, rather than
passing through a raw `odoo-bin` usage error.

## What makes it useful

**Dependency expectations are derived, never hand-maintained.** Odoo's own
`requirements.txt` encodes python-conditional pins as PEP 508 markers. `assista`
evaluates them against *your* interpreter, so it knows Odoo 19 wants
`werkzeug==2.0.2` on python 3.10 and `3.0.1` on 3.12 — and stays correct through
future Odoo releases with no updates from us.

**Checks nothing else performs:**

| Check | Why it matters |
|---|---|
| wkhtmltopdf patched-qt build | Unpatched silently drops headers, footers and logos. No error is raised. |
| Wheel ABI tags | A `cp311` wheel in a 3.12 venv *at the right version* passes a version comparison silently. |
| Import smoke tests | `python-ldap` installs fine and fails at import when `libldap.so` is missing. |
| Duplicate module names | Odoo loads whichever addons path comes first; editing the other copy does nothing. |
| Multiple PostgreSQL clusters | Connecting to the wrong one reports a database as missing when it exists. |
| Schema vs source version | The direct cause of "column does not exist" after adding a field. |

**Version-correct scaffolding.** Generated modules use `<list>` from 17.0, and
`group_ids` / `privilege_id` from 19.0 — using the old names raises at install.
Every generated module is validated in CI: python compiles, XML parses, the
manifest is a valid literal, and every declared file exists.

**Safe by default.** `db drop` requires typing the database name; `--yes` is not
accepted. Generated `odoo.conf` gets a random master password at mode 600 and
binds to localhost. `--dev` warns when combined with a non-local bind, because a
traceback then exposes an interactive python console.

## Version support

| Tier | Versions | Meaning |
|---|---|---|
| First-class | 17.0, 18.0, 19.0 | Odoo-supported. Exercised in CI. |
| Supported | 12.0 – 16.0 | Environment, source, run and db work. |
| Out of scope | ≤ 11.0 | Needs python 3.7 or 2.7, which cannot be provisioned. |

## Requirements

- Python 3.10+ (the CLI runs in its own isolated environment)
- [uv](https://docs.astral.sh/uv/) for environment provisioning
- PostgreSQL client (`psql`, `pg_dump`) for database work

## Development

```bash
uv venv --python 3.12 && uv pip install -e ".[dev]"
uv run pytest -q
```

## Licence

LGPL-3.0-or-later
