AIGuardian
Back to Home

Usage

AIGuardian Documentation

Loading update info...
View on GitHub

AIGuardian Usage Guide

This guide provides detailed instructions on how to use AIGuardian effectively for different types of projects.

Basic Usage

Command Line Interface

AIGuardian is primarily used through its command-line interface:

bash
aiguardian [options] [command]

Interactive Mode

When run without arguments, AIGuardian starts in interactive mode:

bash
aiguardian

This will:

  1. 1. Detect your project type
  1. 2. Display available optimization tasks
  1. 3. Allow you to select which tasks to run
  2. Non-Interactive Mode

    To run AIGuardian without prompts:

    bash
    aiguardian --all --yes
    

    Project-Specific Usage

    JavaScript/TypeScript Projects

    For JavaScript or TypeScript projects, AIGuardian offers specialized tasks:

    bash
    

    Convert JavaScript to TypeScript

    aiguardian --tasks js-to-ts

    Optimize npm dependencies

    aiguardian --tasks optimize-npm-deps

    Format code using Prettier rules

    aiguardian --tasks format-code

    Python Projects

    For Python projects:

    bash
    

    Clean __pycache__ directories

    aiguardian --tasks clean-pycache

    Optimize requirements.txt

    aiguardian --tasks optimize-requirements

    Format code using Black

    aiguardian --tasks format-python

    Java Projects

    For Java projects:

    bash
    

    Clean build artifacts

    aiguardian --tasks clean-build

    Optimize Maven dependencies

    aiguardian --tasks optimize-maven-deps

    Format code using Google Java Format

    aiguardian --tasks format-java

    Advanced Usage

    Custom Task Selection

    Run specific tasks by their IDs:

    bash
    aiguardian --tasks clean-temp,format-code,optimize-gitignore
    

    Excluding Tasks

    Run all tasks except specific ones:

    bash
    aiguardian --all --exclude js-to-ts,format-code
    

    Dry Run Mode

    Preview changes without applying them:

    bash
    aiguardian --dry-run
    

    Verbose Output

    Get detailed information during execution:

    bash
    aiguardian --verbose
    

    Custom Configuration

    Use a custom configuration file:

    bash
    aiguardian --config ./my-config.js
    

    Integration with Build Systems

    npm Scripts

    Add AIGuardian to your package.json scripts:

    json
    {
      "scripts": {
        "optimize": "aiguardian --all",
        "format": "aiguardian --tasks format-code",
        "clean": "aiguardian --tasks clean-temp"
      }
    }
    

    CI/CD Integration

    For CI/CD pipelines, use the non-interactive mode:

    bash
    aiguardian --all --yes --no-color
    

    Best Practices

    1. 1. Run in Dry Run Mode First: Always use --dry-run when trying new tasks
    1. 2. Use Version Control: Ensure your code is committed before running AIGuardian
    1. 3. Create Backups: Use the backup feature (--backup) for important projects
    1. 4. Start Small: Begin with non-destructive tasks before using more aggressive optimizations
    1. 5. Customize Configuration: Create a project-specific configuration file for consistent results
    2. Troubleshooting

      If you encounter issues, see the Troubleshooting Guide for solutions to common problems.

      Next Steps

Was this page helpful?