CipherShift365 Compass CLI
Package: CipherShift365.Compass
Target: .NET 9 / .NET 10 (Global Tool)
Role: Command-line interface for PQC discovery scanning, incremental diffing, and report generation. Designed for local development, CI/CD pipelines, and Azure DevOps integration.
Table of Contents
- What It Does
- Why It's Needed (Value Proposition)
- Installation
- How to Run / Use
- User Manual
- Developer Manual
- Code Examples
- API Reference (CLI)
- Configuration Options
What It Does
Compass is the primary end-user tool for the CipherShift365 platform. It wraps the Core.Runtime and Core.Analysis libraries into a CLI global tool with three subcommands:
scan— Discovers cryptographic usage in a .NET project, classifies quantum risk, generates a CycloneDX 1.6 CBOM, and optionally produces a migration plan. Outputs in text, JSON, HTML, or Markdown.diff— Compares a current scan against a prior CBOM file. Reports new findings, resolved findings, and changed findings (risk level changes, confidence changes, algorithm changes). Returns exit code 1 if new or worsened findings are detected.report— Reads an existing CBOM file and renders it in text, JSON, HTML, or Markdown. Useful for offline viewing and documentation generation.
Architecture
cipher-shift compass <verb> [options]
cipher-shift compass scan <project-path> [options]
cipher-shift compass diff <project-path> --prior <cbom-path>
cipher-shift compass report <cbom-path> [options]
The tool initializes a full pipeline (DiscoveryPipeline) on each scan, wiring together InMemoryKnowledgeBase, IdentityService, RiskModel, PolicyEngine, AnalysisEngine, PlanPrioritizer, and EffortEstimator.
Why It's Needed
Security teams and developers need a frictionless way to integrate cryptographic discovery into their workflow. Compass provides:
- Zero-config startup —
dotnet tool installand you're scanning. - CI/CD native — Exit codes (0=safe, 1=violations, 2=error) integrate with GitHub Actions, Azure Pipelines, and any shell-based CI system.
- Multiple output formats — Text for terminals, JSON for machines, HTML for dashboards, Markdown for documentation.
- Incremental diffs — Compare scans over time to track migration progress.
- Migration plans — Prioritized, effort-estimated roadmaps for PQC adoption.
Value Showcase
| Capability | Value |
|---|---|
scan command |
One command discovers all crypto in a .NET project in seconds |
| Exit codes | 0, 1, 2 map directly to CI pass/fail/error |
| JSON output | Machine-readable for dashboard ingestion and API integrations |
| HTML reports | Shareable, self-contained reports with dark mode support |
| Incremental diff | Track progress: how many issues were resolved? what's new? |
| Baseline-aware policy | Gate merges on new crypto vulnerabilities |
| Migration plan | Prioritized list with person-day estimates |
Installation
Install as a .NET global tool:
dotnet tool install --global CipherShift365.Compass
To update:
dotnet tool update --global CipherShift365.Compass
Verify installation:
cipher-shift --help
How to Run / Use
Quick Start
# Scan a project — text output to terminal
cipher-shift compass scan ./src/MyApp
# Scan with HTML report
cipher-shift compass scan ./src/MyApp -f html -o report.html
# Scan with JSON output (for scripts)
cipher-shift compass scan ./src/MyApp -f json
# Scan with migration plan
cipher-shift compass scan ./src/MyApp -p
# Diff against a prior scan
cipher-shift compass diff ./src/MyApp --prior baseline-2026-q1.cbom.json
# Generate a report from a CBOM
cipher-shift compass report scan-output.cbom.json -f md
User Manual
scan Command
cipher-shift compass scan <project-path> [options]
| Option | Short | Description |
|---|---|---|
--output <path> |
-o |
Write report to a file instead of stdout |
--format <fmt> |
-f |
Output format: text, json, html, md (default: text) |
--baseline <path> |
-b |
Baseline CBOM for incremental comparison |
--plan |
-p |
Show migration plan with urgency and effort estimates |
Exit codes:
0— scan successful, all findings quantum-safe (no policy violations)1— scan successful, but violations found (at least one non-QuantumSafe finding)2— scan failed (invalid path, analysis error, exception)
Text Output Example:
Scanning: ./src/MyApp
=== CipherShift365 Compass Analysis ===
Project: ./src/MyApp
Duration: 2.34s
Score: 0.85
Findings: 12
QuantumBroken: 4
QuantumVulnerable: 3
Mitigable: 2
QuantumSafe: 3
[QuantumBroken ] RSA Signature AuthService.cs:42
[QuantumBroken ] ECDSA Signature TokenValidator.cs:100
[QuantumVulnerable ] AES-128 Symmetric Storage.cs:15
=== Migration Plan (9 items, 34 person-days) ===
[Critical ] RSA → ML-DSA-65 (5d)
[High ] ECDSA → ML-DSA-65 (4d)
JSON Output:
{
"Success": true,
"ProjectPath": "./src/MyApp",
"FindingCount": 12,
"QuantumBroken": 4,
"QuantumVulnerable": 3,
"SystemScore": "0.85",
"PlanItems": 9,
"TotalEffortDays": 34,
"Findings": [
{
"Algorithm": "RSA",
"Role": "Signature",
"Risk": "QuantumBroken",
"Confidence": "High",
"Location": "AuthService.cs",
"Line": 42
}
],
"Plan": [
{
"Algorithm": "RSA",
"Target": "ML-DSA-65",
"Urgency": "Critical",
"EffortDays": 5
}
]
}
diff Command
cipher-shift compass diff <project-path> --prior <cbom-path>
Compares the current state of project-path against a previously generated CBOM.
| Option | Description |
|---|---|
--prior <path> |
Path to a prior CBOM JSON file (required) |
Exit codes:
0— no new findings (all existing findings unchanged or resolved)1— new findings detected (policy violation)2— error (scan failed or prior CBOM unreadable)
Output:
=== CipherShift365 Incremental Diff ===
Incremental diff: 2 new, 1 resolved, 3 changed, 5 unchanged.
[+] New RSA New finding: RSA at AuthManager.cs
[+] New ECDSA New finding: ECDSA at TokenService.cs
[✓] Resolved MD5 Resolved: MD5 at LegacyHasher.cs
[~] Changed AES Risk: QuantumVulnerable → QuantumSafe
[~] Changed SHA-256 Algorithm: SHA-256 → SHA-512
report Command
cipher-shift compass report <cbom-path> [options]
Generates a static report from an existing CBOM file.
| Option | Short | Description |
|---|---|---|
--format <fmt> |
-f |
Format: html (default), md, text, json |
--output <path> |
-o |
Write to file instead of stdout |
Output Formats
text — Human-readable summary. Best for terminal use, CI logs, and quick checks.
json — Machine-readable object. Suitable for ingestion by dashboards, APIs, and scripting. Includes the full findings list and plan items.
html — Self-contained HTML document with embedded CSS. Features:
- Dark mode support via
prefers-color-scheme - Accessibility: ARIA labels, skip links, semantic landmarks
- Color-coded badges: red (broken), orange (vulnerable), yellow (mitigable), green (safe)
- Nav menu, summary grid, findings table, migration plan table
- Responsive layout with CSS Grid
md — GitHub-flavored Markdown. Suitable for check-in to repos, PR descriptions, wikis, and Confluence.
CI Integration
GitHub Actions
The Compass tool ships a GitHub Action at .github/actions/ciphershift365-scan/action.yml:
- name: CipherShift365 PQC Scan
uses: CipherShift365/compass-action@v1
with:
project-path: './src'
baseline: './cbom/baseline-2026-q1.cbom.json'
format: 'html'
output: 'pqc-report.html'
fail-on-violation: 'true'
Manual CI step:
- name: Install Compass
run: dotnet tool install --global CipherShift365.Compass
- name: Run PQC Scan
run: cipher-shift compass scan ./src -f html -o pqc-report.html
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: ciphershift-report
path: pqc-report.html
Azure DevOps
The tool ships an Azure DevOps task extension at Ci/AzureDevOps/task.json. Configure in azure-pipelines.yml:
- task: CipherShift365CompassScan@1
inputs:
projectPath: '$(Build.SourcesDirectory)/src'
format: 'html'
output: '$(Build.ArtifactStagingDirectory)/pqc-report.html'
failOnViolation: true
Generic CI
For any CI system that reads exit codes:
# Fail the build on violations
cipher-shift compass scan ./src --format json || exit 1
# Report only, always pass
cipher-shift compass scan ./src --format html -o /tmp/report.html || true
Developer Manual
Project Structure
CipherShift365.Compass
├── Program.cs # CLI entry point, argument parsing, command dispatch
├── Diff/
│ ├── IncrementalDiffEngine.cs # Prior vs. current finding comparison
│ └── DiffResult.cs # FindingDiff, IncrementalDiffResult, DiffStatus
├── Reports/
│ ├── HtmlReportGenerator.cs # Self-contained HTML report builder
│ └── MarkdownReportGenerator.cs # GFM report builder
├── Ci/
│ ├── GitHub/
│ │ └── action.yml # GitHub Action definition
│ └── AzureDevOps/
│ └── task.json # Azure DevOps task extension
└── CipherShift365.Compass.csproj
Entry Point
Program.Main is the entry point. It dispatches to:
Main(args)
├─► ScanAsync(args) — for "scan" verb
├─► DiffAsync(args) — for "diff" verb
└─► ReportAsync(args) — for "report" verb
Pipeline Creation
CreatePipeline() is the factory method that wires up all services:
private static (IKnowledgeBase, IIdentityService, IRiskModel,
IPolicyEngine, IAnalysisEngine) CreatePipeline()
{
var kb = new InMemoryKnowledgeBase(new KbVersion(1, 0, 0), new[]
{
new KbEntry("RSA", CryptoRole.Signature, RiskLevel.QuantumBroken, ...),
new KbEntry("ECDSA", CryptoRole.Signature, RiskLevel.QuantumBroken, ...),
new KbEntry("ECDH", CryptoRole.KeyExchange, RiskLevel.QuantumBroken, ...),
new KbEntry("AES", CryptoRole.Symmetric, RiskLevel.QuantumVulnerable, ...),
new KbEntry("SHA-256", CryptoRole.Hash, RiskLevel.Mitigable, ...),
});
// ...wire everything
}
To use a custom or external knowledge base, modify this method to load from a signed KB package, a database, or an API.
Incremental Diff Engine
IncrementalDiffEngine compares two IReadOnlyList<Finding> collections by LocationalId:
- Findings in current but not prior →
New - Findings in prior but not current →
Resolved - Findings in both but with changed Risk/Confidence/Algorithm →
Changed - Findings in both and identical →
Unchanged
Tracked changes: risk level, confidence level, algorithm name. Not tracked: location changes (different LocationalId = different identity by definition).
Report Generators
Both report generators share the same structure:
- Header: project name, date, score, plan summary
- Summary table: metrics with counts
- Findings table: per-finding details ordered by risk severity
- Migration plan table (if applicable): urgency, algorithm, target, effort, rationale
The HTML generator includes a dark-mode aware stylesheet and ARIA accessibility attributes. The Markdown generator produces GitHub Flavored Markdown with pipe tables.
Building Locally
cd src/Compass/CipherShift365.Compass
dotnet build
dotnet pack
dotnet tool install --global --add-source ./nupkg CipherShift365.Compass
Code Examples
Scripting with JSON Output
# PowerShell: scan and parse JSON
$json = cipher-shift compass scan ./src -f json | ConvertFrom-Json
json.Findings | Where-Object Risk -eq "QuantumBroken"
Write-Host "Broken algorithms: broken.Count)"
if ($json.SystemScore -gt 0.5) {
Write-Warning "High risk score: json.SystemScore)"
}
# Bash: scan and extract score
SCORE=$(cipher-shift compass scan ./src -f json | jq '.SystemScore')
echo "System Score: $SCORE"
CI Gate With Baseline
#!/bin/bash
# Run scan with baseline; fail on new violations
cipher-shift compass scan ./src \
--baseline baseline.cbom.json \
--format html \
--output pqc-report.html
EXIT_CODE=$?
if [ $EXIT_CODE -eq 1 ]; then
echo "::warning::New PQC violations detected. See pqc-report.html."
elif [ $EXIT_CODE -eq 2 ]; then
echo "::error::Scan failed."
fi
exit $EXIT_CODE
Establishing a Baseline
# First scan — accept current state as baseline
cipher-shift compass scan ./src -o baseline.cbom.json -f json
# Later: diff against the baseline
cipher-shift compass diff ./src --prior baseline.cbom.json
Generating Reports From Prior Scans
# Generate HTML from a stored CBOM
cipher-shift compass report scan-2026-01-15.cbom.json -f html -o archive.html
# Generate Markdown for a wiki
cipher-shift compass report scan-2026-01-15.cbom.json -f md -o wiki-report.md
API Reference
CLI Syntax
cipher-shift compass <verb> [options] [--help]
Verbs:
scan <project-path> [-o|--output <path>] [-f|--format <fmt>]
[-b|--baseline <path>] [-p|--plan]
diff <project-path> --prior <cbom-path>
report <cbom-path> [-f|--format <fmt>] [-o|--output <path>]
Exit Codes
| Code | Constant | Meaning |
|---|---|---|
| 0 | ExitSuccess |
Scan completed, all findings quantum-safe |
| 1 | ExitPolicyViolation |
Scan completed, policy violations found |
| 2 | ExitError |
Scan failed (invalid path, unreadable CBOM, exception) |
Format Options
| Value | Output |
|---|---|
text |
Human-readable terminal summary (default for scan) |
json |
Machine-readable JSON with indent |
html |
Self-contained HTML document (default for report) |
md / markdown |
GitHub Flavored Markdown |
Report Sections
All report formats include:
| Section | Description |
|---|---|
| Header | Project path, scan date, system score |
| Summary | Metrics table: findings by risk tier, plan item count, total effort |
| Findings | Per-finding table: algorithm, role, risk, confidence, location, PQC target |
| Migration Plan | Per-item table: urgency, algorithm, target, effort, rationale |
Help
cipher-shift --help
Output:
cipher-shift — CipherShift365 PQC Discovery CLI
Usage:
cipher-shift compass scan <project-path> [options]
cipher-shift compass diff <project-path> --prior <cbom-path>
cipher-shift compass report <cbom-path> [options]
Scan Options:
-o, --output <path> Write report to file
-f, --format <fmt> Output format: text, json, html, md (default: text)
-b, --baseline <path> Baseline CBOM for policy comparison
-p, --plan Show migration plan
Examples:
cipher-shift compass scan ./src -f html -o report.html
cipher-shift compass diff ./src --prior baseline.cbom.json
cipher-shift compass report baseline.cbom.json -f md
Exit Codes:
0 Success, policy compliant
1 Policy violations found
2 Error (scan failed, invalid input)
Configuration Options
Built-in Knowledge Base
Compass ships with a minimal built-in KB containing five entries:
| Algorithm | Role | Risk | Recommendation |
|---|---|---|---|
| RSA | Signature | QuantumBroken | ML-DSA-65 |
| ECDSA | Signature | QuantumBroken | ML-DSA-65 |
| ECDH | KeyExchange | QuantumBroken | ML-KEM-768 |
| AES | Symmetric | QuantumVulnerable | AES-256-GCM |
| SHA-256 | Hash | Mitigable | — |
For any algorithm not in the KB, the RiskModel applies fallback heuristics. To use a richer KB, modify Program.CreatePipeline() or load from a signed KB package at startup.
Baseline Files
Baselines are stored as standard CBOM JSON files. Any scan output (with -f json -o) can serve as a baseline for future diff or baseline-aware scan invocations.
Report Destination
- If
--output/-ois provided, the report is written to the specified file and a confirmation message is printed to stdout. - If omitted, the report is printed to stdout directly.
Generated for CipherShift365 Compass. Part of the CipherShift365 PQC Readiness Platform.