Skip to content

18 Examples

github-actions[bot] edited this page May 21, 2026 · 2 revisions

Examples

Runnable croft projects under examples/ in the source tree. Clone the repo, cd into one, and croft list will show what's wired up.

The smallest useful croft.toml: a couple of host-only recipes, no containers, no services. Use as a starting template when you're adding croft to a project that doesn't need compose.

Showcases:

  • [command.*] recipe basics.
  • [env] resolution without container backends.
  • [runtime].backend = "none".

A complete Laravel + Docker Compose project, modeled on the hand-rolled dev scripts croft was built to replace. Covers most of the surface in one place.

Showcases:

  • Compose backend with default_service = "app".
  • Recipes that exec inside containers (croft artisan migrate, croft shell, croft test --filter Login).
  • Native [hooks] plus a .pre-commit-config.yaml mix.
  • Watch mode pinned in the TUI as a pane.
  • [worktrees].dotenv = ".env" so two checkouts run side-by-side with distinct port ranges.

.croft/install/ ordered setup with optional + interactive steps. Walks through croft install, single-step mode (croft install <step>), --restart, --list, and how install.state.json drives resume.

Showcases:

  • Numeric-prefix ordered steps (01-copy-env, 02-install-deps, 03-seed-db, 04-finalize).
  • # @optional: yes for steps that may fail in some environments.
  • # @interactive: yes plus croft lib ask for first-run secret prompts.
  • Resume-after-failure prompt and --restart.

Git hook configuration end to end: native [hooks] recipes plus a .pre-commit-config.yaml mixing repo: local (language: system) and an external repo at a pinned tag.

Showcases:

  • croft hooks install writes .git/hooks/pre-commit.
  • The shim format and what gets executed.
  • .croft/cache/hooks/<rev>/ cache for the external repo.
  • The repo: meta / unsupported-language error messages and how to wrap a non-system hook with a language: script shim.

Opt-in devcontainer integration: [devcontainer] enabled = true plus a minimal image-only .devcontainer/devcontainer.json. Use as a starting template when you want croft shell and TUI terminals to land inside an isolated workspace container instead of the host.

Showcases:

  • [devcontainer] config block.
  • Auto-detect of .devcontainer/devcontainer.json.
  • remoteEnv injected into every docker exec.
  • croft doctor reporting the resolved container + image plan.

A self-describing upstream layout an org can fork to ship shared agent instructions and skills via [[agents.sources]].

Showcases:

  • croft-agents.toml upstream manifest with [[file]], [[dir]], and mode = "once".
  • agents/CLAUDE.md, agents/AGENTS.md, skills/, commands/ directory layout.
  • Local sibling overrides (CLAUDE.local.md).
  • Downstream override examples (skip / relocate).

See also

Clone this wiki locally