pub struct DependencySpec {
pub path: String,
pub name: Option<String>,
pub version: Option<String>,
pub tool: Option<String>,
pub flatten: Option<bool>,
pub install: Option<bool>,
}Expand description
Dependency specification without the source field.
Used within resource files to declare dependencies on other resources from the same source repository. The source is implicit and inherited from the resource that declares the dependency.
Fields§
§path: StringPath to the dependency file within the source repository.
This can be either:
- A specific file path:
"agents/helper.md" - A glob pattern:
"agents/*.md","agents/**/review*.md"
name: Option<String>Optional custom name for the dependency in template context.
If specified, this name will be used as the key when accessing this
dependency in templates (e.g., agpm.deps.agents.custom_name).
If not specified, the name is derived from the path.
Example:
dependencies:
agents:
- path: "agents/complex-path/helper.md"
name: "helper"version: Option<String>Optional version constraint for the dependency.
If not specified, the version of the declaring resource is used. Supports the same version formats as manifest dependencies:
- Exact version:
"v1.0.0" - Latest:
"latest" - Branch:
"main" - Commit:
"abc123..."
tool: Option<String>Optional tool specification for this dependency.
If not specified, inherits from parent (if parent’s tool supports this resource type) or falls back to the default tool for this resource type.
- “claude-code” - Install to
.claude/directories - “opencode” - Install to
.opencode/directories - “agpm” - Install to
.agpm/directories
flatten: Option<bool>Optional flatten flag to control directory structure preservation.
When true, only the filename is used for installation (e.g., nested/dir/file.md → file.md).
When false (default for most resources), the full relative path is preserved.
Default values by resource type:
agents:true(flatten by default)commands:true(flatten by default)- All others:
false(preserve directory structure)
install: Option<bool>Optional flag to control whether the dependency should be installed to disk.
When false, the dependency will be resolved, fetched, and its content made available
in template context via agpm.deps.<type>.<name>.content, but the file will not be
written to the project directory. This is useful for snippet embedding use cases where
you want to include content inline rather than as a separate file.
See crate::templating::ResourceTemplateData for details on how content is accessed
in templates.
Default: true (install the file)
Example:
dependencies:
snippets:
- path: "snippets/rust-best-practices.md"
install: false # Don't create a separate file
name: "best_practices"Then use in template: {{ agpm.deps.snippets.best_practices.content }}
Trait Implementations§
Source§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<'de> Deserialize<'de> for DependencySpec
impl<'de> Deserialize<'de> for DependencySpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DependencySpec
impl PartialEq for DependencySpec
Source§impl Serialize for DependencySpec
impl Serialize for DependencySpec
impl Eq for DependencySpec
impl StructuralPartialEq for DependencySpec
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.