{"id":50126310,"url":"https://github.com/mdfarhankc/odoo-rich-cli","last_synced_at":"2026-05-23T20:04:06.922Z","repository":{"id":345283810,"uuid":"1185235522","full_name":"mdfarhankc/odoo-rich-cli","owner":"mdfarhankc","description":"ORC - A Rich-powered CLI for everyday Odoo development tasks.","archived":false,"fork":false,"pushed_at":"2026-05-19T12:40:37.000Z","size":105,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T15:40:45.409Z","etag":null,"topics":["automation","backup","cli","database-management","developer-experience","developer-tools","erp","module-management","odoo","odoo-bin","odoo-cli","odoo-developer","odoo-shell","odoo-tools","postgresql","restore","rich","scaffold","tui","typer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdfarhankc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T11:26:26.000Z","updated_at":"2026-05-19T12:40:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mdfarhankc/odoo-rich-cli","commit_stats":null,"previous_names":["mdfarhankc/odoo_rich_cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mdfarhankc/odoo-rich-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdfarhankc%2Fodoo-rich-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdfarhankc%2Fodoo-rich-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdfarhankc%2Fodoo-rich-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdfarhankc%2Fodoo-rich-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdfarhankc","download_url":"https://codeload.github.com/mdfarhankc/odoo-rich-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdfarhankc%2Fodoo-rich-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33410354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","backup","cli","database-management","developer-experience","developer-tools","erp","module-management","odoo","odoo-bin","odoo-cli","odoo-developer","odoo-shell","odoo-tools","postgresql","restore","rich","scaffold","tui","typer"],"created_at":"2026-05-23T20:03:55.063Z","updated_at":"2026-05-23T20:04:06.908Z","avatar_url":"https://github.com/mdfarhankc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Odoo Rich CLI\n\nA Rich-powered CLI for everyday Odoo development tasks — run the server, manage modules, scaffold code, and handle crons without writing ORM scripts in `odoo shell`.\n\nCompatible with **Odoo 14+** and **Python 3.10+**.\n\nThe CLI command is **`orc`** (Odoo Rich Cli). Install it once globally and run it from any Odoo project root.\n\n## Features\n\n- **20 commands** — run, install, upgrade, uninstall, update-list, info, list, clear-assets, reset-password, scaffold, shell-exec, cron-list, cron-toggle, cron-on, cron-off, plus a `db` group: `db list`, `db backup`, `db restore`, `db duplicate`, `db drop`\n- **Interactive menu** — run `orc` with no arguments for a guided Rich UI organised into managers (Module / Database / Asset / User / Cron / Dev Tools)\n- **Global flags** — pass `-c` and `-d` at the top level, works for both direct commands and interactive mode\n- **Project-aware** — `orc` only runs inside an Odoo project root (detected by an `odoo-bin` file). It runs `odoo-bin` with the active virtualenv's Python (or `sys.executable` as a fallback)\n- **Reads odoo.conf** — auto-detects database and config from your project directory\n- **Fully typed, tested, and lint-clean** — ships `py.typed`, passes `mypy --strict`, covered by pytest, formatted with ruff\n\n## Installation\n\n```bash\npip install odoo-rich-cli\n```\n\nOr with [pipx](https://pipx.pypa.io/) / [uv](https://github.com/astral-sh/uv) for an isolated global install:\n\n```bash\npipx install odoo-rich-cli\n# or\nuv tool install odoo-rich-cli\n```\n\nBoth expose the `orc` command on PATH.\n\n### Run without installing\n\n```bash\nuvx odoo-rich-cli\n```\n\n`uvx` (`uv tool run`) downloads the package into a temporary environment and invokes it. Use the full `odoo-rich-cli` name here; the short `orc` only works once installed.\n\n### Embed in your project\n\nIf you'd rather not install anything globally, drop a `cli.py` in your Odoo project root and call the embed helper. Defaults you pass are pre-applied; the user can still override them on the command line.\n\n```python\n# cli.py\nfrom odoo_rich_cli import run\n\nif __name__ == \"__main__\":\n    run(config=\"./config/odoo.conf\", database=\"my_db\")\n```\n\n```bash\npython cli.py install -m sale       # runs with the baked-in -c/-d defaults\npython cli.py -d other_db list      # override database for one call\npython cli.py                       # launch the interactive menu\n```\n\nThis still requires `odoo-rich-cli` to be installed in your venv (e.g. `pip install odoo-rich-cli` alongside Odoo) — it just spares you from typing `orc -c … -d …` every time.\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `run` | Launch the Odoo server (extra flags pass through to odoo-bin) |\n| `install -m \u003cmodule\u003e` | Install a module |\n| `upgrade -m \u003cmodule\u003e` | Upgrade an installed module |\n| `uninstall -m \u003cmodule\u003e` | Uninstall a module |\n| `update-list` | Refresh the list of available modules |\n| `info -m \u003cmodule\u003e` | Show module details (state, version, dependencies, dependents) |\n| `list` | List modules (with `--installed` or `--uninstalled` filter) |\n| `clear-assets` | Delete compiled CSS/JS asset bundles |\n| `reset-password` | Reset a user's password (default: admin/admin) |\n| `scaffold -m \u003cmodule\u003e` | Generate a new module skeleton |\n| `shell-exec -f \u003cscript.py\u003e` | Run an arbitrary Python script through odoo shell |\n| `cron-list` | List all scheduled actions with their status |\n| `cron-toggle -i \u003cid\u003e` | Toggle a single scheduled action on/off |\n| `cron-on` | Enable ALL scheduled actions |\n| `cron-off` | Disable ALL scheduled actions |\n| `db list` | List databases on the configured PostgreSQL server |\n| `db backup \u003cname\u003e [-o file.zip]` | Back up a database to a zip file |\n| `db restore \u003cname\u003e -i file.zip [--copy]` | Restore a database from a zip backup |\n| `db duplicate \u003csource\u003e \u003ctarget\u003e` | Duplicate a database |\n| `db drop \u003cname\u003e [-y]` | Drop a database (interactive confirmation by default) |\n\n## Usage\n\nRun `orc` from your Odoo project directory (where `odoo-bin` lives), with your Odoo virtualenv activated. If `odoo-bin` is not in the current directory, `orc` will exit with an error.\n\n### Run the Odoo server\n\n```bash\norc run                                # uses cfg + db from odoo.conf\norc run --dev all -u sale              # any odoo-bin flags pass through\norc run -- --workers=0 --log-level=debug  # use `--` for flags ambiguous with orc's own\n```\n\nstdout/stderr stream live; press Ctrl+C to stop the server.\n\n### Module operations\n\n```bash\norc install -m sale\norc upgrade -m sale\norc uninstall -m sale\n```\n\n### Module discovery\n\n```bash\n# Refresh module list (required before installing new modules)\norc update-list\n\n# Show details about a module\norc info -m sale\n\n# List all installed modules\norc list --installed\n\n# List all modules\norc list\n```\n\n### Maintenance\n\n```bash\n# Clear compiled CSS/JS assets (fixes \"my styles aren't updating\")\norc clear-assets\n\n# Reset admin password to \"admin\"\norc reset-password\n\n# Reset a specific user's password\norc reset-password -u john -p newpass123\n```\n\n### Cron management\n\n```bash\n# List all scheduled actions\norc cron-list\n\n# Toggle a specific cron by ID\norc cron-toggle -i 42\n\n# Disable every scheduled action (useful for staging restores)\norc cron-off\n\n# Re-enable every scheduled action\norc cron-on\n```\n\n### Database operations\n\n```bash\n# List databases on the server\norc db list\n\n# Back up a database (default output: \u003cname\u003e-\u003ctimestamp\u003e.zip in cwd)\norc db backup my_db\norc db backup my_db -o /backups/snapshot.zip\n\n# Restore from a zip\norc db restore new_db -i /backups/snapshot.zip\norc db restore new_db -i /backups/snapshot.zip --copy   # resets UUID + crons\n\n# Duplicate\norc db duplicate prod_clone staging\n\n# Drop (asks for confirmation; -y to skip)\norc db drop scratch_db\norc db drop scratch_db -y\n```\n\n`orc db` shells into the configured working DB and operates on the target as an\nargument, so dropping the connected DB is refused — use `-d` to point at a\ndifferent database first if you need to.\n\n### Development\n\n```bash\n# Generate a new module skeleton\norc scaffold -m my_custom_module\n\n# Generate in a specific directory\norc scaffold -m my_custom_module -p ./addons\n\n# Run a custom script through odoo shell\norc shell-exec -f fix_data.py\n```\n\n### Global flags\n\nThe `-c` (config) and `-d` (database) flags work at the top level and on every subcommand:\n\n```bash\n# Launch interactive menu with a specific config\norc -c ./local-odoo.conf\n\n# Direct command with config and database override\norc install -m sale -c /path/to/odoo.conf -d my_database\n```\n\n### Interactive menu\n\n```bash\norc\n```\n\nLaunches a Rich interactive menu with an ASCII banner, config status panel, and a numbered top-level menu:\n\n```\n[1] Run               Launch the Odoo server\n[2] Module Manager    Install / upgrade / info / list\n[3] Database Manager  List / backup / restore / drop\n[4] Asset Manager     Clear compiled asset bundles\n[5] User Manager      Reset passwords\n[6] Cron Manager      List, toggle, enable/disable crons\n[7] Dev Tools         Scaffold a module / run shell scripts\n[0] Exit\n```\n\nEach manager opens a sub-menu with `[0] Back`. If config was auto-detected, you won't be prompted for it again.\n\n## How it works\n\n1. `orc` requires an `odoo-bin` file in the current directory — that's the marker for \"this is an Odoo project\". If missing, it exits with a clear error.\n2. It runs `./odoo-bin` under the Python from your activated virtualenv (`$VIRTUAL_ENV`), falling back to `sys.executable` if no venv is active. This means `uv tool install orc` / `uvx odoo-rich-cli` still pick up your odoo deps from the venv you activated.\n3. For shell-based commands it builds a Python ORM script and pipes it into `odoo shell -c \u003cconf\u003e -d \u003cdb\u003e --no-http` via subprocess.\n4. Each script runs the operation and calls `env.cr.commit()` so changes persist after the shell exits.\n5. Output is parsed via a sentinel marker for reliable result extraction from odoo shell's startup noise.\n\n## Testing locally\n\n### Prerequisites\n\n- An Odoo source checkout with `odoo-bin` in the project root\n- A PostgreSQL database already set up\n- An `odoo.conf` file in the project root\n- Your Odoo virtualenv activated (so all dependencies are available)\n\n### Install in editable mode\n\nInstall `orc` into your Odoo virtualenv so everything shares the same environment:\n\n```bash\npip install -e .\n```\n\nWith editable mode (`-e`), code changes are picked up immediately — no need to reinstall after every edit.\n\n### Test commands\n\n```bash\n# Verify the CLI loads\norc --help\n\n# Test interactive menu\norc\n\n# Test against your database\norc update-list\norc list --installed\norc info -m sale\norc install -m sale\norc upgrade -m sale\norc clear-assets\norc reset-password\norc scaffold -m test_module -p /tmp\norc cron-list\norc db list\norc db backup my_db -o /tmp/my_db.zip\norc run --workers=0\n```\n\n### Run the dev toolchain\n\n```bash\nuv sync --group dev      # install ruff, mypy, pytest\nuv run ruff check\nuv run ruff format --check\nuv run mypy\nuv run pytest\n```\n\n## Project structure\n\n```\nodoo-rich-cli/\n├── pyproject.toml              # Project metadata, dependencies, entry point (orc)\n├── README.md\n├── release-notes.md            # Changelog\n├── CONTRIBUTING.md\n├── LICENSE\n├── main.py                     # Thin entry point: python main.py\n├── .github/\n│   ├── dependabot.yml          # Weekly uv + actions updates\n│   └── workflows/\n│       ├── ci.yml              # Lint + tests on Linux/macOS/Windows × Py 3.10–3.13\n│       └── publish.yml         # Tag-driven PyPI publish via trusted publishing\n├── src/\n│   └── odoo_rich_cli/\n│       ├── __init__.py         # Package version + run() embed helper export\n│       ├── py.typed            # PEP 561 marker — library is fully typed\n│       ├── config.py           # odoo.conf parsing + odoo-bin / project-root detection\n│       ├── shell.py            # Pipes scripts into odoo shell, runs odoo server, parses sentinel output\n│       ├── commands.py         # ORM scripts for all shell-based commands\n│       ├── scaffold.py         # Module skeleton generator (pure file creation)\n│       ├── ui.py               # Shared Rich panels, tables, and status spinner\n│       ├── app.py              # Typer CLI app with all commands\n│       └── menu.py             # Rich interactive menu (managers + sub-menus)\n└── tests/                      # pytest suite — scaffold, config, shell, app helpers, db commands\n```\n\n## Changelog\n\nSee [release-notes.md](release-notes.md) for what changed in each version.\n\n## Contributing\n\nContributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on setting up the dev environment, submitting PRs, and reporting bugs.\n\n## License\n\nMIT — see [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdfarhankc%2Fodoo-rich-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdfarhankc%2Fodoo-rich-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdfarhankc%2Fodoo-rich-cli/lists"}