Usage
AIGuardian Documentation
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. Detect your project type
- 2. Display available optimization tasks
- 3. Allow you to select which tasks to run
- 1. Run in Dry Run Mode First: Always use
--dry-run
when trying new tasks - 2. Use Version Control: Ensure your code is committed before running AIGuardian
- 3. Create Backups: Use the backup feature (
--backup
) for important projects - 4. Start Small: Begin with non-destructive tasks before using more aggressive optimizations
- 5. Customize Configuration: Create a project-specific configuration file for consistent results
- Project Overview: Learn about AIGuardian's architecture
- Configuration Guide: Customize AIGuardian for your projects
- Command Reference: View all available commands and options
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-tsOptimize npm dependencies
aiguardian --tasks optimize-npm-depsFormat code using Prettier rules
aiguardian --tasks format-code
Python Projects
For Python projects:
bash
Clean __pycache__ directories
aiguardian --tasks clean-pycacheOptimize requirements.txt
aiguardian --tasks optimize-requirementsFormat code using Black
aiguardian --tasks format-python
Java Projects
For Java projects:
bash
Clean build artifacts
aiguardian --tasks clean-buildOptimize Maven dependencies
aiguardian --tasks optimize-maven-depsFormat 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
Troubleshooting
If you encounter issues, see the Troubleshooting Guide for solutions to common problems.
Next Steps
On This Page