Skip to main content

ComposerCommand

Enum ComposerCommand 

Source
pub enum ComposerCommand {
Show 15 variants Install { working_dir: Option<PathBuf>, no_dev: bool, frozen: bool, lock_verify: bool, ignore_platform_reqs: bool, ignore_platform_req: Vec<String>, scripts: bool, no_scripts: bool, }, Update { packages: Vec<String>, no_install: bool, with_dependencies: bool, with_all_dependencies: bool, working_dir: Option<PathBuf>, no_dev: bool, dry_run: bool, ignore_platform_reqs: bool, ignore_platform_req: Vec<String>, }, Validate { working_dir: Option<PathBuf>, strict: bool, no_check_lock: bool, no_check_publish: bool, no_check_all: bool, with_dependencies: bool, check_lock: bool, }, DumpAutoloader { optimize: bool, classmap_authoritative: bool, no_dev: bool, apcu_autoloader: bool, apcu_prefix: Option<String>, autoloader_suffix: Option<String>, working_dir: Option<PathBuf>, }, Require { packages: Vec<String>, dev: bool, no_update: bool, no_install: bool, with_dependencies: bool, with_all_dependencies: bool, prefer_lowest: bool, ignore_platform_reqs: bool, ignore_platform_req: Vec<String>, working_dir: Option<PathBuf>, dry_run: bool, }, Remove { packages: Vec<String>, dev: bool, no_update: bool, no_install: bool, no_dev: bool, ignore_platform_reqs: bool, ignore_platform_req: Vec<String>, working_dir: Option<PathBuf>, dry_run: bool, }, Show { package: Option<String>, tree: bool, direct: bool, platform: bool, self_: bool, name_only: bool, path: bool, latest: bool, outdated: bool, no_dev: bool, working_dir: Option<PathBuf>, }, Why { package: String, recursive: bool, tree: bool, working_dir: Option<PathBuf>, }, WhyNot { package: String, version: Option<String>, recursive: bool, tree: bool, working_dir: Option<PathBuf>, }, Outdated { packages: Vec<String>, direct: bool, major_only: bool, minor_only: bool, patch_only: bool, no_dev: bool, strict: bool, working_dir: Option<PathBuf>, }, Audit { no_dev: bool, abandoned: AbandonedHandling, locked: bool, working_dir: Option<PathBuf>, }, Licenses { no_dev: bool, working_dir: Option<PathBuf>, }, Status { working_dir: Option<PathBuf>, }, Fund { no_dev: bool, working_dir: Option<PathBuf>, }, External(Vec<OsString>),
}

Variants§

§

Install

Install a project’s vendor/ from composer.lock. Reads composer.json + composer.lock in the working directory, content-hash-verifies the lock, parallel-downloads dists into vendor/, and emits vendor/autoload.php.

Fields

§working_dir: Option<PathBuf>

Run the install in this directory instead of CWD. Mirrors Composer’s --working-dir / -d.

§no_dev: bool

Skip dev-only packages and dev autoload entries.

§frozen: bool

Fail if composer.lock is out of sync with composer.json. Currently a no-op — the install already errors on content-hash mismatch by default. Accepted for parity with Composer’s CI usage.

§lock_verify: bool

Verify the lock is internally consistent (content-hash, requires, transitives) and exit. Doesn’t touch vendor/ or run the autoloader. CI-friendly read-only check.

§ignore_platform_reqs: bool

Ignore all platform requirements (php, ext-, lib-). Accepted for Composer parity; bougie does not enforce platform requirements yet.

§ignore_platform_req: Vec<String>

Ignore a specific platform requirement.

§scripts: bool

Run composer.json root scripts, overriding [scripts] run in bougie.toml. Off by default (opt-in).

§no_scripts: bool

Skip composer.json root scripts, overriding [scripts] run = true in bougie.toml (Composer-compatible --no-scripts).

§

Update

Resolve the project’s dependency graph, write a fresh composer.lock, and install the result into vendor/ (matching Composer’s update). With no package arguments this re-resolves from scratch; naming one or more packages does a partial update — only those re-resolve while every other locked package stays pinned. --no-install stops after writing the lock; --dry-run previews the solution without writing anything. Aliased to upgrade / u, like Composer.

Fields

§packages: Vec<String>

Packages to update (vendor/name). When given, only these packages re-resolve; every other package stays pinned to its composer.lock version (Composer’s partial update). With no packages, the whole graph re-resolves from scratch.

§no_install: bool

Write the lock but don’t install into vendor/ (Composer’s --no-install).

§with_dependencies: bool

Also update the named packages’ dependencies (Composer’s --with-dependencies / -w).

§with_all_dependencies: bool

Also update all of the named packages’ dependencies, including ones shared with other packages (Composer’s --with-all-dependencies / -W).

§working_dir: Option<PathBuf>

Run the update in this directory instead of CWD. Mirrors Composer’s --working-dir / -d.

§no_dev: bool

Skip dev-only root requires when resolving.

§dry_run: bool

Resolve and print the solution without writing composer.lock or touching vendor/. Without this flag, update writes a fresh composer.lock.

§ignore_platform_reqs: bool

Ignore all platform requirements (php, ext-, lib-). Accepted for Composer parity; bougie does not enforce platform requirements yet.

§ignore_platform_req: Vec<String>

Ignore a specific platform requirement.

§

Validate

Validate composer.json structure and contents.

Fields

§working_dir: Option<PathBuf>

Run in this directory instead of CWD.

§strict: bool

Return non-zero exit code for warnings too.

§no_check_lock: bool

Skip lock file freshness check.

§no_check_publish: bool

Skip publish-only checks (name casing, required fields).

§no_check_all: bool

Skip unbound/exact version constraint warnings.

§with_dependencies: bool

Also validate installed dependencies’ composer.json files.

§check_lock: bool

Force lock file checking even when config.lock is false.

§

DumpAutoloader

Regenerate vendor/composer/autoload_*.php against the current composer.lock. Drop-in for composer dump-autoload; output is byte-equivalent to Composer 2.8.12 with the same flags. Aliased to dump-autoload for users coming from Composer muscle-memory.

Fields

§optimize: bool

Optimize the classmap (--optimize / -o).

§classmap_authoritative: bool

Emit the classmap-authoritative static loader (--classmap-authoritative / -a). Implies --optimize.

§no_dev: bool

Skip dev autoload entries (--no-dev).

§apcu_autoloader: bool

Emit the APCu loader bootstrap (--apcu-autoloader).

§apcu_prefix: Option<String>

Explicit APCu prefix; implies --apcu-autoloader.

§autoloader_suffix: Option<String>

Override the ComposerAutoloaderInit<X> class suffix — otherwise the value from composer.json’s config.autoloader-suffix, or the composer.lock content-hash.

§working_dir: Option<PathBuf>

Run the dump in this directory instead of the current one. Mirrors Composer’s --working-dir / -d.

§

Require

Add one or more packages to composer.json require (or require-dev), re-resolve composer.lock, and install them. Fully Composer-compatible: a bare vendor/pkg resolves the latest stable and writes a caret (^X.Y) constraint; supply an explicit constraint with vendor/pkg:^1.0, vendor/pkg=^1.0, or a trailing argument (vendor/pkg ^1.0) — Composer’s separators are :, =, or a space (the @ separator is not accepted, as in Composer). For bougie’s >=-default + @-syntax house style, use the top-level bougie add instead.

Fields

§packages: Vec<String>

Packages to require, as Composer name↔version pairs.

§dev: bool

Add to require-dev instead of require.

§no_update: bool

Edit composer.json only — don’t re-resolve composer.lock or touch vendor/ (Composer’s --no-update).

§no_install: bool

Re-resolve and write composer.lock but don’t install into vendor/ (Composer’s --no-install).

§with_dependencies: bool

Also update the new packages’ dependencies (-w).

§with_all_dependencies: bool

Also update all dependencies, including shared ones (-W).

§prefer_lowest: bool

Prefer the lowest matching versions when resolving.

§ignore_platform_reqs: bool

Ignore all platform requirements (php, ext-, lib-).

§ignore_platform_req: Vec<String>

Ignore a specific platform requirement.

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§dry_run: bool

Resolve and report what would change without writing composer.json, composer.lock, or vendor/.

§

Remove

Remove one or more packages from composer.json, re-resolve composer.lock, and uninstall them from vendor/. Drop-in for composer remove.

Fields

§packages: Vec<String>

Packages to remove (vendor/name).

§dev: bool

Remove from require-dev instead of require.

§no_update: bool

Edit composer.json only — don’t re-resolve or touch vendor/ (Composer’s --no-update).

§no_install: bool

Re-resolve and write composer.lock but don’t touch vendor/ (Composer’s --no-install).

§no_dev: bool

Skip dev-only packages when resolving.

§ignore_platform_reqs: bool

Ignore all platform requirements (php, ext-, lib-).

§ignore_platform_req: Vec<String>

Ignore a specific platform requirement.

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§dry_run: bool

Resolve and report what would change without writing composer.json, composer.lock, or vendor/.

§

Show

List installed packages, or show details for one. Reads the project’s composer.lock. Drop-in for composer show (aliases info, list).

Fields

§package: Option<String>

A single vendor/name to show details for. With no argument, every installed package is listed.

§tree: bool

Render the dependency tree (--tree / -t).

§direct: bool

Only the project’s direct dependencies (--direct / -D).

§platform: bool

Only platform packages — php, ext-, lib- (--platform / -p).

§self_: bool

Show the root package’s own info (--self / -s).

§name_only: bool

Print package names only (--name-only / -N).

§path: bool

Show each package’s install path (--path / -P).

§latest: bool

Also fetch and show the latest available version (--latest / -l).

§outdated: bool

Only packages with a newer version available (--outdated / -o). Implies --latest.

§no_dev: bool

Skip dev dependencies (--no-dev).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Why

Show which packages depend on a given package — i.e. why it’s installed. Drop-in for composer why (alias depends).

Fields

§package: String

The package to explain.

§recursive: bool

Recurse through the dependency chain (--recursive / -r).

§tree: bool

Render the full dependency-of tree (--tree / -t).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

WhyNot

Show what prevents a package (optionally at a version) from being installed — conflicting requirements. Drop-in for composer why-not (alias prohibits).

Fields

§package: String

The package to test.

§version: Option<String>

The version (or constraint) to test against. Defaults to *.

§recursive: bool

Recurse through the dependency chain (--recursive / -r).

§tree: bool

Render the full tree (--tree / -t).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Outdated

List installed packages that have a newer version available. Drop-in for composer outdated (a focused show --latest --outdated). Use the global --format json for JSON output.

Fields

§packages: Vec<String>

Optional vendor/name filters; with none, all packages are considered.

§direct: bool

Only the project’s direct dependencies (--direct / -D).

§major_only: bool

Only show packages with a new major version (--major-only).

§minor_only: bool

Only show packages with a new minor version (--minor-only).

§patch_only: bool

Only show packages with a new patch version (--patch-only).

§no_dev: bool

Skip dev dependencies (--no-dev).

§strict: bool

Exit non-zero if any package is outdated (--strict).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Audit

Check installed packages against the Packagist security-advisories database. Drop-in for composer audit. Exits non-zero when advisories are found. Use the global --format json for JSON.

Fields

§no_dev: bool

Skip dev dependencies (--no-dev).

§abandoned: AbandonedHandling

How to treat abandoned packages (--abandoned). Currently accepted for parity; abandoned detection is not yet wired.

§locked: bool

Audit the locked set (--locked). bougie always reads composer.lock, so this is the default behavior; accepted for parity.

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Licenses

List the license of every installed package. Drop-in for composer licenses. Use the global --format json for JSON.

Fields

§no_dev: bool

Skip dev dependencies (--no-dev).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Status

Report packages that look locally modified. Drop-in for composer status. bougie installs from dist archives, so for the common case this reports “no local changes”.

Fields

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

Fund

Show funding information for installed packages, grouped by vendor. Drop-in for composer fund. Use --format json for JSON.

Fields

§no_dev: bool

Skip dev dependencies (--no-dev).

§working_dir: Option<PathBuf>

Run in this directory instead of CWD (-d).

§

External(Vec<OsString>)

Catch-all for any composer subcommand bougie does not implement natively (create-project, archive, bump, global, …). bougie does not bundle the Composer phar, so these no longer run; the dispatch returns an error pointing at bougie tool install composer/composer for the full upstream Composer.

Trait Implementations§

Source§

impl Debug for ComposerCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for ComposerCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for ComposerCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.