Improve osv-scanner --help documentation
- [x] Show all format options under
--format - [x] Add link to web documentation
- [ ] Create a
manpage (possibly using the same source code as the web docs)
This issue has not had any activity for 60 days and will be automatically closed in two weeks
Automatically closing stale issue
Hi! I'm a student in the CodePath AI301 program and I'd like to work on this issue. I'll start exploring the CLI flag definitions this week. Any pointers on where the help text and format options live would be appreciated!
Hi @Niuniu-Li-229, thank you for your interest in contributing!
You can start from the following:
cmd/osv-scanner/scan/source/command.go: scan source (sub)command and flags
cmd/osv-scanner/scan/image/command.go: scan image (sub)command and flags
cmd/osv-scanner/internal/helper/flags.go: Common flags for scan (applicable to both the source and image subcommands above)
cmd/osv-scanner/fix/command.go: The fix command
I think some of the initial low-hanging fruits mentioned in this issue have already been implemented. If you have ideas on further improvements, please start a discussion in this thread and wait for the issue to be assigned before you raise a PR!
Hi, I checked the current help implementation. The --format option already enumerates the reporter formats at runtime via reporter.Format(), and the current snapshots include the available values. The remaining gaps appear to be the web documentation link and a man page. I would be happy to update those, but CONTRIBUTING.md asks contributors to comment and wait for assignment on existing unassigned issues. If this issue is still active, could you assign it to me and confirm the preferred man-page source/generation approach? I will wait for assignment before opening a PR.
Hi! I'd like to help with the remaining --help gaps. As noted in the discussion, --format already lists the reporters, so I'd focus on the flags that still lack descriptions or examples in scan source / scan image, plus updating the snapshots.
Could you assign this to me if it's still wanted? I've signed (or will sign) the Google CLA before opening a PR.
Quick update: while testing locally I found that the root osv-scanner --help renders GLOBAL OPTIONS on a single line (--help, -h show help --version, -v print the version), and --licenses help doesn't mention the SPDX allowlist syntax. I have a small fix ready (template fix + clearer usage + a snapshot test for root --help). For the remaining man-page item: since urfave/cli v3 dropped ToMan, would you be open to adding github.com/urfave/cli-docs/v3 and a scripts//goreleaser step to generate osv-scanner.1? Happy to take either once assigned.
Hi, I would like to work on improving the --help documentation. I use vulnerability scanners daily in application security work, and clear CLI help is the difference between a tool people run correctly and one they misconfigure.
Before I start: is there a preferred scope for a first pass (for example, the top level help and the scan subcommand first), and do you want the improved text kept in the command definitions themselves so it flows into generated docs?
Happy to take direction on scope, then open a PR.
Quick courtesy note: I can see @Sanilas-ai is already actively working through the remaining --help gaps here, so I will step aside rather than duplicate the effort. Happy to pick up a different issue if maintainers want a hand elsewhere. Thanks!