Situs is organized around a few small layers:
cli: command parsing and command dispatch, split by subcommandshell: zsh integration script generationhistory: local history storage, TSV escaping, and age formattingatuin: read-only Atuin DB access, import merging, and sync behaviormatcher: command/cwd matching, candidate ranking, and filterspicker: interactive terminal UI and key handlingi18n: locale resolution and per-locale runtime stringsconfig: config file and environment override resolutiondoctorandstats: diagnostics
The larger layers are directory modules:
src/cli/args.rs,choose.rs,record.rs, andimport.rskeep small flag parsing helpers and subcommand behavior separate from top-level dispatch.src/history/encoding.rsandtime.rskeep storage escaping and age formatting reusable.src/atuin/db.rs,import.rs, andsync.rskeep SQLite access, import dedupe, and auto-sync state independent.src/matcher/candidates.rsandfilters.rsseparate ranking from source/context filtering.src/picker/keymap.rs,keys.rs,input.rs,path.rs,style.rs,width.rs,viewport.rs,session.rs,plain.rs,tui.rs, andclipboard.rskeep terminal input, key decoding, viewport geometry, and command matching separated.src/picker/render/keeps visual line construction split byheader.rs,footer.rs,candidate.rs,inspect.rs, and shared helpers.src/i18n/*.rsstores one locale table per file, withmod.rsowningLocale,I18n, andMessageKey.
The repository uses develop for day-to-day development and main for stable
release history.
- External contributors open pull requests from forks into
develop. - Collaborators with write access create feature branches and open pull
requests into
develop. - Maintainers promote
developtomainwith a release pull request. - Direct pushes, force pushes, and branch deletions should be blocked on both
developandmainthrough GitHub rulesets or branch protection.
GitHub Actions must run for pull requests targeting protected branches and for
pushes to both develop and main, so required status checks match the active
branch strategy.
Run the full verification matrix (formatting, clippy, unit/acceptance tests, doc translations, and PTY smoke tests) locally:
scripts/verify-all.shYou can also run individual steps:
cargo fmt -- --check
cargo test --locked
cargo clippy --locked --all-targets -- -D warnings
cargo build --locked
cargo package --locked --no-verify
scripts/verify-doc-i18n.shRun the RustSec advisory audit locally when changing dependencies:
cargo install cargo-audit --locked
cargo auditGitHub Actions also runs the security audit when Cargo.toml, Cargo.lock, or
the security workflow changes, plus a weekly scheduled scan for newly published
advisories.
Run the zsh/PTY checks for picker behavior:
scripts/verify-zsh-widget.sh
scripts/verify-picker-features.sh
scripts/verify-picker-modes.shverify-picker-features.sh covers deeper picker keys such as failed-history,
help, source/context filters, delete, and copy. verify-picker-modes.sh runs
the widget and feature smoke tests in both inline and fullscreen modes. PTY
checks retry up to three times by default because terminal allocation can be
briefly flaky in CI or sandboxed environments. Override with
SITUS_VERIFY_RETRIES=1 when debugging the first failure.
README screenshots live in docs/assets/screenshots/.
Regenerate them with:
scripts/capture-screenshots.jsThe script runs the real picker in an expect PTY, not a hand-painted fixture. It
uses fixtures/screenshot-history.tsv as mock command history, rewrites the
relative timestamps at runtime, and retries each screenshot up to three times.
Override with SITUS_SCREENSHOT_RETRIES=1 when debugging.
It passes SITUS_TTY=$(tty) to the spawned process so Situs opens the PTY
slave directly instead of relying on /dev/tty, which can be blocked in
sandboxed environments.
The screenshot fixture writer lives in scripts/lib/history-fixture.js.
Acceptance-test TSV fixture helpers live in tests/support/history.rs.
For polished demo videos, VHS is the
best optional tool to add later: it records terminal sessions from .tape
files and supports PNG screenshots. Keep it optional for contributors because
the expect-based PTY checks are still the source of truth for shell behavior.
asciinema plus
agg is also good for shareable
recordings, but it is less direct for asserting zsh widget behavior.
Optional VHS workflow:
brew install vhs
vhs new demo.tape
vhs demo.tapeVHS also needs ttyd and ffmpeg on PATH; the Homebrew package is the
simplest route on macOS.
Only use VHS outputs as extra demos. README screenshots should continue to come
from scripts/capture-screenshots.js so they use the same mock history and
retry behavior as local verification.
- Define the user-visible behavior.
- Add or update focused unit tests.
- Add acceptance or PTY coverage if shell behavior changes.
- Implement the smallest change that satisfies the behavior.
- Update README, localized READMEs, and docs.
- Run the verification matrix.
Interactive picker input should not reread history on every key press. Load records once, then rematch in memory.
Avoid formatting expensive path display values repeatedly when the candidate set has not changed. The current code already caches shared path display work in the render path where practical.
Large-history changes should include a smoke test or benchmark-style check that uses thousands of records.
Before a public release:
- update
CHANGELOG.md - run the full verification matrix
- confirm GitHub Actions are green on Linux and macOS
- regenerate screenshots when picker visuals changed
- check
cargo package --locked --no-verifylocally if publishing to crates.io - confirm README install URLs match the public repository
- create a GitHub release with a short changelog
- attach binaries only after there is a reproducible release workflow