Skip to content

Commit 9345a98

Browse files
authored
docs(repo): update trivy repo usage and example (#5049)
1 parent 5d8da70 commit 9345a98

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

docs/docs/references/configuration/cli/trivy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ trivy [global flags] command [flags] target
5151
* [trivy kubernetes](trivy_kubernetes.md) - [EXPERIMENTAL] Scan kubernetes cluster
5252
* [trivy module](trivy_module.md) - Manage modules
5353
* [trivy plugin](trivy_plugin.md) - Manage plugins
54-
* [trivy repository](trivy_repository.md) - Scan a remote repository
54+
* [trivy repository](trivy_repository.md) - Scan a repository
5555
* [trivy rootfs](trivy_rootfs.md) - Scan rootfs
5656
* [trivy sbom](trivy_sbom.md) - Scan SBOM for vulnerabilities
5757
* [trivy server](trivy_server.md) - Server mode

docs/docs/references/configuration/cli/trivy_repository.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
## trivy repository
22

3-
Scan a remote repository
3+
Scan a repository
44

55
```
6-
trivy repository [flags] REPO_URL
6+
trivy repository [flags] (REPO_PATH | REPO_URL)
77
```
88

99
### Examples
1010

1111
```
1212
# Scan your remote git repository
1313
$ trivy repo https://github.com/knqyf263/trivy-ci-test
14+
# Scan your local git repository
15+
$ trivy repo /path/to/your/repository
1416
```
1517

1618
### Options

docs/docs/target/repository.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ It is disabled by default and can be enabled with `--scanners config`.
8686
See [here](../scanner/misconfiguration/index.md) for the detail.
8787

8888
```shell
89-
$ trivy repo --scanners config [YOUR_REPO_URL]
89+
$ trivy repo --scanners config (REPO_PATH | REPO_URL)
9090
```
9191

9292
### Secrets
9393
It is enabled by default.
9494
See [here](../scanner/secret.md) for the detail.
9595

9696
```shell
97-
$ trivy repo [YOUR_REPO_URL]
97+
$ trivy repo (REPO_PATH | REPO_URL)
9898
```
9999

100100
### Licenses
101101
It is disabled by default.
102102
See [here](../scanner/license.md) for the detail.
103103

104104
```shell
105-
$ trivy repo --scanners license [YOUR_REPO_URL]
105+
$ trivy repo --scanners license (REPO_PATH | REPO_URL)
106106
```
107107

108108
## SBOM generation

docs/tutorials/shell/shell-completion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ image -- Scan a container image
5858
kubernetes -- scan kubernetes cluster
5959
module -- Manage modules
6060
plugin -- Manage plugins
61-
repository -- Scan a remote repository
61+
repository -- Scan a repository
6262
rootfs -- Scan rootfs
6363
sbom -- Scan SBOM for vulnerabilities
6464
server -- Server mode

pkg/commands/app.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,14 @@ func NewRepositoryCommand(globalFlags *flag.GlobalFlagGroup) *cobra.Command {
443443
repoFlags.ReportFlagGroup.ExitOnEOL = nil // disable '--exit-on-eol'
444444

445445
cmd := &cobra.Command{
446-
Use: "repository [flags] REPO_URL",
446+
Use: "repository [flags] (REPO_PATH | REPO_URL)",
447447
Aliases: []string{"repo"},
448448
GroupID: groupScanning,
449-
Short: "Scan a remote repository",
449+
Short: "Scan a repository",
450450
Example: ` # Scan your remote git repository
451-
$ trivy repo https://github.com/knqyf263/trivy-ci-test`,
451+
$ trivy repo https://github.com/knqyf263/trivy-ci-test
452+
# Scan your local git repository
453+
$ trivy repo /path/to/your/repository`,
452454
PreRunE: func(cmd *cobra.Command, args []string) error {
453455
if err := repoFlags.Bind(cmd); err != nil {
454456
return xerrors.Errorf("flag bind error: %w", err)

0 commit comments

Comments
 (0)