pub struct DependencySpec {
pub spec: String,
pub name: Option<String>,
pub tool: Option<String>,
pub target: Option<String>,
pub filename: Option<String>,
pub force: bool,
pub no_install: bool,
}Expand description
Common dependency specification used across commands
Fields§
§spec: StringDependency specification string
Format: source:path[@version] for Git sources or path for local files
GIT DEPENDENCIES (from a repository source defined in [sources]):
source:path@version - Specific version (tag/branch/commit)
source:path - Defaults to “main” branch
Examples: official:agents/code-reviewer.md@v1.0.0 - Specific version tag community:snippets/python-utils.md@main - Branch name myrepo:commands/deploy.md@abc123f - Commit SHA community:hooks/pre-commit.json - Defaults to “main”
LOCAL FILE DEPENDENCIES: ./path/file.md - Relative to current directory ../path/file.md - Parent directory /absolute/path/file.md - Absolute path (Unix/macOS) C:\path\file.md - Absolute path (Windows)
Examples: ./agents/my-agent.md - Project agent ../shared-resources/common-snippet.md - Shared resource /usr/local/share/agpm/hooks/lint.json - System-wide hook
PATTERN DEPENDENCIES (glob patterns for multiple files): source:dir/.md@version - All .md files in directory source:dir/**/.md - All .md files recursively
Examples: community:agents/ai/.md@v2.0.0 - All AI agents official:agents/**/review.md@v1.5.0 - All review agents (recursive) ./local-agents/*.md - All local agents
Notes:
- Version is optional for Git sources (defaults to “main”)
- Version is not applicable for local file paths
- Use –name to specify a custom dependency name
- Patterns require –name to provide a meaningful dependency name
name: Option<String>Custom name for the dependency
If not provided, the name will be derived from the file path. This allows for more descriptive or shorter names in the manifest.
tool: Option<String>Target tool for the dependency
Specifies which AI coding tool this resource is for. Supported values: claude-code, opencode, agpm
Examples: –tool claude-code - Install to .claude/ (default for agents, commands, scripts, hooks) –tool opencode - Install to .opencode/ –tool agpm - Install to .agpm/ (default for snippets)
target: Option<String>Custom installation target path (relative to resource directory)
Override the default installation path. The path is relative to the resource type’s default directory (e.g., .claude/agents/).
IMPORTANT: Since v0.3.18+, custom targets are relative to the resource directory, not the project root.
Examples: –target custom/special.md - Install to .claude/agents/custom/special.md –target experimental/test.md - Install to .claude/commands/experimental/test.md
filename: Option<String>Custom filename for the installed resource
Override the default filename derived from the source path. Use this to rename resources during installation.
Examples: –filename my-reviewer.md - Install as my-reviewer.md instead of original name –filename helper.json - Rename JSON file during installation
force: boolForce overwrite if dependency exists
By default, adding a duplicate dependency will fail. Use this flag to replace existing dependencies.
no_install: boolSkip automatic installation after adding dependency
By default, the dependency is automatically installed after being added to the manifest. Use this flag to only update the manifest without installing the dependency files.
Examples: –no-install - Add to manifest only, skip installation
Trait Implementations§
Source§impl Args for DependencySpec
impl Args for DependencySpec
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for DependencySpec
impl Clone for DependencySpec
Source§fn clone(&self) -> DependencySpec
fn clone(&self) -> DependencySpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DependencySpec
impl Debug for DependencySpec
Source§impl FromArgMatches for DependencySpec
impl FromArgMatches for DependencySpec
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for DependencySpec
impl RefUnwindSafe for DependencySpec
impl Send for DependencySpec
impl Sync for DependencySpec
impl Unpin for DependencySpec
impl UnwindSafe for DependencySpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more