feat: add file arguments to check command#147
Merged
Conversation
Deploying archgate-cli with
|
| Latest commit: |
a879aaa
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://73cc2986.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-check-file-flag.archgate-cli.pages.dev |
45fbcc6 to
f40e6a0
Compare
8c516fe to
05d9f84
Compare
Accept file paths as positional arguments to scope rule checks: archgate check src/foo.ts src/bar.ts git diff --name-only | archgate check --json When files are provided, only ADRs whose file patterns match are executed, and scopedFiles is narrowed to the intersection. ADRs with no matching files are skipped entirely. Stdin piping is supported for integration with git and other tools. This enables efficient editor integrations (VS Code, Cursor) and CI pipelines to check only changed files instead of the full codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
05d9f84 to
a879aaa
Compare
This was referenced Mar 23, 2026
Merged
Merged
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.
Summary
archgate checkthat scope rule execution to specific filesfilesglob patterns match are executed; unmatched ADRs are skippedsafePath()security gates for path validationUsage
Motivation
Editor integrations (VS Code, Cursor) need to run
archgate checkon file save. Without file scoping, every save runs all rules against the entire codebase. With file arguments, only relevant ADRs fire andscopedFilesis narrowed to the specified files — significantly faster for large projects.Companion PR: archgate/plugins#34 (VS Code extension with live diagnostics)
Changes
src/commands/check.ts[files...]variadic argument, read stdin when pipedsrc/engine/runner.tsfilesoption, resolve to relative paths, intersect withscopedFiles, skip ADRs with no matchtests/integration/check.test.tsTest plan
archgate check src/foo.ts --jsonreturns only violations forsrc/foo.tsarchgate check src/a.ts src/b.ts --jsonchecks both filesarchgate check docs/readme.md --jsonskips ADRs scoped tosrc/**/*.tsecho "src/foo.ts" | archgate check --jsonworks via stdin pipearchgate check --json(no args) still checks everything🤖 Generated with Claude Code