Skip to content

fix: add shell() helper, fix shell syntax in 12 tool files#125

Open
TerminalGravity wants to merge 4 commits intomainfrom
fix/add-shell-helper-110
Open

fix: add shell() helper, fix shell syntax in 12 tool files#125
TerminalGravity wants to merge 4 commits intomainfrom
fix/add-shell-helper-110

Conversation

@TerminalGravity
Copy link
Collaborator

Summary

Adds src/lib/shell.ts with:

  • shell(cmd) — runs commands via execSync with full shell support (pipes, redirects, ||, &&)
  • shellEscape(s) — safe single-quote wrapping for interpolation

Migrates all 12 tool files that were passing shell syntax to run() (which uses execFileSync without a shell, silently breaking pipes/redirects):

  • verify-completion.ts — tsc, build, cat
  • token-audit.ts — wc, tail, git diff
  • session-handoff.ts — command -v, gh pr list
  • audit-workspace.ts — find | wc
  • clarify-intent.ts — tsc | grep, find | head
  • scope-work.ts — git ls-files | grep
  • enrich-agent-task.ts — git ls-files | grep, head
  • sequence-tasks.ts — git ls-files | head
  • checkpoint.ts — git add && commit
  • sharpen-followup.ts — git status --porcelain (converted to array args)
  • session-health.ts — git diff --stat (converted to array args + JS)
  • what-changed.ts — git diff/log with fallbacks (converted to array args + JS)

Simple git-only commands converted to proper array args. Commands needing shell features use shell().

Builds clean. Closes #110.

Covers LanceDB native binary failures, CLAUDE_PROJECT_DIR config,
vector search not returning results, MCP handshake debugging,
and performance tips. Links from README nav bar.
- examples/.preflight/config.yml: profile, related projects, thresholds, embeddings
- examples/.preflight/triage.yml: strictness, always_check/skip/cross-service keywords
- examples/.preflight/README.md: setup instructions and env var fallback reference
- README.md: link to examples from Configuration Reference section
… tool files

Adds src/lib/shell.ts with shell() (uses execSync with shell) and
shellEscape() for safe interpolation. Migrates all tool files that
were passing shell syntax (pipes, redirects, ||, &&) to run()
(which uses execFileSync without shell) to use shell() instead.

Simple git commands converted to array args where possible.

Fixes #110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widespread shell syntax in run() calls after execFileSync migration

1 participant