Jump to
↵select↑↓navigateescclose

Reference

Scaffolder

The flags and exit codes of frappe-init, the program behind nix run github:Avunu/frappe-nix that creates, migrates and sets up benches and app repositories.

Updated
Tags
  • reference
  • frappe-init
  • cli
  • scaffolding
On this page

nix run github:Avunu/frappe-nix runs frappe-init, the scaffolder. The flags below follow frappe-init --help. Pass them after --:

nix run github:Avunu/frappe-nix -- --dry-run

With a terminal and no flags it prompts for what it needs, using gum. It never prompts when stdin or stdout is not a terminal, so scripted runs must pass what they need.

Usage: frappe-init [options] [target-dir]

Mode

FlagMeaning
--initForce scaffold mode. Needs an empty directory unless you add --force.
--migrateForce migration mode. Also re-syncs a frappe-nix bench.
--appForce app mode: this repository is one Frappe app, and the bench around it is generated from flake inputs.
--forceRelax the mode guard. It never overwrites an existing file.
--dry-runPrint the plan and exit without changing anything.
-y, --yesAssume yes. Required to migrate without a terminal.

Without a mode flag, the mode is detected from the target directory, which is the current directory when it is a bench or a Frappe app. See Choose a mode.

Common

FlagMeaning
--frappe-version <V>develop, version-16 or version-15. Overrides detection.
--name <NAME>The bench name. Defaults to the existing name, or the target directory's name.
--site <SITE>The default site. Defaults to the existing default_site.
--skip-lockDo not run uv lock.
-h, --helpShow the help.

New benches default to the site frappe.localhost. App mode defaults to <BENCH_NAME>.localhost.

Scaffold only

FlagMeaning
--apps <A,B,C>Apps to add: names, owner/repo, or git URLs.

Migration only

FlagMeaning
--vendor <A,B>Force these apps to be vendored, with their source committed to the bench.
--no-vendorAbort instead of vendoring an app with no usable remote.
--allow-file-remotesAccept filesystem paths as submodule URLs.
--legacy-apps <POLICY>shim, skip or abort, for apps with only a setup.py.
--strictTreat dirty or unpushed apps as errors.
--absorb-gitdirsRun git submodule absorbgitdirs after registering the apps.
--keep-db-root-passwordDo not blank mariadb_root_password before committing.
--commit[=<MESSAGE>]Commit the result instead of only staging it.

See Migrate an existing bench for what each does.

Exit codes

A scripted run can tell why it stopped from the exit code.

CodeMeaning
0Done, or --dry-run finished.
1A forced --migrate or --app found an empty or missing directory, or another error with no more specific code.
2--init into a directory that is not empty, without --force.
4A flake.nix that is not a frappe-nix wrapper is in the way. --migrate --force writes the wrapper to flake.nix.frappe-nix to merge.
5The Frappe version is missing, unknown, undetectable or unsupported (below version-15), or the bench has several sites and no default_site.
6The directory is not the shape the mode needs (not a bench, not a Frappe app, or not a git repository for app mode), or you declined the confirmation.
7A bench skeleton has no app in it, so there is nothing to migrate.
8The bench is inside another git repository. --force creates a nested one anyway.