Configuration¶
Capsula is configured using a capsula.toml file. This page documents all configuration options.
Configuration File Location¶
Capsula looks for capsula.toml in the following order:
- Path specified with
--configflag - Current directory (
./capsula.toml) - Parent directories (walking up the tree)
Tip
Place capsula.toml in your project root so it works from any subdirectory.
Basic Structure¶
[vault]
name = "vault-name"
[[pre-run.hooks]]
id = "hook-type"
# hook configuration...
[[post-run.hooks]]
id = "hook-type"
# hook configuration...
Top-Level Options¶
dotenv (optional)¶
Load environment variables from a .env file.
Relative paths are resolved from the directory containing capsula.toml.
Vault Configuration¶
The [vault] section defines where Capsula stores captured data.
name (required)¶
The vault name. Creates a subdirectory under .capsula/.
Creates: .capsula/ml-experiments/
path (optional)¶
Custom path for the vault. Can be absolute or relative.
Hook Configuration¶
Hooks are configured in two sections: pre-run and post-run.
For the configuration of each hook, refer to its specific documentation.
Pre-Run Hooks¶
Pre-run hooks are executed before your command, in the order listed.
Post-Run Hooks¶
Post-run hooks are executed after your command, in the order listed.
Complete Example¶
dotenv = ".env"
[vault]
name = "research-experiments"
[[pre-run.hooks]]
id = "capture-git-repo"
path = "."
allow_dirty = false
[[pre-run.hooks]]
id = "capture-cwd"
[[pre-run.hooks]]
id = "capture-env"
name = "PATH"
[[pre-run.hooks]]
id = "capture-machine"
[[pre-run.hooks]]
id = "capture-file"
glob = "config.yaml"
mode = "copy"
hash = "sha256"
[[post-run.hooks]]
id = "capture-file"
glob = "results/*.json"
mode = "copy"
[[post-run.hooks]]
id = "notify-slack"
channel = "#experiments"
attachment_globs = ["results/*.png"]
Multiple Configurations¶
You can use different config files for different purposes: