Environment (of env)¶
Manage Odoo environments — start, stop, configure, and monitor.
of env up [env]¶
Start an environment (default: main).
| Flag | Default | Description |
|---|---|---|
-v, --verbose |
false |
Show live Docker logs |
--json |
false |
JSON output |
--all |
false |
Start all environments in project.yml |
With --all, environments start sequentially in project.yml order. If one fails, the rest still start and the command exits 1. The positional argument cannot be combined with --all. --verbose is ignored with --all (non-blocking mode).
--all --json output:
{
"success": true,
"environments": [
{"environment": "main", "success": true, "url": "http://localhost:8069", "env_type": "dev"},
{"environment": "st", "success": true, "url": "http://localhost:8070", "env_type": "dev"}
]
}
of env down [env]¶
Stop an environment.
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
--all |
false |
Stop all environments in project.yml |
With --all, environments stop sequentially. Stopped environments are reported as failures (Environment <name> is not running.) but do not abort the rest; the command exits 1 if any environment failed. The positional argument cannot be combined with --all.
--all --json output:
{
"success": true,
"environments": [
{"environment": "main", "success": true, "message": "Environment main stopped successfully!"},
{"environment": "st", "success": true, "message": "Environment st stopped successfully!"}
]
}
of env restart [env]¶
Restart an environment.
| Flag | Default | Description |
|---|---|---|
-v, --verbose |
false |
Verbose output |
--json |
false |
JSON output |
--all |
false |
Restart all environments in project.yml |
Same semantics as up --all: sequential, continues on failure, exits 1 if any environment failed, positional argument rejected with --all, --verbose ignored.
Note:
of env rm --allmeans something different (remove the environment and the project). Onlyup,downandrestartuse--allas "all environments".
of env pull [env]¶
Pre-pull base images (Odoo, PostgreSQL).
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
of env init [env]¶
Initialize from project.yml — build Dockerfile, clone repos, generate config.
| Flag | Default | Description |
|---|---|---|
--up, -u |
false |
Start after init |
--json |
false |
JSON output |
--db-name |
— | Default database name (also used as the DB to initialize with --init-db) |
--hide-db-list/--no-hide-db-list |
— | Hide DB list from login |
--recreate |
false |
Recreate docker-compose.yml even if it already exists |
--init-db |
false |
Create the database and install modules after setup |
--modules, -m |
base |
Modules to install on init (comma separated) |
--language |
en_US |
Language to load on init |
--admin-user |
admin |
Admin user to configure |
--admin-password |
— | Admin password to set (random if omitted) |
By default, of env init skips regenerating docker-compose.yml and .env when they already exist; use --recreate to force it.
Clones repositories specified in project.yml, resolves ${VAR} tokens from shell or .env, and updates .project.lock with exact commit SHAs and environment metadata.
With --init-db, odoofly creates the database (named after --db-name or the project name) and installs the requested modules, using the DB_USER, DB_PASSWORD and ADMIN_PASSWORD values from the environment .env. It starts the containers first if they are not running, reconciles the postgres role password with the .env, sets the admin user password (random unless --admin-password is given) and prints the access data (URL, admin and DB credentials, master password). It also writes db_name into etc/odoo.conf and restarts the odoo container so opening the URL lands directly on the database login page instead of the database selector.
of env rm [env]¶
Remove an environment folder and optionally containers/volumes. Also removes the environment entry from .project.lock.
| Flag | Default | Description |
|---|---|---|
--all |
false |
Remove both project and environment |
--yes, -y |
false |
Skip confirmation |
--json |
false |
JSON output |
of env new¶
Create a new environment (dev or staging). The environment directory is automatically added to the project's .gitignore. Logs an ### Added entry in the project's CHANGELOG.md.
| Flag | Default | Description |
|---|---|---|
--name, -n |
— | Environment name |
--image, -i |
config default | Docker image |
--version |
config default | Odoo version |
--production, -P |
false |
Production mode |
--staging, -s |
false |
Staging mode (clones main) |
--domain, -d |
— | Domain (production) |
--port |
auto | Dev port |
--users, -u |
5 |
Concurrent users |
--ram, -r |
auto |
RAM in GB |
--websecure, -w |
false |
Let's Encrypt |
--command, -c |
— | Custom Odoo command |
--repos |
— | JSON array of repos |
--preinstall |
— | Pre-build shell commands |
--postinstall |
— | Post-build shell commands |
--yes, -y |
false |
Skip confirmation |
--json |
false |
JSON output |
--db-name |
— | Default database name |
--hide-db-list/--no-hide-db-list |
— | Hide DB list |
of env status [env]¶
Show container status and health.
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
of env ls¶
List all environments across projects.
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
of env url [env]¶
Show formatted access URL.
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
of env logs [env]¶
View Odoo container logs.
| Flag | Default | Description |
|---|---|---|
--tail, -t |
all | Number of lines |
--json |
false |
JSON output (requires --tail) |
of env shell [env] [db]¶
Open interactive odoo shell.
| Argument | Default | Description |
|---|---|---|
env |
main |
Environment name |
db |
odoo |
Database name |
of env stats [env]¶
Live resource monitor (CPU/RAM/IO), refreshes every 0.5s.
| Flag | Default | Description |
|---|---|---|
--json |
false |
Single snapshot as JSON |
of env conf [env]¶
View or modify odoo.conf.
| Flag | Description |
|---|---|
--users, -u |
Set workers based on user count |
--ram |
Set memory limits (GB) |
--auto-ram |
Auto-calculate from server specs |
--admin-passwd |
Change admin password |
--db-user |
PostgreSQL user |
--db-password |
PostgreSQL password |
--proxy-mode |
Enable proxy mode |
--db-name |
Set default database |
--clear-db-name |
Remove default DB (show picker) |
--hide-db-list/--no-hide-db-list |
Toggle DB list |
--set key=value |
Set arbitrary config key |
--unset key |
Remove config key |
--show |
Display current config |
--restart, -r |
Restart after applying |
--json |
JSON output |
of env check [env]¶
Runtime health check — containers, logs, DB connectivity, port, odoo.conf, .env, repos.
Checks for:
- Container status and recent ERROR/FATAL in logs
- Database accessibility
- Port binding
- odoo.conf required keys
- .env required variables
- Repository clone status
- Hardcoded token warnings — alerts when a repository token is a plain string instead of a ${VAR} reference
| Flag | Default | Description |
|---|---|---|
--json |
false |
JSON output |
of env update [env] [db]¶
Update modules + optionally git and server config.
| Flag | Default | Description |
|---|---|---|
--module, -m |
all | Module(s) to update, comma-separated (e.g. -m a,b,c). Installed modules go to -u, known-but-uninstalled to -i, unknown names raise "Module not found". With --git, only the repositories that contain the listed modules are refreshed |
--git, -g |
false |
Update repositories from git (updates .project.lock). With -m, only the repository containing each requested module is refreshed |
--so |
false |
Update server options |
--stash, -s |
false |
Stash changes before git pull |
--restart, -r |
false |
Restart after update |
--build |
false |
Regenerate Dockerfile/compose from project.yml, rebuild the image and restart. Without -m no module is updated |
-v, --verbose |
false |
Verbose output |
--json |
false |
JSON output |
--db-name |
— | Default database name |
--hide-db-list/--no-hide-db-list |
— | Hide DB list |
Example: update a specific list of modules
Scoped Git update with -m
of env update <env> <db> -m <module> --git refreshes only the
repository that contains <module>, not every repository of the
environment. The module is located by scanning <env>/addons for a
checkout with a directory of that name holding a
__manifest__.py/__openerp__.py; a repository that is the module, or a
not-yet-cloned repo named after the module, is matched too. The other
repositories keep their pinned commits in .project.lock. Without -m,
--git still updates every repository, and if a Git operation fails the
failing URL, the Git message and a hint are printed.
With --json the payload lists only the refreshed repositories and adds
unmatched_modules for requested modules that no repository provides. A
Git failure returns status: error with the error message and exits with
code 1; no human text is interleaved into the JSON document.
Automatic image rebuild on --git
When --git detects that the Python requirements changed (new/removed
dependencies in any repo), Odoofly regenerates the Dockerfile and
docker-compose.yml (build: stanza), rebuilds the image with
docker compose build, and restarts the environment so it runs with the
new image — no -r needed in that case. If the build fails, the command
exits with code 1 and the environment keeps running the previous image.
With --json, the payload includes requirements_changed, image_rebuilt
and restarted.
Every successful build is recorded in <env>/.odoofly_build (sha256 of the
Dockerfile + requirements_all.txt). --git also rebuilds when the
current files differ from that record — e.g. after of repo add brought
new dependencies. Images built before the record existed are not rebuilt
automatically: use --build once (also after editing preinstall in
project.yml).
of env install [env] [db] [module]¶
Install an Odoo module.
| Flag | Default | Description |
|---|---|---|
-v, --verbose |
false |
Show install logs |
--json |
false |
JSON output |
of env uninstall [env] [db] [module]¶
Uninstall an Odoo module.
| Flag | Default | Description |
|---|---|---|
-v, --verbose |
false |
Show uninstall logs |
--json |
false |
JSON output |
of env modules [env] [db]¶
List all or installed modules.
| Flag | Default | Description |
|---|---|---|
--installed, -i |
false |
Only installed modules |
--json |
false |
JSON output |
of env users [env] [db]¶
List the users of a database and their status. Prints a table with Login,
Name, Type, Active and Last login (or never), plus a per-type tally.
The type is resolved from the base groups (base.group_user → Internal,
base.group_portal → Portal, base.group_public → Public), falling back to
the denormalized res_users.share flag when the user belongs to none of them.
Read-only: it runs a single psql query and never opens odoo shell.
| Flag | Default | Description |
|---|---|---|
--active |
false |
Only enabled users |
--inactive |
false |
Only archived users (mutually exclusive with --active) |
--type |
all | Filter by type: internal, portal or public |
--json |
false |
JSON output (list of {login, name, type, active, last_login}) |
of env update-list [env] [db]¶
Refresh the Odoo module/app list in a database (runs ir.module.module.update_list() inside the Odoo container).
| Flag | Default | Description |
|---|---|---|
-v, --verbose |
false |
Show detailed update output |
--json |
false |
JSON output |
of env password [env] [db] [user] [password]¶
Reset any user password via DB injection.
| Flag | Default | Description |
|---|---|---|
--random, -r |
false |
Generate random password |
--json |
false |
JSON output |
of env restore [env] [backup_path]¶
Restore a .zip backup to an environment.
| Flag | Default | Description |
|---|---|---|
--db |
from manifest | Target database name |
--yes, -y |
false |
Skip confirmation |
--json |
false |
JSON output |