Configuration
AIGuardian Documentation
Loading update info...
View on GitHubConfiguration Guide
AIGuardian can be customized to fit your specific project needs through configuration files and command-line options. This guide explains all available configuration options.
Configuration File
AIGuardian looks for configuration in the following locations (in order of precedence):
- 1. Custom path specified with
--config
option
- 2.
.aiguardianrc.js
or.aiguardianrc.json
in the current directory
- 3.
aiguardian.config.js
in the current directory
- 4.
.aiguardianrc.js
or.aiguardianrc.json
in the user's home directory
Configuration Format
JavaScript Format (Recommended)
javascript
// aiguardian.config.js
module.exports = {
projectType: 'auto', // or 'javascript', 'typescript', 'python', 'java'
tasks: {
include: ['clean-temp', 'format-code'],
exclude: ['js-to-ts'],
},
backup: {
enabled: true,
directory: './backups',
maxBackups: 5,
},
ignore: ['/.min.js', '/vendor/*'],
include: [],
concurrency: 4,
formatters: {
javascript: {
semicolons: true,
tabWidth: 2,
singleQuote: true,
},
python: {
lineLength: 88,
},
},
};
JSON Format
json
// .aiguardianrc.json
{
"projectType": "auto",
"tasks": {
"include": ["clean-temp", "format-code"],
"exclude": ["js-to-ts"]
},
"backup": {
"enabled": true,
"directory": "./backups",
"maxBackups": 5
},
"ignore": ["/.min.js", "/vendor/*"],
"include": [],
"concurrency": 4,
"formatters": {
"javascript": {
"semicolons": true,
"tabWidth": 2,
"singleQuote": true
},
"python": {
"lineLength": 88
}
}
}
Configuration Options
Project Options
Option | Description | Default | ||||
---|---|---|---|---|---|---|
projectType | Project type or 'auto' for detection | 'auto' | ||||
rootDir | Project root directory | Current directory | Task Options | Option | Description | Default |
-------- | ------------- | --------- | ||||
tasks.include | Array of task IDs to include | [] (all tasks) | ||||
tasks.exclude | Array of task IDs to exclude | [] (no exclusions) | ||||
tasks.order | Custom execution order for tasks | null (default order) | Backup Options | Option | Description | Default |
-------- | ------------- | --------- | ||||
backup.enabled | Enable/disable backups | true | ||||
backup.directory | Directory for backups | './aiguardian-backups' | ||||
backup.maxBackups | Maximum number of backups to keep | 5 | ||||
backup.compressionLevel | Compression level (0-9) | 6 | File Selection Options | Option | Description | Default |
-------- | ------------- | --------- | ||||
ignore | Patterns to ignore (in addition to .gitignore) | [] | ||||
include | Patterns to force include | [] | Performance Options | Option | Description | Default |
-------- | ------------- | --------- | ||||
concurrency | Maximum number of concurrent tasks | 4 |
timeout
| Task timeout in milliseconds | 60000
|Formatter Options
Each language can have its own formatter configuration:
javascript
formatters: {
javascript: {
// ESLint/Prettier compatible options
semicolons: true,
tabWidth: 2,
singleQuote: true,
},
python: {
// Black compatible options
lineLength: 88,
},
java: {
// Google Java Format compatible options
aosp: false, // Use AOSP style instead of Google style
},
}
Environment Variables
Environment variables can override configuration file settings:
Variable | Description |
---|---|
AIGUARDIAN_CONFIG | Path to configuration file |
AIGUARDIAN_PROJECT_TYPE | Project type |
AIGUARDIAN_BACKUP_DIR | Backup directory |
AIGUARDIAN_NO_BACKUP | Set to true to disable backups |
AIGUARDIAN_CONCURRENCY | Maximum concurrency |
AIGUARDIAN_VERBOSE
| Enable verbose output |Command-Line Overrides
Command-line options take precedence over configuration files and environment variables. See the Command Reference for all available options.
Was this page helpful?