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.
§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 = 4
§Code Reviewer
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()));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 more