Refactor/cli remove redundant subcommands - #27
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 batchand forward them in service.Why
Multiple commands had a single subcommand that duplicated functionality:
analyze url→analyzeattack test→attackapi run→apiquick scan→quickAdditionally,
scrape batchwas missing network options (--headers,--cookies,--proxy,--user-agent) thatscrape urlhad, and the service wasn't forwardingthem.
Changes
CLI Refactoring
ciberwebscan analyze url <URL>ciberwebscan analyze <URL>ciberwebscan attack test <URL>ciberwebscan attack <URL>ciberwebscan api runciberwebscan apiciberwebscan quick scan <URL>ciberwebscan quick <URL>analyzecommandurl,ssl,fingerprint,cvessubcommands → single direct command--no-ssl→--ssl(activate with flag, not disable)--ssl-timeoutoption--fingerprint --cve(service handles flow automatically)attackcommandtest,xss,sqlisubcommands → single direct commandattack <url> --consent --xssreplacesattack test <url> --xssapicommandrunsubcommand → direct commandapi --host 0.0.0.0replacesapi run --host 0.0.0.0quickcommandscansubcommand → direct commandquick <url> --preset lowreplacesquick scan <url> --preset lowscrape batchfix--headers,--cookies,--proxy,--user-agent,--check-robots/--no-check-robots,--quietscrape_multiplenow forwardsproxy,user_agent,check_robotsWhat 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
cli/commands/analyze.pycli/commands/attack.pycli/commands/api.pycli/commands/quick.pycli/commands/scrape.pybatchcli/commands/__init__.pycli/app.pyapp.command()vsadd_typer()services/scrape_service.pyproxy,user_agent,check_robotsinscrape_multipletests/unit/cli/test_commands.pytest_analyze_cves_help, updated test helperstests/integration/cli/test_attack_cli.pyattack <url>withouttestAGENTS.mddocs/CLI.mddocs/API.mdapi run→apiREADME.mdDockerfileTesting
ruff check— all passedpyright— 0 errors, 0 warningspytest— pending full runMigration
Users need to update their commands: