Skip to content

docs: document CLI usage in docs/CLI.md (#512) - #526

Open
AartiKandpal wants to merge 3 commits into
NovaCode37:mainfrom
AartiKandpal:docs/issue-512-cli-documentation
Open

AartiKandpal wants to merge 3 commits into
NovaCode37:mainfrom
AartiKandpal:docs/issue-512-cli-documentation

Conversation

@AartiKandpal

Copy link
Copy Markdown

Fixes #512

Changes Proposed

  • Added comprehensive CLI documentation in docs/CLI.md.
  • Documented flags, options, exit codes, and examples for scan, modules, and watchlist commands.
  • Included expected JSON output structure for skipped modules due to missing API keys.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Thanks for the first pull request here. CI needs a maintainer to approve the run before it starts, so it may sit for a bit before anything happens. pytest tests/ -q passing is the main thing I look at.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 8, 2026

@NovaCode37 NovaCode37 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this reads well, and I checked every flag in it against --help: nothing invented. Three are missing, and #512 asks for every flag --help lists:

  • scan --output / -o: the output file path for --html, --pdf, --graphml and --gexf.
  • watchlist add --interval: hours between re-scans.
  • watchlist add --webhook: where change alerts are posted.

python cli.py scan --help and python cli.py watchlist add --help show the exact wording. Add those and this is ready.

@AartiKandpal

Copy link
Copy Markdown
Author

Updated docs/CLI.md with the missing flags (-o/--output, --interval, --webhook). Ready for re-review!

@NovaCode37 NovaCode37 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but the update did not reach the branch. The last commit here is still from 8 October, and docs/CLI.md has no -o/--output, --interval or --webhook. Could you check that the commit was pushed?

While you are at it, a few things in the file do not match cli.py:

  • Exit codes. 2 is not "vulnerabilities above threshold", the CLI has no threshold. It exits 2 when -m names an unknown module (argparse also uses 2 for bad arguments). 1 is a scan error or Ctrl+C, 0 is success.
  • scan also takes --type/-t (auto-detected if omitted), and the short forms -v and -q for --verbose and --quiet.
  • modules has --json and -t.
  • watchlist rm, pause and resume take the entry id, not the target. list has --json. add takes --type/-t, -m, --interval (hours, default 24) and --webhook.
  • The skipped example. Results are keyed by module name, and the fields are status and status_reason, so it looks like "shodan": {"status": "skipped", "status_reason": "...", "error": null, ...}.
  • With -o and more than one format flag, each file gets its own extension from the base name (-o out --json --html writes out.json and out.html). Worth one line.

@NovaCode37 NovaCode37 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content is right now, thanks. The markdown got lost on the way though, it looks like the text was copied from the rendered page instead of the source:

  • The code block under ### Usage is opened and never closed, so on GitHub everything after it renders as one big code block.
  • The headings (### Options, ### Example, ### Exit Codes, ## modules, ## watchlist and the rest) became plain lines.
  • The language labels turned into stray Bash and JSON lines instead of ```bash and ```json fences.
  • The bullets lost their * and the flags lost their backticks.
  • In the last example the URL became [https://example.com/hook](https://example.com/hook) inside a shell command. It should be just https://example.com/hook.

The easiest fix is to take the previous version of the file from your branch and edit the new facts into it, then check the "Preview" tab on GitHub before pushing.

@AartiKandpal

Copy link
Copy Markdown
Author

@NovaCode37 Fixed the markdown formatting: closed code fences, headings, bullets, backticks on flags, and plain webhook URL. Please take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the CLI in docs/CLI.md

2 participants