This guide covers all configuration options for aimgr, including repository path customization and installation targets.
aimgr uses XDG Base Directory standards for configuration:
- Default location:
~/.config/aimgr/aimgr.yaml - Custom location: Use
--configflag (not implemented yet)
The config file is automatically created when you first run commands that need configuration.
The config file uses YAML format with two main sections:
# Installation configuration
install:
targets: [claude, opencode]
# Repository configuration
repo:
path: ~/.local/share/ai-config/repoNote: Source management for automatic syncing is configured separately via ai.repo.yaml files. See sources.md for details.
By default, aimgr stores resources in ~/.local/share/ai-config/repo (XDG data directory). You can customize this location using three methods.
The repository path is determined using this precedence order (highest to lowest):
AIMGR_REPO_PATHenvironment variable (highest priority)repo.pathin config file (~/.config/aimgr/aimgr.yaml)- XDG default (
~/.local/share/ai-config/repo)
Each level overrides all levels below it.
Set repo.path in your config file for a persistent custom location:
Edit ~/.config/aimgr/aimgr.yaml:
repo:
path: ~/my-custom-repo
install:
targets:
- claudeBenefits:
- ✅ Persistent across all sessions
- ✅ Version controllable (can be checked into dotfiles)
- ✅ Supports path expansion (tilde, relative paths)
- ✅ Validated on load (errors shown early)
Use this when:
- You want a permanent custom repository location
- You're managing dotfiles in version control
- You want path validation and error checking
Set AIMGR_REPO_PATH to override the config file:
Temporary (current session only):
export AIMGR_REPO_PATH=/path/to/custom/repo
aimgr listPermanent (add to shell profile):
# For Bash
echo 'export AIMGR_REPO_PATH=~/my-repo' >> ~/.bashrc
source ~/.bashrc
# For Zsh
echo 'export AIMGR_REPO_PATH=~/my-repo' >> ~/.zshrc
source ~/.zshrc
# For Fish
echo 'set -x AIMGR_REPO_PATH ~/my-repo' >> ~/.config/fish/config.fishBenefits:
- ✅ Overrides all other settings (highest priority)
- ✅ Easy to set temporarily for testing
- ✅ Works across different projects
- ✅ Useful for CI/CD environments
Use this when:
- You need to temporarily test with a different repository
- You want different repos for different shell sessions
- You're running in CI/CD with different environments
- You need to override config file setting without editing it
If no custom path is configured, aimgr uses the XDG data directory:
~/.local/share/ai-config/repo/
This follows the XDG Base Directory Specification.
Benefits:
- ✅ Standard Linux/Unix location for application data
- ✅ Keeps home directory clean
- ✅ No configuration needed
- ✅ Works out of the box
Use this when:
- You're happy with the default location
- You want to follow XDG standards
- You don't need custom repository locations
All custom paths support expansion and normalization:
repo:
path: ~/my-repo
# Expands to: /home/username/my-repoexport AIMGR_REPO_PATH=~/custom/repo
# Expands to: /home/username/custom/repoRelative paths are automatically converted to absolute paths:
repo:
path: ./repo
# Converts to: /home/username/project/repo (from current directory)repo:
path: ../shared-repo
# Converts to: /home/username/shared-repoNote: Relative paths in config file are resolved relative to the current working directory when aimgr is run.
Absolute paths are used as-is:
repo:
path: /opt/ai-resources
# Used directly: /opt/ai-resourcesAll paths are cleaned and normalized (e.g., //double/slashes becomes /double/slashes).
aimgr supports Docker Compose-style environment variable interpolation in the config file. This allows you to reference environment variables with optional default values.
| Pattern | Description | Example |
|---|---|---|
${VAR} |
Simple substitution | ${HOME} → /home/user |
${VAR:-default} |
Default if unset/empty | ${PORT:-5432} → 5432 if PORT not set |
Variable names must match the pattern: [A-Za-z_][A-Za-z0-9_]*
- Start with letter or underscore
- Contain only letters, numbers, and underscores
- Case-sensitive (standard shell convention)
Basic usage:
repo:
path: ${AIMGR_REPO_PATH} # Use env var or empty if not setWith default values:
repo:
path: ${AIMGR_REPO_PATH:-~/.local/share/ai-config/repo}
install:
targets: [${DEFAULT_TOOL:-claude}]Multiple variables:
repo:
path: ${BASE_PATH:-~/.local}/share/${APP_NAME:-ai-config}/repoEnvironment-specific configs:
# Development
repo:
path: ${DEV_REPO_PATH:-~/dev/ai-resources}
# Production
repo:
path: ${PROD_REPO_PATH:-/var/lib/ai-config/repo}- Environment variables are expanded before YAML parsing
- Variable expansion happens in both
Load()andLoadGlobal() - Works in any config field (repo.path, install.targets, etc.)
- If variable is unset/empty and no default provided, expands to empty string
- Existing validation applies after expansion
CI/CD environments: Different paths per environment without maintaining multiple config files:
repo:
path: ${CI_REPO_PATH:-~/.local/share/ai-config/repo}
install:
targets: [${CI_TOOL:-claude}]Team configurations: Shared config with user-specific overrides:
repo:
path: ${USER_REPO_PATH:-~/team-ai-resources}
install:
targets: [${USER_TOOLS:-claude,opencode}]Testing: Override paths without modifying config file:
# Run tests with temporary repository
export AIMGR_REPO_PATH=/tmp/test-repo
aimgr repo add local:~/test-resources/
aimgr install skill/test-skill
# Original config unchanged
unset AIMGR_REPO_PATH
aimgr list # Uses default config pathCustom paths with variables: Construct paths dynamically:
repo:
path: ${HOME}/${PROJECT:-ai-config}/repoConfigure which AI tools to install resources to by default:
install:
targets:
- claude
- opencode
- copilotValid tools:
claude- Claude Code (.claude/directories)opencode- OpenCode (.opencode/directories)copilotorvscode- VSCode / GitHub Copilot (skills in.github/skills/, agents in.github/agents/<name>.agent.md; prompt-file commands in.github/prompts/are intentionally unsupported)windsurf- Windsurf (.windsurf/skills/directories, skills only)
Behavior:
- Used when installing to fresh projects (no existing tool directories)
- Overridden by existing tool directories in the project
- Can be overridden per-command with
--targetflag
See the README for more details on multi-tool installation.
You can also manage installation targets via the CLI:
# Set single target
aimgr config set install.targets claude
# Set multiple targets
aimgr config set install.targets claude,opencode
# Get current setting
aimgr config get install.targetsDifferent AI tools often require different values for the same resource fields. For example, OpenCode might use model names in provider/model format (e.g., langdock/claude-sonnet-4-5) while Claude uses just the model name (e.g., claude-sonnet-4). Field mappings let you define logical values in your resources that get transformed to tool-specific values.
The most common use case is mapping model names. Here's a minimal configuration:
# ~/.config/aimgr/aimgr.yaml
install:
targets:
- claude
- opencode
mappings:
skill:
model:
sonnet-4.5:
opencode: "langdock/claude-sonnet-4-5"
claude: "claude-sonnet-4"With this configuration, a skill with model: sonnet-4.5 in its frontmatter will be transformed to use the appropriate model name for each tool during installation.
# ~/.config/aimgr/aimgr.yaml
mappings:
skill:
model:
sonnet-4.5:
opencode: "langdock/claude-sonnet-4-5"
claude: "claude-sonnet-4"
opus-4:
opencode: "langdock/claude-opus-4"
claude: "claude-opus-4"
null: # Maps missing/empty field to tool-specific value
opencode: "langdock/default-model"
agent:
model:
# Same structure as skill
command:
model:
# Same structure as skillPer-Type Mappings
Each resource type (skill, agent, command) has its own mapping section. This allows different transformation rules per type if needed.
Field Transformations
Structure: mappings.<type>.<field>.<logical_value>.<tool>: <actual_value>
<type>: Resource type (skill, agent, command)<field>: Frontmatter field name (e.g., model)<logical_value>: The value used in your resource files<tool>: Target tool name (claude, opencode, copilot, windsurf)<actual_value>: The tool-specific value to use
The null Key
Use the special null key to handle resources with missing or empty field values:
mappings:
skill:
model:
null:
opencode: "langdock/default-model"
claude: "claude-sonnet-4"This maps any skill without a model field (or with an empty value) to tool-specific defaults.
-
During
repo addandrepo sync: aimgr parses frontmatter in your resources and generates tool-specific variants in a.modifications/folder within the repository:repo/ skills/my-skill/SKILL.md # Original (untouched) agents/reviewer.md # Original (untouched) .modifications/ # Generated variants opencode/ skills/my-skill/SKILL.md # Transformed for opencode agents/reviewer.md claude/ skills/my-skill/SKILL.md # Transformed for claude agents/reviewer.md -
During
install: aimgr checks for a modification file. If one exists for the target tool, it symlinks to the modified version. Otherwise, it symlinks to the original file. -
During
repo remove: aimgr cleans up the corresponding modification files.
If no mappings section is configured, aimgr behaves exactly as before—no .modifications/ folder is created, and install always symlinks to the original files.
- skill: Only
SKILL.mdis processed for transformations - agent: All
.mdfiles in the agent are processed - command: All
.mdfiles in the command are processed
Here's a complete example config file with all options:
# ~/.config/aimgr/aimgr.yaml
# Default installation targets (required)
install:
targets:
- claude
- opencode
# Repository location (optional)
# If not specified, uses: ~/.local/share/ai-config/repo
repo:
path: ~/ai-resources
# Field mappings for tool-specific values (optional)
mappings:
skill:
model:
sonnet-4.5:
opencode: "langdock/claude-sonnet-4-5"
claude: "claude-sonnet-4"
null:
opencode: "langdock/default-model"
agent:
model:
sonnet-4.5:
opencode: "langdock/claude-sonnet-4-5"
claude: "claude-sonnet-4"# Developer using custom repo location
repo:
path: ~/dev/ai-repo
install:
targets:
- claude
- opencode# Team sharing resources on network drive
repo:
path: /mnt/shared/ai-resources
install:
targets:
- claudeUse environment variable for dynamic paths:
# .gitlab-ci.yml or .github/workflows/main.yml
export AIMGR_REPO_PATH=/tmp/ci-ai-repo
aimgr repo add gh:myorg/resources
aimgr install skill/linter# Support multiple AI tools
install:
targets:
- claude
- opencode
- copilot
repo:
path: ~/ai-resources# Test with temporary repository
export AIMGR_REPO_PATH=/tmp/test-repo
aimgr repo add local:./test-resources/
aimgr install skill/test-skill
# Original repository unchanged
unset AIMGR_REPO_PATH
aimgr list # Uses default or config file pathError:
Error: no config found
Please create a config file at: ~/.config/aimgr/aimgr.yaml
Solution:
Create the config file with minimum required settings:
mkdir -p ~/.config/aimgr
cat > ~/.config/aimgr/aimgr.yaml << 'EOF'
install:
targets:
- claude
EOFSymptom: Resources still going to ~/.local/share/ai-config/repo
Cause: Environment variable AIMGR_REPO_PATH is overriding config file
Solution:
Check for environment variable:
echo $AIMGR_REPO_PATH
# If set and you want to use config file instead:
unset AIMGR_REPO_PATHOr verify config file path:
cat ~/.config/aimgr/aimgr.yamlSymptom: Path like ~/repo is not expanding to home directory
Cause: Path might be quoted incorrectly or not processed by config loader
Solution:
Ensure path is in config file (not just environment variable):
# ✅ Correct - will expand ~
repo:
path: ~/my-repo
# ❌ Incorrect - quotes prevent expansion in some contexts
repo:
path: "~/my-repo"Symptom: Relative path resolves to unexpected location
Cause: Relative paths resolve from current working directory when aimgr runs
Solution:
Use absolute paths or tilde expansion instead:
# ✅ Recommended - use tilde
repo:
path: ~/ai-repo
# ✅ Also good - absolute path
repo:
path: /home/username/ai-repo
# ⚠️ Avoid - resolves from current directory
repo:
path: ./ai-repoError:
Error: failed to create repo directory: permission denied
Solution:
Ensure you have write permissions to the configured path:
# Check permissions
ls -ld ~/my-repo
# Fix permissions if needed
chmod 755 ~/my-repo
# Or use a different path you ownSymptom: Not sure which repo path is being used
Solution:
Check precedence in order:
# 1. Check environment variable (highest priority)
echo $AIMGR_REPO_PATH
# 2. Check config file
cat ~/.config/aimgr/aimgr.yaml | grep -A1 "^repo:"
# 3. Default XDG location (if nothing else set)
echo ~/.local/share/ai-config/repo
# Verify actual repo location
aimgr repo list # Lists resources from active repoIf you want to move your repository from the default location:
# Copy existing resources to new location
cp -r ~/.local/share/ai-config/repo ~/my-custom-repo
# Update config file
cat >> ~/.config/aimgr/aimgr.yaml << 'EOF'
repo:
path: ~/my-custom-repo
EOF
# Verify it works
aimgr repo list
# Optional: Remove old location
rm -rf ~/.local/share/ai-config/repoIf you have ~/.ai-repo.yaml, it's automatically migrated to ~/.config/aimgr/aimgr.yaml on first use.
The old file is left intact for safety. You can delete it once you verify the migration worked:
# Verify migration
cat ~/.config/aimgr/aimgr.yaml
# Delete old config if migration successful
rm ~/.ai-repo.yaml- README.md - Quick start and overview
- Sources - Source management via ai.repo.yaml files
- Supported Tools - Tool support and resource formats
- Pattern Matching - Pattern syntax for filtering
- Output Formats - CLI output formats