Skip to content

Add --watch flag to re-scan on file changes #119

Description

@lonerthefirst3-sudo

Summary

Add a --watch flag to the scan subcommand that keeps the process alive and re-runs the scan whenever a .rs file under the scanned path is modified.

Proposed UX

soroban-guard scan ./src --watch

The process should:

  1. Run an initial scan and print results as normal.
  2. Watch for file-system events using the notify crate.
  3. On any .rs file change under the path, re-run the full scan and reprint results (with a timestamp header).
  4. Exit on Ctrl-C.

Implementation hints

  • Add notify to crates/cli/Cargo.toml as an optional or default dependency
  • Gate the watch loop behind the --watch flag in Commands::Scan
  • Clear the terminal before each re-scan (optional, but improves UX)
  • Respect existing --exclude patterns during watch re-scans

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions