Tooling
Commands and generators used every day while developing Sumeru.
Run the server
From sumeru/:
make run
# or
go run ./cmd/sumeru -- -c sumeru.conf
Common flags: -i install, -u update metadata from disk, -p / --http-port, -d database override, --stop-after-init (run install/update then exit). See sumeru/README.md for the full table.
# Install every module not yet installed (dependency order)
go run ./cmd/sumeru -- -c sumeru.conf -i all --stop-after-init
Database, i18n, and module utilities
make db-check # validate sumeru.conf and PostgreSQL connectivity
make i18n-export # export sys.translation rows to translations.csv
make i18n-import # import translations.csv into sys.translation
make migrate # run pending SQL migrations for all modules
make module ARGS='list' # list discovered modules + DB state
make module ARGS='depends-tree base'
make module ARGS='install sales' # install without starting HTTP server
make shell # interactive ORM REPL (search, read, create, domain)
Standalone binaries (same flags as above):
go run ./cmd/sumeru-migrate -- -c sumeru.conf
go run ./cmd/sumeru-module -- -c sumeru.conf list
go run ./cmd/sumeru-shell -- -c sumeru.conf
go run ./cmd/sumeru-i18n-import -- -c sumeru.conf -i translations.csv
Integration test database
make test-db # docker compose up PostgreSQL on port 5433
make test-integration # go test -tags=integration ./test/integration/...
Requires Docker. Set SUMERU_TEST_DSN to override the default test connection string.
Refresh addon Go imports (zimports.go)
Whenever you add an addon package that must register models in init(), regenerate blank imports:
cd sumeru
make generate
# equivalent: go generate ./cmd/sumeru
This runs cmd/sumeru-import-gen using an INI’s addons_path (in sumeru/, go generate ./cmd/sumeru uses the tracked sumeru.conf.example by default). External workspaces (sumeru_custom_addons) use make generate there with their own -out / -package — see sumeru_custom_addons/README.md.
Scaffold a new addon (sumeru-bp)
From the sumeru repo root:
make bp NAME=my_module
# or: go run ./cmd/sumeru-bp -- -name my_module
Creates addons/my_module/ with manifest, init.go, models/, starter views/, security/ (including sys.access.csv), and static placeholders. Module name must satisfy **^[a-z][a-z0-9_]*$**.
Then make generate and -i my_module once.
Tests
cd sumeru
go test ./...
Add focused tests next to packages you touch (render, orm, module, …).
Formatting
gofmt -w path/to/file.go
CI and local hygiene should keep gofmt clean on all committed Go files.