Configuration
Where shellfirm keeps its settings, how to change them, and what happens when the file is invalid.
shellfirm works with no configuration at all. Every setting has a built-in default, and you only change what you need.
Where settings live
| Platform | Settings file |
|---|---|
| Linux | ~/.config/shellfirm/settings.yaml (or $XDG_CONFIG_HOME/shellfirm/settings.yaml) |
| macOS | ~/Library/Application Support/shellfirm/settings.yaml |
| Windows | %APPDATA%\shellfirm\settings.yaml |
The same directory holds:
checks/: your custom checksaudit.logand its rotatedaudit.log.Nfiles (audit log)- up to three
settings.yaml.bak.<timestamp>backups written byconfig reset .settings.lock: an empty lock file that everyshellfirm config …write holds, so two setters running at once never lose each other's changes. Leave it in place.
shellfirm status prints the exact paths.
Change settings
shellfirm config show # current settings, warnings, and whether a policy applies
shellfirm config challenge Yes # Math | Enter | Yes
shellfirm config severity Medium # all | Info | Low | Medium | High | Critical
shellfirm config approved-notice off # the line after a passed challenge
shellfirm config impact-budget 1000 # ms for the impact measurement (0 = off, at most 5000)
shellfirm config ignore git:reset # stop asking for one check
shellfirm config deny git:force_push # always block one check
shellfirm config # interactive editor (TUI, needs a terminal)
shellfirm config edit # open settings.yaml in $VISUAL / $EDITOR
shellfirm config reset # back up the file, then run the setup questions againEvery setter validates its value. A bad value or an unknown check id exits 2 and changes nothing:
shellfirm: error: unknown check id: 'git:rest'.
Did you mean: git:reset, git:restore_discard_all, git:restore_discard_path, database:firebase_firestore_delete, database:firebase_firestore_delete_all
List all ids with `shellfirm check --list --all`.See the config command reference for every subcommand and the settings reference for every key.
The interactive editor
shellfirm config opens a keyboard-driven editor with tabs for the general settings, groups, escalation, context and custom checks. ? shows the keys. The active tab is shown as [Name] and the selected row is marked with >, so focus is visible without colour. It needs a terminal; without one (or under TERM=dumb) it exits with a hint to use the subcommands instead.
config edit
config edit opens a temporary copy in $VISUAL / $EDITOR (arguments are allowed, for example code -w). If the result does not parse, uses an invalid value, has an unknown key, or names an unknown check id or group, nothing is applied: the original file is left unchanged and the path of your edited copy is printed.
config reset
config reset writes settings.yaml.bak.<timestamp> before changing anything (the three newest backups are kept), then asks the setup questions again. config reset --yes resets to the defaults without questions. Esc or Ctrl-C during a question leaves the file untouched.
The file is sparse
Any key you leave out uses the built-in default, so a default that changes in a later release (a new check group, for example) reaches you automatically. shellfirm only writes what you change:
config groups --disable herokuwritesdisabled_groups: [heroku]and leavesenabled_groupsout of the file.- A key that goes back to its default is removed, not left behind as
[]or a copy of today's default list. - Unknown keys are kept (and reported as unknown).
- Full-line comments are kept. Comments at the end of a line are dropped, and flow lists (
[a, b]) are rewritten as block lists.
shellfirm never rewrites the file on its own; only shellfirm config …, the editor and config edit change it. Values are case-sensitive (challenge: Yes, not yes).
When the file is invalid
An invalid file is reported with its line number and is never overwritten:
shellfirm: error: invalid settings file /home/dev/.config/shellfirm/settings.yaml: challenge: unknown variant `Banana`, expected one of `Enter`, `Math`, `Yes` at line 4 column 12
The file was not changed. Fix it with `shellfirm config edit`, or start over with `shellfirm config reset` (the old file is backed up).- The shell hook,
check,mcpandwrapkeep working. They print a warning and use the built-in default only for the invalid keys; valid keys such as your deny list still apply. shellfirm config <setter>and the editor refuse to change an invalid file. Fix it withconfig editor start over withconfig reset.shellfirm statusshowsINVALID: <reason>next to the settings file.- A
settings.yamlor project.shellfirm.yamlthat is not a regular file (a FIFO, a device) is never read: it is reported like an invalid file (could not read settings file …: not a regular file; a policy is not applied), so no command waits on it. This holds for every command, the agent hook and the shell hook.
A file that parses but has something with no effect (an unknown key such as agent.auto_deny_severty, an unknown check id or group) is applied, and every command warns about it with a "did you mean". An id that is in both ignores_patterns_ids and deny_patterns_ids is denied: the deny wins.
Use another configuration directory
shellfirm check --config-dir /path/to/dir -c 'git reset --hard'
SHELLFIRM_CONFIG_DIR=/path/to/dir shellfirm status--config-dir DIR works for check, status, config, audit, mcp and the agent hooks. SHELLFIRM_CONFIG_DIR=DIR applies to every command. The flag wins over the variable, which wins over the default location. Either must name an existing directory (a missing one is a usage error, exit 2).
The shell hook, the agent hooks and shellfirm mcp never stop on a stale variable. With an invalid SHELLFIRM_CONFIG_DIR they use the default location (or the pinned --config-dir) and print a warning once, so your terminal is never locked and the agent still gets a decision.
Team rules
Your settings are personal. To share rules with everyone in a repository, commit a project policy (.shellfirm.yaml). A policy is enforced: your personal ignores, disabled groups and min_severity cannot weaken it.