pub struct InstallCommand {
pub no_lock: bool,
pub frozen: bool,
pub no_cache: bool,
pub max_parallel: Option<usize>,
pub quiet: bool,
pub no_progress: bool,
pub verbose: bool,
pub no_transitive: bool,
pub dry_run: bool,
pub yes: bool,
}Expand description
Command to install Claude Code resources from manifest dependencies.
This command reads the project’s agpm.toml manifest file, resolves all dependencies,
and installs the resource files to the appropriate directories. It generates or updates
a agpm.lock lockfile to ensure reproducible installations.
§Behavior
- Locates and loads the project manifest (
agpm.toml) - Resolves dependencies using the dependency resolver
- Downloads or updates Git repository sources as needed
- Installs resource files to target directories
- Generates or updates the lockfile (
agpm.lock) - Provides progress feedback during installation
§Examples
use agpm_cli::cli::install::InstallCommand;
// Standard installation
let cmd = InstallCommand {
no_lock: false,
frozen: false,
no_cache: false,
max_parallel: None,
quiet: false,
no_progress: false,
verbose: false,
no_transitive: false,
dry_run: false,
yes: false,
};
// CI/Production installation (frozen lockfile)
let cmd = InstallCommand {
no_lock: false,
frozen: true,
no_cache: false,
max_parallel: Some(2),
quiet: false,
no_progress: false,
verbose: false,
no_transitive: false,
dry_run: false,
yes: false,
};Fields§
§no_lock: boolDon’t write lockfile after installation
Prevents the command from creating or updating the agpm.lock file.
This is useful for development scenarios where you don’t want to
commit lockfile changes.
frozen: boolVerify checksums from existing lockfile
Uses the existing lockfile as-is without updating dependencies. This mode ensures reproducible installations and is recommended for CI/CD pipelines and production deployments.
no_cache: boolDon’t use cache, clone fresh repositories
Disables the local Git repository cache and clones repositories to temporary locations. This increases installation time but ensures completely fresh downloads.
max_parallel: Option<usize>Maximum number of parallel operations (default: max(MIN_PARALLELISM, PARALLELISM_CORE_MULTIPLIER × CPU cores))
Controls the level of parallelism during installation. The default value
is calculated as max(MIN_PARALLELISM, PARALLELISM_CORE_MULTIPLIER × CPU cores) to provide good performance
while avoiding resource exhaustion. Higher values can speed up installation
of many dependencies but may strain system resources or hit API rate limits.
§Performance Impact
- Low values (1-4): Conservative approach, slower but more reliable
- Default values (10-16): Balanced performance for most systems
- High values (>20): May overwhelm system resources or trigger rate limits
§Examples
--max-parallel 1: Sequential installation (debugging)--max-parallel 4: Conservative parallel installation--max-parallel 20: Aggressive parallel installation (powerful systems)
quiet: boolSuppress non-essential output
When enabled, only errors and essential information will be printed. Progress bars and status messages will be hidden.
no_progress: boolDisable progress bars (for programmatic use, not exposed as CLI arg)
verbose: boolEnable verbose output (for programmatic use, not exposed as CLI arg)
This flag is populated from the global –verbose flag via execute_with_config
no_transitive: boolDon’t resolve transitive dependencies
When enabled, only direct dependencies from the manifest will be installed. Transitive dependencies declared within resource files (via YAML frontmatter or JSON fields) will be ignored. This can be useful for faster installations when you know transitive dependencies are already satisfied or for debugging dependency issues.
dry_run: boolPreview installation without making changes
Shows what would be installed, including new dependencies and lockfile changes, but doesn’t modify any files. Useful for reviewing changes before applying them, especially in CI/CD pipelines to detect when dependencies would change.
When enabled:
- Resolves all dependencies normally
- Shows what resources would be installed
- Shows lockfile changes (new entries, version updates)
- Does NOT write the lockfile
- Does NOT install any resources
Exit codes:
- 0: No changes would be made
- 1: Changes would be made (useful for CI checks)
yes: boolAutomatically accept migration prompts
When set, automatically accepts migration prompts for legacy CCPM files or legacy AGPM format without requiring user interaction. Useful for CI/CD pipelines and automated scripts.
Implementations§
Source§impl InstallCommand
impl InstallCommand
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a default InstallCommand for programmatic use.
This constructor creates an InstallCommand with standard settings:
- Lockfile generation enabled
- Fresh dependency resolution (not frozen)
- Cache enabled for performance
- Default parallelism (see
--max-parallelfor formula) - Progress output enabled
§Examples
use agpm_cli::cli::install::InstallCommand;
let cmd = InstallCommand::new();
// cmd can now be executed with execute_from_path()Sourcepub const fn new_quiet() -> Self
pub const fn new_quiet() -> Self
Creates an InstallCommand configured for quiet operation.
This constructor creates an InstallCommand with quiet mode enabled,
which suppresses progress bars and non-essential output. Useful for
automated scripts or CI/CD environments where minimal output is desired.
§Examples
use agpm_cli::cli::install::InstallCommand;
let cmd = InstallCommand::new_quiet();
// cmd will execute without progress bars or status messagesSourcepub async fn execute_with_manifest_path(
self,
manifest_path: Option<PathBuf>,
) -> Result<()>
pub async fn execute_with_manifest_path( self, manifest_path: Option<PathBuf>, ) -> Result<()>
Executes the install command with automatic manifest discovery.
This method provides convenient manifest file discovery, searching for
agpm.toml in the current directory and parent directories if no specific
path is provided. It’s the standard entry point for CLI usage.
§Arguments
manifest_path- Optional explicit path toagpm.toml. IfNone, the method searches foragpm.tomlstarting from the current directory and walking up the directory tree.
§Manifest Discovery
When manifest_path is None, the search process:
- Checks current directory for
agpm.toml - Walks up parent directories until
agpm.tomlis found - Stops at filesystem root if no manifest found
- Returns an error with helpful guidance if no manifest exists
§Examples
use agpm_cli::cli::install::InstallCommand;
use std::path::PathBuf;
let cmd = InstallCommand::new();
// Auto-discover manifest in current directory or parents
cmd.execute_with_manifest_path(None).await?;
// Use specific manifest file
cmd.execute_with_manifest_path(Some(PathBuf::from("./my-project/agpm.toml"))).await?;§Errors
Returns an error if:
- No
agpm.tomlfile found in search path - Specified manifest path doesn’t exist
- Manifest file contains invalid TOML syntax
- Dependencies cannot be resolved
- Installation process fails
§Error Messages
When no manifest is found, the error includes helpful guidance:
No agpm.toml found in current directory or any parent directory.
To get started, create a agpm.toml file with your dependencies:
[sources]
official = "https://github.com/example-org/agpm-official.git"
[agents]
my-agent = { source = "official", path = "agents/my-agent.md", version = "v1.0.0" }pub async fn execute_from_path(&self, path: Option<&Path>) -> Result<()>
Trait Implementations§
Source§impl Args for InstallCommand
impl Args for InstallCommand
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 Default for InstallCommand
impl Default for InstallCommand
Source§impl FromArgMatches for InstallCommand
impl FromArgMatches for InstallCommand
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 InstallCommand
impl RefUnwindSafe for InstallCommand
impl Send for InstallCommand
impl Sync for InstallCommand
impl Unpin for InstallCommand
impl UnwindSafe for InstallCommand
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> 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