Adding Commands
Most commands are defined as TOML in the commands/ directory. See commands/SAMPLE.toml for a documented reference of every supported field.
Steps
- Add the command to the appropriate
commands/*.tomlfile (or create a new one) - If you created a new file, register it in
src/registry.rsviainclude_str! - Add the command name to
HANDLED_CMDSinsrc/handlers/mod.rs - Run
cargo testandcargo clippy -- -D warnings - Run
./generate-docs.shto regenerate documentation - Run
cargo install --path .to update the installed binary
For commands that need custom validation logic, add a Rust handler in src/handlers/ and reference it with handler = "name" in the TOML.
Found a safe command safe-chains should support? Submit an issue.
Reporting vulnerabilities
If you find a command that safe-chains approves but shouldn’t, please open an issue.