Skip to content

CLI reference

Generated for pachifast 0.15.0.

Run pachifast <command> --help for the same information in the terminal. Commands that read a project accept --base-dir (the project root, default .).

pachifast audit

Maintain the activity log of the project.

pachifast audit purge

Delete the activity log rows older than the retention. Run it from cron or a systemd timer.

Argument / option Description Default
--base-dir Project root containing .env and project_modules.py. .
--days Keep this many days (default: activity_log_retention_days).
--dry-run Only count the rows that would be deleted.

pachifast config

Tools for the pachifast.yaml configuration file.

pachifast config schema

Print (or write) the JSON Schema of pachifast.yaml, for completion and validation in the editor.

Argument / option Description Default
--output, -o Write the schema to this file instead of printing it.

pachifast dev

Run a generated project with uvicorn reload enabled.

Argument / option Description Default
--base-dir Project root containing main.py. .
--app ASGI app import string. main:app
--host Bind host (default: config, else 127.0.0.1).
--port Bind port (default: config, else 8000).

pachifast init

Prepare a generated project: .env, database migrations and first superuser.

Safe to run again: existing .env values, migrations and users are left untouched.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--username, -u Superuser username. admin
--password Superuser password (prompted if omitted).
--email Superuser email.
--database-url Auth database URL (default: SQLite file db.sqlite3 in the project).
--target-name Migration target of the auth tables. auth
--no-user Do not create the superuser.

pachifast locale

Check the message catalogs and export them for the frontend.

pachifast locale admin

List the texts of the model admin schema that a catalog can translate, and which languages have them.

The key is admin.<app>.<model>.title, .<column>.label, .<column>.options.<value> or .actions.<name>.label. A text with no entry keeps the default written in the code.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--missing Only the texts that some language does not translate.

pachifast locale check

Check the catalogs of the core, the modules and the project: same codes and fields in every language.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .

pachifast locale export

Export the messages as nested JSON for vue-i18n.

The files are generated: they are always overwritten and never read back. Keep the texts that end users change in a separate override file merged after them, or in the project's locale/ directory.

Argument / option Description Default
--dest-path Folder that receives one .json per language.
--base-dir Project root containing project_modules.py. .
--namespace Wrap the messages in this dotted path, e.g. errors.codes.
--top-level With --namespace: codes whose first part is this stay at the top of the file, not under the namespace (repeatable; default: settings, permissions, groups). Pass an empty value to wrap everything.
--core, --no-core Include the messages of the pachifast core (default: yes). True
--check Write nothing; exit 1 if the files are missing or out of date (for CI).

pachifast locale permissions

List the permissions and groups of the auth database and which languages have a label for them.

The key is permissions.<codename>.label / groups.<name>.label. An identifier that is not a valid key (for example a group called "Billing admins") cannot be translated and is shown with a -.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--missing Only the entries that some language does not translate.

pachifast locale settings

List the texts of the user settings schema that a catalog can translate, and which languages have them.

The key is settings.<section>.<field>.<label|properties.<name>|options.<value>>. A text with no entry keeps the default written in the code.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--missing Only the texts that some language does not translate.

pachifast migrations

Manage Alembic migrations for a generated project.

pachifast migrations downgrade

Rollback migrations for a target.

Argument / option Description Default
revision Revision to downgrade to, for example -1 or base.
--target-name Migration target name.
--base-dir Project root containing project_modules.py. .

pachifast migrations init

Create Alembic directories for migration targets.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--target-name Initialize only one migration target.

pachifast migrations list

List declared migration targets.

Argument / option Description Default
--base-dir Project root containing project_modules.py. .

pachifast migrations revision

Create a new Alembic revision.

Argument / option Description Default
message Revision message.
--target-name Migration target name.
--base-dir Project root containing project_modules.py. .
--autogenerate Generate migration operations from the models' metadata.

pachifast migrations strip-sqlmodel

Remove the SQLModel imports and types from the existing revision files (upgrade from 0.1.x).

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--check Only list the files that need the change (exit 1 if any).

pachifast migrations upgrade

Apply migrations for a target.

Argument / option Description Default
--target-name Migration target name.
revision (optional) Revision to upgrade to. head
--base-dir Project root containing project_modules.py. .

pachifast new

Create a project, app, or common module.

pachifast new app

Create a new app module in an existing project.

Argument / option Description Default
name App module name.
--base-dir Project root containing project_modules.py. .
--with-db Create settings and models scaffolding for a dedicated database target.
--no-register Create files without updating project_modules.py.

pachifast new common

Create a new common module in an existing project.

Argument / option Description Default
name Common module name.
--base-dir Project root containing project_modules.py. .
--with-db Create settings and models scaffolding for a dedicated database target.
--no-register Create files without updating project_modules.py.

pachifast new pipeline

Generate the Dockerfile, .dockerignore and the CI pipeline (GitHub Actions, GitLab CI and/or Gitea Actions).

Argument / option Description Default
--base-dir Project root containing project_modules.py. .
--provider CI provider to generate the pipeline for. Provider.ALL
--python-version Python version (major.minor) of the base image. 3.12
--force Overwrite files that already exist.
--index-name Name of a private uv index declared in pyproject.toml ([[tool.uv.index]]), e.g. a Gitea registry: its credentials are passed to the build as secrets (UV_INDEX_USERNAME / UV_INDEX_PASSWORD).
--ca-cert Path inside the project of the certificate authority (.crt/.pem) used by the private index's server, e.g. certs/internal-ca.crt: the image build trusts it. Public certificate, not a secret.

pachifast new project

Create a new project skeleton.

Interactive mode asks for the pyproject.toml properties that were not passed as options.

Argument / option Description Default
name Project name.
--output-dir Directory where the project will be created. .
--project-version Project version.
--description, -d One-line description.
--requires-python Python version specifier (default: >=3.11).
--author Author name.
--author-email Author email.
--license SPDX license expression, e.g. MIT or Apache-2.0.
--keyword, -k Keyword (repeat the option for more).
--homepage Homepage URL.
--repository Source repository URL.
--package, -p Runtime dependency, e.g. 'httpx>=0.27' (repeat for more).
--dev-package Development dependency, e.g. 'pytest' (repeat for more).
--interactive, --no-interactive Ask for the pyproject properties not given as options (default: only when running in a terminal). --no-interactive uses the options and defaults.
--git, --no-git Run git init in the new project and set the author as its local git user.name/user.email (only values not already set locally). True

pachifast serve

Run the project for production: no reload, multiple workers, proxy headers.

Host and port come from the options, else from PACHIFAST_HOST/PACHIFAST_PORT, .env or the YAML file.

Argument / option Description Default
--base-dir Project root containing main.py. .
--app ASGI app import string. main:app
--host Bind host (default: config, else 127.0.0.1).
--port Bind port (default: config, else 8000).
--workers Number of worker processes. 1
--proxy-headers, --no-proxy-headers Trust X-Forwarded-For/-Proto headers, from the addresses in --forwarded-allow-ips only. True
--forwarded-allow-ips Comma separated IPs allowed to send proxy headers. Default: uvicorn's (127.0.0.1 only, or the FORWARDED_ALLOW_IPS variable). Use '*' only when the server is reachable through the proxy alone.
--log-level Log level: critical, error, warning, info, debug, trace. info

pachifast users

Manage auth users in the configured authentication database.

pachifast users create

Create a new auth user.

Argument / option Description Default
username Username for the new user.
--base-dir Project root containing .env and project_modules.py. .
--password Plain-text password. If omitted, it is prompted.
--email Email address.
--first-name First name.
--last-name Last name.
--staff Create the user with is_staff=true.
--superuser Create the user with is_superuser=true.
--inactive Create the user with is_active=false.
--force Bypass the password length policy.

pachifast users delete

Delete an auth user and the data linked to it (groups, permissions, settings, MFA). It cannot be undone.

Argument / option Description Default
username Username of the user to delete.
--base-dir Project root containing .env and project_modules.py. .
--yes, -y Do not ask for confirmation.

pachifast users encrypt-mfa-secrets

Encrypt the TOTP secrets stored as plain text (rows written before 0.10). Safe to run again.

Argument / option Description Default
--base-dir Project root containing .env and project_modules.py. .

pachifast users ls

List auth users, optionally filtered.

Argument / option Description Default
filter (optional) Substring filter on username or email (case-insensitive).
--base-dir Project root containing .env and project_modules.py. .

pachifast users update

Update an existing auth user.

Argument / option Description Default
username Username of the user to update.
--base-dir Project root containing .env and project_modules.py. .
--password New plain-text password (see password_min_length and --force).
--prompt-password, -P Prompt for the new password.
--email New email address.
--first-name New first name.
--last-name New last name.
--staff, --no-staff Set is_staff flag.
--superuser, --no-superuser Set is_superuser flag.
--active, --no-active Set is_active flag.
--force Bypass the password length policy.