This guide explains every configuration key, how STAN finds your config, how file selection works (includes/excludes), and how phase‑scoped CLI defaults (cliDefaults) influence the CLI when flags are omitted.
stan.config.yml|yaml|json
.Minimal YAML example:
stanPath: .stan
includes: []
excludes: []
scripts:
build: npm run build
lint: npm run lint
test: npm run test
typecheck: npm run typecheck
stan.config.yml
, stan.config.yaml
, or stan.config.json
.stanPath
is .stan
) but many operations require an explicit config.Workspace folder for STAN’s operational files.
.stan
<stanPath>/
:
system/
— prompts and docs metadataoutput/
— script outputs and archive.tar
/archive.diff.tar
diff/
— snapshot/history (.archive.snapshot.json
, .snap.state.json
, prior archives)patch/
— canonical patch workspacedist/
— dev build area for internal tasks (not published)Map of script keys to shell commands that STAN executes during stan run
. The combined stdout/stderr of each command is written to <stanPath>/output/<key>.txt
.
Example:
scripts:
build: npm run build
lint: npm run lint
test: npm run test
typecheck: npm run typecheck
Notes:
build
, docs
, lint
).archive
, init
(reserved by STAN).Additive allow‑list of glob patterns. Matches are ADDED back to the base selection even if they would otherwise be excluded by .gitignore
, user excludes, or default denials.
<stanPath>/diff
is always excluded.<stanPath>/output
is excluded unless combine mode includes it for archiving.Use when you want to bring back files that would otherwise be ignored (e.g., docs or generated artifacts you do want to share).
includes:
- '**/*.md'
- 'docs/**'
Deny‑list of glob/prefix patterns applied to the base selection in addition to default denials and .gitignore
.
.git
, node_modules
.<stanPath>/diff
.<stanPath>/output
unless combine mode includes it.excludes:
- '**/.tsbuild/**'
- '**/generated/**'
Tip: Use excludes to reduce archive noise (tool state folders, large generated code) and use includes to bring back specific assets you want the assistant to read.
Retention for snapshot history (stan snap undo|redo|set
). Default: 10
.
maxUndos: 10
Editor command template used to open modified files after a successful stan patch
. The token {file}
expands to a repo‑relative path.
code -g {file}
(VS Code; opens at the first line).webstorm64.exe {file}
cursor -g {file}
patchOpenCommand: 'code -g {file}'
Developer‑mode switch used by STAN’s own repo to detect when local development is happening (affects prompt assembly and preflight nudges). Consumers typically do not set this.
devMode: false
Phase‑scoped defaults used when CLI flags are omitted. Precedence: flags > cliDefaults > built‑ins.
Schema:
cliDefaults:
# root flags
debug: false # -d / -D
boring: false # -b / -B
run:
archive: true # -a / -A; combine implies archive=true
combine: false # -c / -C
keep: false # -k / -K
sequential: false # -q / -Q
# default script selection when neither -s nor -S is provided:
# true => all scripts,
# false => none,
# ["a","b"] => only these keys
scripts: true
patch:
# default patch file when no argument/-f is provided, unless -F/--no-file is used
file: .stan/patch/last.patch
snap:
stash: false # -s / -S
Examples:
cliDefaults:
run:
scripts: true
archive: false
cliDefaults:
run:
sequential: true
patch:
file: .stan/patch/pending.patch
cliDefaults:
snap:
stash: true
STAN selects files in two passes:
.gitignore
semantics, default denials (node_modules
, .git
), user excludes
, and STAN workspace rules.<stanPath>/diff
.<stanPath>/output
unless combine mode is enabled (archives include outputs and then remove them on disk).includes
ADD matched files back into the selection even if excluded by .gitignore
, user excludes, or default denials.Combine mode (stan run -c
) behavior:
<stanPath>/output
(but not the archive files themselves).<stanPath>/diff
and both archive.tar
/archive.diff.tar
.STAN excludes nested sub‑packages by default to reduce noise:
package.json
is treated
as an independent sub‑package and excluded from the base selection.package.json
) is not excluded.To include a specific sub‑package, add an includes
glob. For example:
includes:
- 'packages/app1/**' # re‑include a nested package
cliDefaults
.cliDefaults
, STAN uses built‑ins:
run.archive=true
, run.combine=false
, run.keep=false
, run.sequential=false
, run.scripts=true
patch.file
unsetsnap.stash=false
debug=false
, boring=false
Examples:
# Built-ins: archives enabled
stan run
# With config:
# cliDefaults.run.archive=false
# => No archives unless you pass -a
stan run
stan run -a # force archives this time
cliDefaults:
run:
scripts: ['lint', 'test']
# No -s/-S:
stan run # runs "lint", "test"
# Negated default:
stan run -S # run no scripts (conflicts if -s/-x also provided)
stanPath: .stan
excludes:
- '**/.tsbuild/**'
- '**/generated/**'
includes:
- 'docs/**' # bring docs back even if ignored
- '**/*.md'
scripts:
lint: npm run lint
test: npm run test
maxUndos: 10
patchOpenCommand: 'code -g {file}'
cliDefaults:
run:
scripts: true
archive: true
sequential: false
snap:
stash: false
{
"stanPath": ".stan",
"includes": [],
"excludes": ["**/.tsbuild/**", "**/generated/**"],
"scripts": {
"build": "npm run build",
"lint": "npm run lint",
"test": "npm run test",
"typecheck": "npm run typecheck"
},
"maxUndos": 10,
"patchOpenCommand": "code -g {file}",
"cliDefaults": {
"debug": false,
"boring": false,
"run": {
"archive": true,
"combine": false,
"keep": false,
"sequential": false,
"scripts": true
},
"patch": {
"file": ".stan/patch/last.patch"
},
"snap": {
"stash": false
}
}
}
scripts
deterministic: tests, typecheckers, and linters that always produce stable output are ideal.excludes
to trim large/generated noise and includes
to bring back specific assets you want to share.