Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/manus_agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ def _run_variants(argv: list[str]) -> int:
"poc-search",
"changelog",
"blast-radius",
"cve-timeline",
}


Expand Down Expand Up @@ -1935,6 +1936,53 @@ def _run_blast_radius(argv: list[str]) -> int:
return 0


# ---------------------------------------------------------------------------
# cve-timeline subcommand
# ---------------------------------------------------------------------------


def _build_cve_timeline_parser() -> argparse.ArgumentParser:
p = argparse.ArgumentParser(
prog="manus-agent cve-timeline",
description=(
"Reconstruct the full event timeline for a CVE: NVD publish date, "
"EPSS history with spike detection, CISA KEV addition date, and "
"patch/advisory dates. Useful for understanding how quickly a "
"vulnerability was weaponised and fixed."
),
add_help=True,
)
p.add_argument("cve_id", metavar="CVE-ID", help="CVE identifier, e.g. CVE-2021-44228")
p.add_argument(
"--output",
choices=["text", "json"],
default="text",
help="Output format (default: text)",
)
return p


def _run_cve_timeline(argv: list[str]) -> int:

from manus_agent.tools.cve_timeline import (
build_timeline,
format_timeline_json,
format_timeline_text,
)

parser = _build_cve_timeline_parser()
args = parser.parse_args(argv)

result = build_timeline(args.cve_id)

if args.output == "json":
print(format_timeline_json(result))
else:
print(format_timeline_text(result))

return 1 if "error" in result else 0


def _build_run_parser() -> argparse.ArgumentParser:
"""Build the top-level run/interactive parser."""
parser = argparse.ArgumentParser(
Expand Down Expand Up @@ -2269,6 +2317,10 @@ def main() -> None:
idx = argv.index("blast-radius")
sys.exit(_run_blast_radius(argv[idx + 1 :]))

if first_positional == "cve-timeline":
idx = argv.index("cve-timeline")
sys.exit(_run_cve_timeline(argv[idx + 1 :]))

if first_positional == "discover":
idx = argv.index("discover")
discover_args = _build_discover_parser().parse_args(argv[idx + 1 :])
Expand Down
Loading
Loading