Configuration
ArchiCore can be configured through configuration files and environment variables.
Configuration Files
Project Configuration
Located at .archicore/config.json in your project root:
{
"project": {
"name": "my-project",
"description": "My awesome project"
},
"index": {
"include": ["src/**/*", "lib/**/*"],
"exclude": ["node_modules", "dist", "*.test.ts"],
"languages": ["typescript", "javascript"]
},
"analysis": {
"maxFileSize": 1048576,
"maxFiles": 10000
},
"rules": {
"enabled": true,
"configPath": ".archicore/rules.json"
}
}
Global Configuration
Located at ~/.archicore/config.json:
{
"api": {
"baseUrl": "https://api.archicore.io/api",
"timeout": 30000
},
"cli": {
"theme": "dark",
"language": "en"
}
}
Configuration Options
Index Options
| Option | Type | Default | Description |
|---|---|---|---|
include | string[] | ["**/*"] | Glob patterns to include |
exclude | string[] | ["node_modules"] | Glob patterns to exclude |
languages | string[] | auto | Languages to index |
maxFileSize | number | 1048576 | Max file size in bytes |
maxFiles | number | 10000 | Max files to index |
Analysis Options
| Option | Type | Default | Description |
|---|---|---|---|
complexity.threshold | number | 10 | Cyclomatic complexity warning threshold |
duplication.minLines | number | 5 | Min lines for duplication detection |
security.enabled | boolean | true | Enable security scanning |
Environment Variables
| Variable | Description |
|---|---|
ARCHICORE_API_KEY | API key for authentication |
ARCHICORE_API_URL | Custom API endpoint |
ARCHICORE_DEBUG | Enable debug logging |
ARCHICORE_NO_COLOR | Disable colored output |
Architecture Rules
Define custom architecture rules in .archicore/rules.json:
{
"rules": [
{
"id": "no-circular-deps",
"name": "No Circular Dependencies",
"description": "Prevent circular dependencies between modules",
"type": "dependency",
"severity": "error",
"config": {
"maxDepth": 3
}
},
{
"id": "layer-isolation",
"name": "Layer Isolation",
"description": "Enforce layer boundaries",
"type": "import",
"severity": "warning",
"config": {
"layers": {
"controllers": ["services"],
"services": ["repositories", "utils"],
"repositories": ["models"]
}
}
},
{
"id": "naming-convention",
"name": "Naming Convention",
"description": "Enforce naming standards",
"type": "naming",
"severity": "info",
"config": {
"patterns": {
"service": ".*Service$",
"controller": ".*Controller$",
"repository": ".*Repository$"
}
}
}
]
}
Ignoring Files
Create .archicoreignore in your project root (similar to .gitignore):
# Dependencies
node_modules/
vendor/
# Build output
dist/
build/
*.min.js
# Tests
**/*.test.ts
**/*.spec.ts
__tests__/
# Generated
*.generated.ts
*.d.ts
# Large files
*.sql
*.csv
Precedence
Configuration is merged in this order (later overrides earlier):
- Default values
- Global config (
~/.archicore/config.json) - Project config (
.archicore/config.json) - Environment variables
- Command line flags