Skip to content

Find the holes before someone else does. A fast, 100% Rust vulnerability scanner: XSS, SQL injection, leaked secrets, dependency CVEs and AI agent setups.

Show mcp and a few examples in --help (#86)

Prashant46ed77eb042f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a452427..e7f0f11 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -93,6 +93,7 @@
- CLI: SARIF rules have a `fullDescription` and a `help` text (the fix, the CWE and OWASP category, and the
link), so a GitHub code scanning alert shows the fix in its side panel. `--list-rules --json` and the MCP
`list_rules` tool include each rule's `fix`.
+- CLI: `safe-anything --help` now shows a few examples, including `safe-anything mcp`, and how to ignore a finding (`safe-anything:ignore` or `.safe-anything-ignore`).
## 1.0.2 (2026-11-23)
diff --git a/src/main.rs b/src/main.rs
index 6f6a0b6..d54101f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -7,10 +7,23 @@ use clap::Parser;
use safe_anything::{Family, Finding, Options, Severity, report};
use serde::{Deserialize, Serialize};
+const AFTER_HELP: &str = "\
+Examples:
+ safe-anything .
+ safe-anything . --offline --fail-on never
+ safe-anything . --sarif > results.sarif
+ safe-anything . --write-baseline baseline.json
+ safe-anything . --baseline baseline.json
+ safe-anything mcp serve scan and list_rules to AI agents over MCP
+
+To ignore a finding, put safe-anything:ignore in a comment on that line or the line above it
+(follow it with rule ids to silence only those), or list paths in .safe-anything-ignore.";
+
#[derive(Parser)]
#[command(
version,
- about = "Find vulnerabilities in any app, and in the AI agent setup that builds it."
+ about = "Find vulnerabilities in any app, and in the AI agent setup that builds it.",
+ after_help = AFTER_HELP
)]
struct Cli {
/// Folder or file to scan
diff --git a/tests/cli.rs b/tests/cli.rs
index 64f5a32..fb01eda 100644
--- a/tests/cli.rs
+++ b/tests/cli.rs
@@ -559,3 +559,12 @@ fn public_env_secret_value_is_redacted() {
}
let _ = std::fs::remove_dir_all(&dir);
}
+
+#[test]
+fn help_shows_mcp_and_how_to_ignore() {
+ let (code, out) = run(&["--help"]);
+ assert_eq!(code, 0);
+ assert!(out.contains("safe-anything mcp"), "{out}");
+ assert!(out.contains("safe-anything:ignore"), "{out}");
+ assert!(out.contains(".safe-anything-ignore"), "{out}");
+}