pub struct ProjectConfig(/* private fields */);Expand description
The main manifest file structure representing a complete agpm.toml file.
This struct encapsulates all configuration for a AGPM project, including
source repositories, installation targets, and resource dependencies.
It provides the foundation for declarative dependency management similar
to Cargo’s Cargo.toml.
§Structure
- Sources: Named Git repositories that can be referenced by dependencies
- Target: Installation directories for different resource types
- Agents: AI agent dependencies (
.mdfiles with agent definitions) - Snippets: Code snippet dependencies (
.mdfiles with reusable code) - Commands: Claude Code command dependencies (
.mdfiles with slash commands)
§Serialization
The struct uses Serde for TOML serialization/deserialization with these behaviors:
- Empty collections are omitted from serialized output for cleaner files
- Default values are automatically applied for missing fields
- Field names match TOML section names exactly
§Thread Safety
This struct is thread-safe and can be shared across async tasks safely.
§Use Case: AI Agent Context
When AI agents work on your codebase, they need context about:
- Where to find coding standards and style guides
- What conventions to follow (formatting, naming, patterns)
- Where architecture and design docs are located
- Project-specific requirements (testing, security, performance)
§Template Access
All variables are accessible in templates under the agpm.project namespace.
The structure is completely user-defined.
TOML Configuration:
# Top-level variables
style_guide = "docs/STYLE_GUIDE.md"
max_line_length = 100
test_framework = "pytest"
# Nested sections (optional, just for organization)
[project.paths]
architecture = "docs/ARCHITECTURE.md"
conventions = "docs/CONVENTIONS.md"
[project.standards]
indent_style = "spaces"
indent_size = 4Template Usage:
Follow guidelines at: {{ agpm.project.style_guide }}
Max line length: {{ agpm.project.max_line_length }}
Architecture: {{ agpm.project.paths.architecture }}Implementations§
Source§impl ProjectConfig
impl ProjectConfig
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Convert this ProjectConfig to a serde_json::Value for template rendering.
This method handles conversion of TOML values to JSON values, which is necessary for proper Tera template rendering.
use agpm_cli::manifest::ProjectConfig;
let mut config_map = toml::map::Map::new();
config_map.insert("style_guide".to_string(), toml::Value::String("docs/STYLE.md".into()));
let config = ProjectConfig::from(config_map);
let json = config.to_json_value();Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectConfig
impl Debug for ProjectConfig
Source§impl Default for ProjectConfig
impl Default for ProjectConfig
Source§fn default() -> ProjectConfig
fn default() -> ProjectConfig
Source§impl<'de> Deserialize<'de> for ProjectConfig
impl<'de> Deserialize<'de> for ProjectConfig
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>,
Auto Trait Implementations§
impl Freeze for ProjectConfig
impl RefUnwindSafe for ProjectConfig
impl Send for ProjectConfig
impl Sync for ProjectConfig
impl Unpin for ProjectConfig
impl UnwindSafe for ProjectConfig
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