Skip to content

Commands Reference

A root justfile wraps all common operations. Run just (or just --list) for the full list.

xxx denotes a positional argument, e.g. just cli-init inventory.

Backend

RawjustPurpose
uv syncjust install backendInstall backend deps
uv run python run.pyjust run backendStart backend dev server (:9999)
uv run ruff check app/
uv run ruff format --check app/
just lint backendRuff lint (no fix)
uv run ruff check --fix app/
uv run ruff format app/
just fmt backendRuff fix + format
uv run basedpyright appjust typecheck backendStatic type check
uv run pytest tests/ -vjust test backendUnit tests
just check backendfmt + typecheck + test

Database

RawjustPurpose
uv run python -m app.cli initdbjust db-initFirst-time DB init (tables + base data)
uv run python -m app.cli initdb --forcejust db-resetReset the current dev database and local migration baseline, then initialize again
uv run tortoise makemigrationsjust makemigrationsGenerate migration files from model changes
uv run tortoise migratejust migrateApply pending migrations
just mmmakemigrations + migrate in one go
uv run tortoise historyjust dbhistoryMigration history

CLI code generation

RawjustPurpose
uv run python -m app.cli init <MOD>just cli-init xxxCreate module skeleton (models.py only)
uv run python -m app.cli gen <MOD>just cli-gen xxxParse models.py, generate backend schemas/controllers/api
uv run python -m app.cli gen-web <MOD>just cli-gen-web xxx [Chinese-Name]Parse models.py, generate frontend service/typings/views/i18n fragments
just cli-gen-all xxx [Chinese-Name]Run cli-gen + cli-gen-web

For details see Development guide.

Frontend

RawjustPurpose
cd web && pnpm installjust install frontendInstall frontend deps
cd web && pnpm devjust run frontendFrontend dev server (:9527)
cd web && pnpm exec oxlint
cd web && pnpm exec eslint .
just lint frontendFrontend lint (no fix)
cd web && pnpm lint
cd web && pnpm fmt
just fmt frontendFrontend fix + format
cd web && pnpm typecheckjust typecheck frontendvue-tsc
cd web && pnpm testjust test frontendVitest unit tests
cd web && pnpm buildjust build frontend / just buildProduction build
just check frontendfmt + typecheck + test

Full stack

CommandPurpose
just installInstall backend + frontend deps
just runRun backend (:9999) + frontend (:9527) together; Ctrl+C stops both
just fmtFormat / fix backend + frontend code
just testRun backend + frontend tests
just checkRun all backend + frontend quality checks

Compatibility aliases are still available: just install-all, just check-all, just web-install, just web-dev, just web-build, just web-lint, just web-typecheck, just web-check.

Docker

RawjustPurpose
docker compose up -djust upStart full stack (nginx :1880 + fastapi :9999 + redis)
docker compose up -d --buildjust rebuildRebuild images and recreate containers (after code / Dockerfile changes)
docker compose downjust downStop & remove containers
docker compose logs -fjust logsTail all logs; use just logs app to filter by service, just logs app 200 to set line count

Typical workflow

bash
# 1. install (first time)
just install

# 2. init DB (first time)
just db-init

# 3. create module skeleton
just cli-init inventory

# 4. edit app/business/inventory/models.py — define Tortoise models

# 5. generate backend code
just cli-gen inventory

# 6. generate frontend code
just cli-gen-web inventory Inventory

# 5+6 in one shot:
# just cli-gen-all inventory Inventory

# 7. run migrations
just mm

# 8. start dev servers
just run

# 9. pre-push gate
just check

基于 MIT 协议发布