Skip to content

Environments and snapshots

An environment is another way of setting a task up in the same project, such as with or without Docker. It can have its own hooks and open_url, which take the place of the project’s, and ports and variables, which are added to the project’s in place of any of the same name. A task is created in one environment, or none, and keeps it.

Environments are edited in the app and kept in projects/<project>.environments.toml, which Swarmed creates readable by you alone, since their variables may hold credentials. swarmed environment <project> lists them.

An agent can propose an environment through Swarmed’s configure tool, and it is saved when you accept the proposal. Swarmed’s tools tell an agent the names of an environment’s variables, never their values.

A snapshot keeps the files git ignores in one task whose setup went well, such as dependencies, build output and .env. A new task of the same environment gets a copy before its setup runs, so setup has less to do. Nothing already in the worktree is overwritten.

Where the data directory and the worktrees share an APFS volume, as they do by default, the copies are clones and take no extra space until changed.

Terminal window
swarmed snapshot save <project> <task>

takes one; there is one per environment. Snapshots sit in folders only you can open, since they may hold .env files.