Skip to content

Refactor/cli remove redundant subcommands - #27

Merged
HC-ONLINE merged 6 commits into
mainfrom
refactor/cli-remove-redundant-subcommands
Jul 30, 2026
Merged

Refactor/cli remove redundant subcommands#27
HC-ONLINE merged 6 commits into
mainfrom
refactor/cli-remove-redundant-subcommands

Conversation

@HC-ONLINE

Copy link
Copy Markdown
Owner

Refactor: Eliminate redundant CLI subcommands, promote to direct commands
Description

What

Remove redundant CLI subcommands and promote them to direct commands.
Also fix missing network options in scrape batch and forward them in service.

Why

Multiple commands had a single subcommand that duplicated functionality:

  • analyze urlanalyze
  • attack testattack
  • api runapi
  • quick scanquick

Additionally, scrape batch was missing network options (--headers, --cookies,
--proxy, --user-agent) that scrape url had, and the service wasn't forwarding
them.

Changes

CLI Refactoring

Before After
ciberwebscan analyze url <URL> ciberwebscan analyze <URL>
ciberwebscan attack test <URL> ciberwebscan attack <URL>
ciberwebscan api run ciberwebscan api
ciberwebscan quick scan <URL> ciberwebscan quick <URL>

analyze command

  • Removed url, ssl, fingerprint, cves subcommands → single direct command
  • Inverted flag defaults: --no-ssl--ssl (activate with flag, not disable)
  • Added --ssl-timeout option
  • CVE lookup integrated via --fingerprint --cve (service handles flow automatically)

attack command

  • Removed test, xss, sqli subcommands → single direct command
  • attack <url> --consent --xss replaces attack test <url> --xss

api command

  • Removed run subcommand → direct command
  • api --host 0.0.0.0 replaces api run --host 0.0.0.0

quick command

  • Removed scan subcommand → direct command
  • quick <url> --preset low replaces quick scan <url> --preset low

scrape batch fix

  • Added missing network options: --headers, --cookies, --proxy,
    --user-agent, --check-robots/--no-check-robots, --quiet
  • Service scrape_multiple now forwards proxy, user_agent, check_robots

What was NOT changed

  • scrape url / scrape batch → kept as group (2 distinct subcommands)
  • config → kept (7 subcommands for get/set/reset/etc)
  • completion → kept (3 subcommands for install/show/uninstall)

Files changed

15 files changed

File Description
cli/commands/analyze.py Refactored to direct command, removed 4 subcommands
cli/commands/attack.py Refactored to direct command, removed 3 subcommands
cli/commands/api.py Refactored to direct command, removed 1 subcommand
cli/commands/quick.py Refactored to direct command, removed 1 subcommand
cli/commands/scrape.py Added missing options to batch
cli/commands/__init__.py Updated exports
cli/app.py Register commands with app.command() vs add_typer()
services/scrape_service.py Forward proxy, user_agent, check_robots in scrape_multiple
tests/unit/cli/test_commands.py Removed test_analyze_cves_help, updated test helpers
tests/integration/cli/test_attack_cli.py Updated to use attack <url> without test
AGENTS.md Updated command table and examples
docs/CLI.md Rewritten analyze, attack, api, quick, batch sections
docs/API.md Updated api runapi
README.md Updated examples
Dockerfile Updated CLI entry point

Testing

  • ruff check — all passed
  • pyright — 0 errors, 0 warnings
  • pytest — pending full run

Migration

Users need to update their commands:

# BEFORE → AFTER
ciberwebscan analyze url https://x.com  → ciberwebscan analyze https://x.com
ciberwebscan attack test https://x.com  → ciberwebscan attack https://x.com --consent
ciberwebscan api run                    → ciberwebscan api
ciberwebscan quick scan https://x.com   → ciberwebscan quick https://x.com

@HC-ONLINE
HC-ONLINE merged commit 244c791 into main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant