Skip to content

Commit a47c45e

Browse files
Merge pull request #29 from gemini-cli-extensions/non_git_file_selection
Add support for non-git repository through manual file selection prompt
2 parents b519458 + 0a9ba2f commit a47c45e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

commands/security/analyze.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,21 @@ Your first action is to create a `SECURITY_ANALYSIS_TODO.md` file with the follo
1515
You will now begin executing the plan. The following are your precise instructions to start with.
1616
1717
1. **To complete the 'Define the audit scope' task:**
18+
* You **MUST** run the exact command: `git rev-parse --is-inside-work-tree`.
19+
* If the above command succeeds, returning true: then proceed to step 1a.
20+
* If the above command fails, producing a fatal error: then proceed to step 1b.
21+
22+
1a. **To define the audit scope in a git repository**
1823
* You **MUST** run the exact command: `git diff --merge-base origin/HEAD`.
1924
* This is your only method for determining the changed files. Do not use any other commands for this purpose.
2025
* Once the command is executed and you have the list of changed files, you will mark this task as complete.
2126
27+
1b. **To define the audit scope in a non-git folder**
28+
* Let the user know that you were unable to generate an automatic changelist with git, so you **MUST** prompt the user for files to security scan.
29+
* Match the users response to files in the workspace and build a list of files to analyze.
30+
* This is your only method for determining the files to analyze. Do not use any other commands for this purpose.
31+
* Once you have a list of files to analyze you will mark this task as complete.
32+
2233
2. **Immediately after defining the scope, you must refine your plan:**
2334
* You will rewrite the `SECURITY_ANALYSIS_TODO.md` file.
2435
* Out of Scope Files: Files that are primarily used for managing dependencies like lockfiles (e.g., `package-lock.json`, `package.json` `yarn.lock`, `go.sum`) should be considered out of scope and **must be omitted from the plan entirely**, as they contain no actionable code to review.

0 commit comments

Comments
 (0)