Jump to
↵select↑↓navigateescclose

Reference

Scaffolder

The flags and exit codes of odoo-init, the program behind nix run github:Avunu/odoo-nix that creates, migrates and repairs projects.

Updated
Tags
  • reference
  • odoo-init
  • scaffolding
On this page
nix run github:Avunu/odoo-nix -- [FLAGS] [TARGET_DIR]

odoo-init --help lists the flags. With a terminal and no flags it prompts for what it needs. It never prompts when stdin or stdout is not a terminal, so a scripted run passes what it needs. See Choose a mode for how it picks a mode.

Flags

FlagMeaning
--initForce scaffold mode. Needs an empty directory unless you add --force.
--migrateForce migration mode; also repairs an odoo-nix project.
--forceRelax the mode guard. It never overwrites an existing file.
--dry-runPrint the plan, including the files it would write, and exit without changing anything.
-y, --yesAssume yes. Required to migrate without a terminal.
--version <V>The Odoo series, 18.0, 19.0 or 20.0; overrides detection.
--bundles <A,B>Curated OCA bundles to install (data/oca-bundles.json).
--modules <A,B,C>OCA modules to install. --apps is an alias.
--name <NAME>The project name (odoo-nix.name). Defaults to the existing one, or the target directory's name.
--db <NAME>The default database (settings.dbName). Defaults to the existing one, or odoo.
--skip-lockDo not run uv lock.
--commit[=<MESSAGE>]Commit the result instead of only staging it. The message is only taken as --commit=<MESSAGE>, so --commit <DIR> is the flag and a target.
-h, --helpShow the help.

--version was --series before odoo-nix and frappe-nix agreed on one set of scaffolder flags. The old name still works, with a warning, through 1.x. In lib/odoo-presets.json the key holding each preset's git branch is branch (it was series); the schema is the one both products share, label, branch, python and requiresPython, with nodejs and overrideDependencies optional.

Exit codes

They follow frappe-nix's table where it applies.

CodeMeaning
0Done, or --dry-run finished.
1A usage error, a forced --migrate on an empty or missing directory, OCB could not be cloned, or another error with no more specific code.
2--init into a directory that is not empty, without --force.
4A flake.nix or pyproject.toml that is not odoo-nix's is in the way. --force writes odoo-nix's beside it to merge.
5The Odoo series is missing, unknown, undetectable, or has no preset.
6The directory is not the shape the mode needs (not empty and not an Odoo tree), or the confirmation was declined or could not be asked (no terminal and no -y).
7custom/ or modules/ with no module in them and no OCB: nothing to migrate.
8The tree is inside another git repository. --force creates a nested one anyway.
130Interrupted.

A failing git step exits with git's own status. frappe-nix's 3 belongs to its --sync and --check, which odoo-nix does not have.