@@ -48,18 +48,113 @@ move zeropath.exe "C:\Windows\System32\"
4848## Usage
4949
5050### Authentication
51+ First, authenticate with your ZeroPath API credentials:
5152``` bash
5253zeropath auth < clientId> < clientSecret>
5354```
5455
5556### Scanning
57+
58+ #### Local Directory Scan (with SARIF output)
59+ Scan a local directory and generate a SARIF report:
60+ ``` bash
61+ zeropath scan < directory> < outputFile.sarif>
62+ ```
63+
64+ #### Repository Scan (using existing repository)
65+ Scan an already-configured repository by ID:
66+ ``` bash
67+ zeropath scan --repository-id < repositoryId>
68+
69+ # Scan a specific branch
70+ zeropath scan --repository-id < repositoryId> --branch < branchName>
71+ ```
72+
73+ #### Repository Scan (by URL)
74+ Scan a repository by its URL:
75+ ``` bash
76+ # GitHub repository
77+ zeropath scan --repository-url https://github.com/owner/repo --vcs github
78+
79+ # GitLab repository
80+ zeropath scan --repository-url https://gitlab.com/owner/repo --vcs gitlab
81+
82+ # Bitbucket repository
83+ zeropath scan --repository-url https://bitbucket.org/owner/repo --vcs bitbucket
84+
85+ # Generic Git repository
86+ zeropath scan --repository-url https://git.example.com/repo --vcs generic
87+ ```
88+
89+ #### CI/CD Integration
90+ For continuous integration pipelines, use the ` --ci ` flag to run PR/merge request scans:
91+ ``` bash
92+ # Basic CI scan
93+ zeropath scan --repository-id < repositoryId> --ci
94+
95+ # CI scan with explicit PR branches
96+ zeropath scan --repository-id < repositoryId> --ci \
97+ --pr-branch feature/new-feature \
98+ --pr-target main
99+
100+ # CI scan by repository URL
101+ zeropath scan --repository-url https://github.com/owner/repo --vcs github --ci \
102+ --pr-branch feature/new-feature \
103+ --pr-target main
104+ ```
105+
106+ ** CI Mode Exit Codes:**
107+ - ** 0** : No vulnerabilities found
108+ - ** 1** : Vulnerabilities detected (fails CI pipeline)
109+
110+ ### Command Options
111+
112+ #### ` zeropath scan ` Options
113+
114+ | Option | Description |
115+ | --------| -------------|
116+ | ` --repository-id <id> ` | Scan an existing repository by ID |
117+ | ` --repository-url <url> ` | Scan a repository by URL (requires ` --vcs ` ) |
118+ | ` --vcs <provider> ` | VCS provider: ` github ` , ` gitlab ` , ` bitbucket ` , or ` generic ` |
119+ | ` --branch <name> ` | Branch to scan (for regular scans) |
120+ | ` --ci ` | Run a CI/PR scan instead of a full scan |
121+ | ` --pr-branch <name> ` | Source/feature branch for CI scans |
122+ | ` --pr-target <name> ` | Target/base branch for CI scans |
123+
124+ ### Examples
125+
56126``` bash
57- zeropath scan < directory> < outputFile>
127+ # Scan local code and generate SARIF report
128+ zeropath scan ./my-project report.sarif
129+
130+ # Scan main branch of a repository
131+ zeropath scan --repository-id abc-123-def --branch main
132+
133+ # CI pipeline scanning a pull request
134+ zeropath scan --repository-id abc-123-def --ci \
135+ --pr-branch feature/security-fix \
136+ --pr-target main
137+
138+ # Scan a GitHub repository directly
139+ zeropath scan --repository-url https://github.com/myorg/myapp --vcs github
140+
141+ # Scan a specific branch of a GitLab repository
142+ zeropath scan --repository-url https://gitlab.com/myorg/myapp --vcs gitlab --branch develop
58143```
59144
145+ ### Features
146+
147+ - ** Real-time scanning** : All scans wait for completion and show progress
148+ - ** CI/CD ready** : Exit codes for pipeline integration (1 for vulnerabilities, 0 for clean)
149+ - ** Multiple VCS support** : GitHub, GitLab, Bitbucket, and generic Git repositories
150+ - ** Branch-aware** : Scan specific branches or PR/merge requests
151+ - ** SARIF output** : Industry-standard format for local scans
152+ - ** Vulnerability reporting** : Detailed breakdown by severity in CI mode
153+
60154### Help
61155``` bash
62156zeropath --help
157+ zeropath scan --help
63158```
64159
65160## Support
@@ -68,4 +163,4 @@ zeropath --help
68163- [ Issue Tracker] ( https://github.com/ZeroPathAI/zeropath-cli/issues )
69164
70165## License
71- Copyright © 2024 ZeroPath Corp. All rights reserved.
166+ Copyright © 2025 ZeroPath Corp. All rights reserved.
0 commit comments