Skip to content

01 Getting Started

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

Getting Started

This page takes you from "no croft" to "first recipe + first hook + open dashboard" in under five minutes. After that, the Quick Tour shows the rest of the surface.

1. Install

croft is a single Rust binary. Three install paths:

Homebrew (macOS / Linux)

brew install nsrosenqvist/croft/croft

From a clone (any platform)

git clone https://github.com/nsrosenqvist/croft
cd croft
cargo install --path .

The binary is named croft and lands in ~/.cargo/bin/.

Once published to crates.io

cargo install croft

(Not yet on crates.io. Track the project README for the publish announcement.)

Verify

croft --version

2. Generate a starter croft.toml

Inside any project directory:

croft init

This drops a croft.toml at the project root and walks a registry of ecosystem detectors against the directory. Each detector contributes to the generated file:

Detector Trigger files What it contributes
compose docker-compose.{yml,yaml}, compose.{yml,yaml} [runtime] backend = "compose"
devcontainer .devcontainer/devcontainer.json, .devcontainer.json [devcontainer] enabled = true
dotenv .env, .env.local [env_files] entries
node package.json, deno.json[c], plus lockfile selects the tool dev / build / test / lint using npm / pnpm / yarn / bun / deno
python uv.lock, poetry.lock, pdm.lock, Pipfile.lock, requirements.txt, pyproject.toml install / test / (lint) using uv / poetry / pdm / pipenv / pip
rust Cargo.toml (workspace-aware) build / test / fmt / check
go go.mod build / test / run / vet
ruby Gemfile; Rails via bin/rails or config/application.rb install / test; Rails adds console / migrate
php composer.json; Laravel via artisan; Symfony via symfony.lock install / test; Laravel adds artisan / migrate, Symfony adds console

Open the file — every detected command is commented. Uncomment the ones you want to keep. When two detectors suggest the same name (e.g. both node and rust want build), init emits both under a "Multiple ecosystems suggest …" header so you can pick one.

Pass --template <NAME> to skip auto-detection and start from a hand-curated stack scaffold instead (laravel, rails, node, rust).

3. Define your first recipe

Edit croft.toml to add a recipe for a command you actually run:

[command.up]
desc = "Start all services"
run  = "docker compose up -d"

[command.shell]
desc = "Open a shell in the app container"
in   = "app"
run  = "/bin/sh"
tty  = true

in = "app" execs inside the named compose service. Absent → host. tty = true allocates a pseudo-TTY (required for shells).

Run them:

croft up
croft shell

croft list (or croft ls) shows every recipe and script, with their descriptions.

4. Install your first git hook

Add [hooks] to croft.toml:

[command.check]
desc = "Format + lint"
run  = ["check:format", "check:lint"]

[command.check:format]
run = "cargo fmt -- --check"

[command.check:lint]
run = "cargo clippy --all-targets -- -D warnings"

[hooks]
pre-commit = ["check"]

Then:

croft hooks install

This writes .git/hooks/pre-commit as a shim that runs croft hooks run pre-commit. Try it: git commit triggers check automatically. See Hooks for the full model (including .pre-commit-config.yaml compatibility).

5. Open the dashboard

croft

Bare croft opens the TUI: a sidebar of every recipe, script, and service; an output pane for whatever's selected; service lifecycle keymaps; a built-in diff view (G); a worktree switcher (W).

6. Where to go next

  • The full tour → Quick Tour — a guided 5-minute walk through every major feature.
  • Schema reference → Configuration Reference for every croft.toml key.
  • Real projects → Examples — runnable configurations under examples/.
  • Stuck? → Troubleshooting — croft doctor and common pitfalls.

Clone this wiki locally