Repository navigation
07 Non Container Services
Some projects mix compose-managed containers with services
controlled some other way: a system Postgres, a brew-installed
Redis, an ngrok tunnel, an LSP daemon. croft handles them through
two config shapes that compile down to the same internal
CustomBackend.
You describe how to control it.
[[services.custom]]
name = "ngrok"
status = "pgrep -x ngrok" # exit 0 = Running; non-zero = Stopped
start = "ngrok http 8080 > /tmp/ngrok.log 2>&1 &"
stop = "pkill -x ngrok"
restart = "..." # optional; defaults to stop && start
logs = "tail -f /tmp/ngrok.log" # optional; absent → no log tailing
desc = "Public tunnel" # optional; shown in the TUIRequired fields: name, status, start, stop. The status
command's exit code is the contract — stdout / stderr aren't
parsed.
Fills in start / stop / restart / status / logs from systemctl.
[[services.systemd]]
name = "postgres"
unit = "postgresql.service"
scope = "user" # "user" (default) | "system"The .service suffix is conventional but optional — systemctl
accepts both. scope = "system" is for shared system daemons; the
default is per-user (systemctl --user) since dev-loop services are
almost always user-scoped.
For anything beyond unit + scope (custom systemctl flags,
drop-in envs), drop down to [[services.custom]] and call
systemctl from there.
Service names must be unique across services.custom,
services.systemd, and the compose project. Collisions error at
config-load time so you find them before they're a debugging
problem.
Every declared service gets a row in the TUI sidebar tagged with its backend kind. The lifecycle keymap is uniform across all kinds:
| Key | Action |
|---|---|
r |
Start (or restart, depending on context) |
R |
Force restart |
s |
Stop |
S |
Stop and remove (compose only) |
U |
Up (compose only) |
D |
Down (compose only) |
See TUI.
A project with [runtime].backend = "none" plus only
[[services.systemd]] / [[services.custom]] declarations is fully
supported:
[runtime]
backend = "none"
[[services.systemd]]
name = "postgres"
unit = "postgresql.service"
[[services.custom]]
name = "redis"
status = "redis-cli ping > /dev/null"
start = "brew services start redis"
stop = "brew services stop redis"croft skips compose preflight entirely; croft ui shows just the
declared services.
croft doctor runs each declared service's status command and
reports running / stopped per entry. Use it to validate the
declarations before opening the TUI.
- Container Backends for how compose services interact with the same TUI keymap.
- Configuration Reference.
croft is dual-licensed under MIT or Apache 2.0. Source: github.com/nsrosenqvist/croft. Back to Home.