Skip to content

feat(cli): add manus-agent cwe subcommand for CWE weakness lookup - #124

Open
manus-use wants to merge 1 commit into
mainfrom
feat/cli-cwe-lookup
Open

feat(cli): add manus-agent cwe subcommand for CWE weakness lookup#124
manus-use wants to merge 1 commit into
mainfrom
feat/cli-cwe-lookup

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

Adds a manus-agent cwe <CWE-ID> CLI subcommand that wires up the existing get_cwe_details Strands tool for direct terminal use.

What was added

  • _build_cwe_parser() — argparse setup: positional CWE-ID, --output {text,json}
  • _run_cwe(argv) — CLI runner with:
    • Input normalisation: accepts CWE-79, cwe-79, or plain 79
    • Text output: formatted CWE ID, MITRE URL, wrapped description
    • JSON output: structured dict with cwe_id, description, url
    • Error handling: invalid input → exit 1, tool errors → exit 1, import failures → exit 1
  • _SUBCOMMANDS registration + main() dispatch wiring
  • README.md: TOC entry + CLI reference section between blast-radius and silent-patches
  • tests/test_cli_cwe.py: 38 tests across 7 suites (parser, text output, JSON output, errors, registry, dispatch, import path)

Usage

manus-agent cwe CWE-79
manus-agent cwe 787
manus-agent cwe CWE-89 --output json | jq .description

Test results

Full suite: 1196 passed (baseline 1158 + 38 new), 0 failures.

Duplicate check

Checked all 50 open PRs (#51, #53, #54, #58, #60, #64, #65, #67, #74–90, #96, #98, #100, #103–123) and 30 merged PRs — no existing open or merged PR adds a cwe CLI subcommand. PR #89 adds tool-level tests for get_cwe_details but does not wire it to the CLI. PR #112 adds a cvss subcommand (different tool, different purpose).

Mock strategy

All tests patch manus_agent.tools.get_cwe_details.get_cwe_details — no real HTTP calls.

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