pub struct TargetConfig {
pub agents: String,
pub snippets: String,
pub commands: String,
pub mcp_servers: String,
pub scripts: String,
pub hooks: String,
pub gitignore: bool,
}Expand description
Target directories configuration specifying where resources are installed.
This struct defines the installation destinations for different resource types
within a AGPM project. All paths are relative to the project root (where
agpm.toml is located) unless they are absolute paths.
§Default Values
- Agents:
.claude/agents- Following Claude Code conventions - Snippets:
.agpm/snippets- AGPM-specific infrastructure (shared across tools) - Commands:
.claude/commands- Following Claude Code conventions
§Path Resolution
- Relative paths are resolved from the manifest directory
- Absolute paths are used as-is (not recommended for portability)
- Path separators are automatically normalized for the target platform
- Directories are created automatically during installation if they don’t exist
§Examples
# Default configuration (can be omitted)
[target]
agents = ".claude/agents"
snippets = ".agpm/snippets"
commands = ".claude/commands"
# Custom configuration
[target]
agents = "resources/ai-agents"
snippets = "templates/code-snippets"
commands = "resources/commands"
# Absolute paths (use with caution)
[target]
agents = "/opt/claude/agents"
snippets = "/opt/claude/snippets"
commands = "/opt/claude/commands"§Cross-Platform Considerations
AGPM automatically handles platform differences:
- Forward slashes work on all platforms (Windows, macOS, Linux)
- Path separators are normalized during installation
- Long path support on Windows is handled automatically
Fields§
§agents: StringDirectory where agent .md files should be installed.
Agents are AI model definitions, prompts, or behavioral specifications. This directory will contain copies of agent files from dependencies.
Default: .claude/agents (following Claude Code conventions)
snippets: StringDirectory where snippet .md files should be installed.
Snippets are reusable code templates, examples, or documentation. This directory will contain copies of snippet files from dependencies.
Default: .agpm/snippets (AGPM-specific infrastructure)
commands: StringDirectory where command .md files should be installed.
Commands are Claude Code slash commands that provide custom functionality. This directory will contain copies of command files from dependencies.
Default: .claude/commands (following Claude Code conventions)
mcp_servers: StringDirectory where MCP server configurations should be tracked.
Note: MCP servers are configured in .mcp.json at the project root,
not installed to this directory. This directory is used for tracking
metadata about installed servers.
Note: MCP servers are merged into .mcp.json - no separate directory
scripts: StringDirectory where script files should be installed.
Scripts are executable files (.sh, .js, .py, etc.) that can be referenced by hooks or run independently.
Default: .claude/scripts (Claude Code resource directory)
hooks: StringDirectory where hook configuration files should be installed.
Hooks are JSON configuration files that define event-based automation in Claude Code.
Note: Hooks are merged into .claude/settings.local.json - no separate directory
gitignore: boolWhether to automatically add installed files to .gitignore.
When enabled (default), AGPM will create or update .gitignore
to exclude all installed files from version control. This prevents
installed dependencies from being committed to your repository.
Set to false if you want to commit installed resources to version control.
Default: true
Trait Implementations§
Source§impl Clone for TargetConfig
impl Clone for TargetConfig
Source§fn clone(&self) -> TargetConfig
fn clone(&self) -> TargetConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more