Welcome to Code-Guardian! This tutorial will guide you through your first scan and report generation.
- Rust installed (cargo available)
- A codebase to scan (we'll use this repository as an example)
First, let's build the tool:
git clone <repository-url>
cd code-guardian
cargo build --releaseThe binary will be at target/release/code_guardian_cli (or just code-guardian if installed).
Let's scan the current directory for TODO and FIXME comments:
./target/release/code_guardian_cli scan .You should see output like:
Scan completed and saved with ID: 1
Found 3 matches:
src/main.rs:42:5 - TODO: Implement error handling
src/lib.rs:15:1 - FIXME: This function needs optimization
src/utils.rs:8:9 - TODO: Add documentation
Check what scans you've run:
./target/release/code_guardian_cli historyOutput:
Scan History:
ID: 1, Timestamp: 2023-10-06 12:34:56, Path: .
Create a detailed report in different formats:
# Text format (default)
./target/release/code_guardian_cli report 1
# JSON format
./target/release/code_guardian_cli report 1 --format json
# HTML format (save to file)
./target/release/code_guardian_cli report 1 --format html > report.htmlIf you generated an HTML report, open report.html in your browser to see a nicely formatted table of all matches.
- Try scanning a different project
- Learn about advanced usage
- Create custom detectors for your specific needs
- Set up automated scanning
Congratulations! You've completed your first Code-Guardian scan.