Repository navigation
02 Quick Tour
Five minutes through the major features, in the order you'd typically meet them. Everything here cross-links to the deeper docs. Already comfortable? Jump to Configuration Reference.
Declaratively in croft.toml:
[command.up]
desc = "Start the stack"
run = "docker compose up -d"Or as a shell script under .croft/commands/:
# .croft/commands/seed
#!/usr/bin/env bash
# @desc: Seed the database with development data
# @in: app
set -euo pipefail
php artisan migrate:fresh
php artisan db:seedBoth show up in croft list, both are runnable as croft <name>.
Use whichever shape matches the command's complexity. See
Recipes and Scripts.
in = "<service>" execs inside a Docker Compose service after a
status preflight. Absent → host. tty = true allocates a pseudo-TTY.
[command.test]
in = "app"
run = "composer test"
forward_args = true # croft test --filter Login → composer test --filter LoginBackend selection is [runtime].backend — compose, docker,
podman, or none. See Container Backends.
Two checkouts of the same repo run side-by-side without port or container collisions:
[worktrees]
dotenv = ".env" # auto-write resolved env to .env
[env]
APP_PORT = { base = "8080", offset = "CROFT_WORKTREE_OFFSET" }
DB_PORT = { base = "5432", offset = "CROFT_WORKTREE_OFFSET" }CROFT_WORKTREE_OFFSET is computed deterministically from the
worktree slug, so each checkout gets a stable, distinct integer
that drifts ports / COMPOSE_PROJECT_NAME / anything else
needing isolation. See Worktrees.
Native croft hooks plus .pre-commit-config.yaml repos coexist
behind the same shim:
[hooks]
pre-commit = ["check:format", "check:lint"]croft hooks installExternal repos in .pre-commit-config.yaml are cloned into
.croft/cache/hooks/<rev>/ and run natively — no pre-commit
binary required. See Hooks.
Drop ordered shell files into .croft/install/:
.croft/install/
01-copy-env
02-install-deps
03-migrate
04-seed-data # @optional: yes
Run them:
croft installEach step runs in order, with a line-redraw progress UI. Failures
prompt "Resume from <step>?" on the next run. Marking a step
# @optional: yes lets it fail without halting the rest;
# @interactive: yes hands the terminal to the step so
croft lib * prompts work. See
Install Flow.
Pull CLAUDE.md, AGENTS.md, and .claude/skills/ from a shared
upstream:
[[agents.sources]]
name = "org-baseline"
repo = "https://github.com/your-org/agent-baseline"
rev = "v1.0.0"croft agents install # pull pinned upstream
croft agents update # re-resolve revs
croft agents status # per-source rev + per-file driftWhole-file ownership: croft tracks every file it writes by SHA-256 and never touches local sibling files. See Agents.
croftA sidebar of recipes / scripts / services, an output pane,
lifecycle keymaps for compose + systemd + custom services, the
built-in diff view (G), and a
worktree switcher (W).
See TUI.
croft watch testRe-runs the recipe on filesystem change with a 300 ms debounce. See Watch.
EMAIL=$(croft lib ask "Admin email")
croft lib confirm "Seed the DB?" --default yes && php artisan db:seed
SVC=$(croft lib select "Service" app db redis)Prompts to stderr, answer to stdout, --default for non-tty / CI.
See Shell Library.
- Configuration Reference — every key.
- Commands Reference — every CLI flag.
- Examples — runnable projects.
croft is dual-licensed under MIT or Apache 2.0. Source: github.com/nsrosenqvist/croft. Back to Home.