CodeDocs Vault

CLI Reference

Complete documentation for all AIGovHub CLI commands.

Global Options

These options are available for all commands:

aigovhub [OPTIONS] COMMAND [ARGS]
Option Description
--version, -v Show version and exit
--help Show help message and exit
--install-completion Install shell completion
--show-completion Show completion script

Commands

aigovhub scan

Scan a repository to detect AI systems and generate an AI-SBoM artifact.

aigovhub scan [PATH] [OPTIONS]

Arguments

Argument Description Default
PATH Path to repository to scan . (current directory)

Options

Option Short Description Default
--output -o Output file path ./aigovhub.yaml
--format -f Output format (yaml or json) yaml
--confidence -c Minimum confidence threshold (0.0-1.0) 0.7
--llm/--no-llm Enable/disable LLM fallback --llm
--llm-provider LLM provider (anthropic, openai, local) From config
--dry-run -n Preview without writing output false
--verbose Show detailed output false

Examples

# Basic scan of current directory
aigovhub scan .
 
# Scan with custom output location
aigovhub scan /path/to/repo --output reports/compliance.yaml
 
# Scan with higher confidence threshold
aigovhub scan . --confidence 0.9
 
# Fast scan without LLM
aigovhub scan . --no-llm
 
# Preview what would be detected
aigovhub scan . --dry-run --verbose
 
# JSON output for processing
aigovhub scan . --format json --output ai-systems.json
 
# Use specific LLM provider
aigovhub scan . --llm-provider openai

Exit Codes

Code Meaning
0 Success
1 Error during scanning

aigovhub init

Initialize a new aigovhub.yaml configuration file.

aigovhub init [PATH] [OPTIONS]

Arguments

Argument Description Default
PATH Path to initialize . (current directory)

Options

Option Short Description Default
--force -f Overwrite existing file false
--template -t Template to use standard

Templates

Template Description
minimal Bare minimum fields only
standard Common fields with scan config
enterprise Full schema with example AI system

Examples

# Initialize with standard template
aigovhub init
 
# Initialize in specific directory
aigovhub init /path/to/repo
 
# Force overwrite existing file
aigovhub init --force
 
# Use minimal template
aigovhub init --template minimal
 
# Use enterprise template with examples
aigovhub init --template enterprise

Exit Codes

Code Meaning
0 Success
1 File exists (use --force) or other error

aigovhub validate

Validate an aigovhub.yaml file against the schema.

aigovhub validate [PATH] [OPTIONS]

Arguments

Argument Description Default
PATH Path to file or directory . (looks for aigovhub.yaml)

Options

Option Short Description Default
--strict -s Fail on warnings false
--schema-version Validate against specific version Latest

Examples

# Validate aigovhub.yaml in current directory
aigovhub validate
 
# Validate specific file
aigovhub validate reports/compliance.yaml
 
# Strict validation (warnings become errors)
aigovhub validate --strict
 
# Validate against specific schema version
aigovhub validate --schema-version 1.0.0

Exit Codes

Code Meaning
0 Valid
1 Invalid or errors found

Validation Checks

The validator checks:

  1. Schema compliance - Required fields, correct types
  2. Semantic validity - Valid risk categories, confidence ranges
  3. Consistency - No duplicate AI system IDs
  4. Warnings - Empty AI systems list, unknown fields

aigovhub benchmark

Run benchmark evaluation against a labeled dataset.

Note: This command is not yet implemented and will display a placeholder message. It is planned for a future release.

aigovhub benchmark [OPTIONS]

Options

Option Short Description Default
--dataset -d Path to benchmark dataset YAML benchmark/repos.yaml
--output -o Directory for results benchmark/results/
--no-cache Skip cached repository data false

Planned Examples (Not Yet Working)

# Run benchmark with default dataset
aigovhub benchmark
 
# Use custom dataset
aigovhub benchmark --dataset my-dataset.yaml
 
# Force fresh clone of repositories
aigovhub benchmark --no-cache

Shell Completion

AIGovHub CLI supports shell completion for bash, zsh, and fish.

Install Completion

# Detect shell and install
aigovhub --install-completion
 
# Or manually for specific shells
aigovhub --show-completion bash >> ~/.bashrc
aigovhub --show-completion zsh >> ~/.zshrc
aigovhub --show-completion fish >> ~/.config/fish/completions/aigovhub.fish

Using Completion

After installation, restart your shell or source your config:

source ~/.bashrc  # or ~/.zshrc

Now you can use tab completion:

aigovhub sc<TAB>        # completes to "scan"
aigovhub scan --<TAB>   # shows available options

Output Formats

YAML (Default)

Human-readable, suitable for version control:

schema_version: "1.0.0"
generated_at: "2025-01-15T10:30:00Z"
ai_systems:
  - id: "ai-001"
    name: "model"
    type: "ml_model"

JSON

Machine-readable, suitable for processing:

{
  "schema_version": "1.0.0",
  "generated_at": "2025-01-15T10:30:00Z",
  "ai_systems": [
    {
      "id": "ai-001",
      "name": "model",
      "type": "ml_model"
    }
  ]
}

Environment Variables

The CLI respects these environment variables:

Variable Description Default
AIGOVHUB_CONFIDENCE_THRESHOLD Default confidence threshold 0.7
AIGOVHUB_USE_LLM_FALLBACK Enable LLM by default true
AIGOVHUB_LLM_PROVIDER Default LLM provider anthropic
AIGOVHUB_DEFAULT_OUTPUT_FILE Default output filename aigovhub.yaml
ANTHROPIC_API_KEY Anthropic API key -
OPENAI_API_KEY OpenAI API key -

See Configuration for detailed configuration options.