refactor: consolidate dry-run checks onto isDryRun() helper; fix init command banner#77
Merged
sroussey merged 2 commits intoclaude/add-cli-dry-run-LnTeNfrom Mar 12, 2026
Merged
Conversation
Co-authored-by: sroussey <127349+sroussey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add --dry-run flag to prevent write operations
refactor: consolidate dry-run checks onto isDryRun() helper; fix init command banner
Mar 12, 2026
sroussey
added a commit
that referenced
this pull request
Mar 12, 2026
* feat: wire up --dry-run flag to prevent all writes When --dry-run is passed, the CLI now runs commands normally (fetches, processing) but suppresses all write operations: - Database writes: ReadOnlyTabularStorage wraps real storage, forwarding reads and no-oping puts/deletes/setupDatabase - File downloads: BootstrapDownloadTask logs what it would download and exits early - Cache writes: SecFetchFileOutputCache.saveOutput skips file writes - Init command: shows what config/dirs would be created without writing The SEC_DRY_RUN DI token is set in the preAction hook from the global --dry-run option, and createStorage wraps repositories automatically. runCommand prints a "Dry run" banner when active. https://claude.ai/code/session_01G4XE6pxyLRhiM2wAepVTZj * refactor: consolidate dry-run checks onto isDryRun() helper; fix init command banner (#77) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three files duplicated the
globalServiceRegistry.has(SEC_DRY_RUN) && globalServiceRegistry.get(SEC_DRY_RUN)pattern instead of using the existingisDryRun()helper. Additionally, theinitcommand was skipped in thepreActionhook, soSEC_DRY_RUNwas never registered — causingrunCommand's dry-run banner to be silently suppressed forinit --dry-run.Changes
BootstrapDownloadTask.ts,SecFetchFileOutputCache.ts,createStorage.ts— replace inline registry checks withisDryRun(); remove now-unusedSEC_DRY_RUNtoken importsinit.ts— callglobalServiceRegistry.registerInstance(SEC_DRY_RUN, dryRun)beforerunCommandso the banner renders andisDryRun()behaves correctly throughout the init action💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.