Issues and PRs welcome — the repo is intentionally small, and every addition earns its place.
Run the same three checks CI runs:
shellcheck statusline.sh scripts/install.sh
shfmt -d -i 4 -ci -sr statusline.sh scripts/install.sh
bats tests/A PR that fails any of them will not merge.
Short, imperative present-tense subject line (≤ 70 chars). Body optional. Reference the issue in the body, not the subject.
Add CLAUDE_STATUSLINE_SHOW_TZ env var
Closes #42.
Do not add AI-attribution trailers (Co-Authored-By: …) to commit messages.
- Single-file distribution is a feature. Keep
statusline.shunder ~500 lines. If a change pushes it meaningfully over, open an issue first to discuss splitting. - Zero runtime dependencies beyond
bash,jq,git,date. Do not add acurl/python/awk-gawk dependency to the runtime path. Installer and CI may use more, script itself may not. - Portable across GNU + BSD
date. Only use format specifiers that exist on both. When in doubt, grep_date_from_epochfor the existing pattern and reuse it. - No private data. No hardcoded paths, emails, organization names, project names. CI greps for common leaks.
- Every new env var:
- Add to the header docstring in
statusline.sh. - Add to the Configuration table in
README.md. - Add a bats test in
tests/.
- Add to the header docstring in
- Every new output segment:
- Add to the "What it shows" table in
README.md. - Add a bats test in
tests/that exercises it end-to-end.
- Add to the "What it shows" table in
Put it in tests/test_statusline.bats. The existing file is a good template. Tests run with NO_COLOR=1 so ANSI escapes don't muddy the assertions.
The script runs on every prompt refresh. We target ≤ 60 ms per render on a modern Linux box.
If you're adding logic in the hot path, benchmark before and after:
PAYLOAD='{"cwd":"/tmp","version":"x","model":{"display_name":"m"}}'
time for i in $(seq 1 30); do printf '%s' "$PAYLOAD" | ./statusline.sh > /dev/null; doneSubshells ($(…)), external commands inside loops, and per-field jq calls are the usual regression sources. Prefer bash builtins and inlined math.