Skip to content

🛠️ Composer CLI 方法参考

本节列出该模块的全部方法参考页,每个方法一页,含签名、参数、返回值、示例与进阶说明。

方法文档
🏗️ AddAutoloadadd-autoload
🪪 AddBearerTokenadd-bearer-token
🌐 AddComposerRepositoryadd-composer-repository
🔑 AddGitHubTokenadd-github-token
🔑 AddGitLabTokenadd-gitlab-token
🔐 AddHTTPBasicAuthadd-http-basic-auth
📥 AddPackagistRepositoryadd-packagist-repository
📁 AddPathRepositoryadd-path-repository
➕ AddRequireadd-require
🧩 AddScriptadd-script
🔧 AddVcsRepositoryadd-vcs-repository
🗜️ Archivearchive
📦 ArchivePackagearchive-package
🗜️ ArchiveProjectarchive-project
📦 AuditLockaudit-lock
🔒 Auditaudit
📊 AuditWithFormataudit-with-format
🧩 AuditWithJSONaudit-with-json
🔍 AuditWithoutDevaudit-without-dev
🗑️ BatchRemovebatch-remove
📦 BatchRequirebatch-require
🌐 BrowsePackagebrowse-package
🏗️ BuildSatisbuild-satis
📈 BumpPackagesbump-packages
📈 CheckForOutdatedPackagescheck-for-outdated-packages
🛡️ CheckForSecurityVulnerabilitiescheck-for-security-vulnerabilities
🔓 CheckLicenses 检查依赖许可证兼容性check-licenses
✅ Checkcheck
🖥️ CheckPlatformcheck-platform
🖥️ CheckPlatformReqs 检查平台要求check-platform-reqs
📋 CheckPlatformReqsStructuredcheck-platform-reqs-structured
🔒 CheckPlatformWithLockcheck-platform-with-lock
🎯 CheckStructuredcheck-structured
🧹 ClearCacheclear-cache
🚀 CreateProjectcreate-project
📦 CreateSatisConfigcreate-satis-config
⚙️ DefaultOptionsdefault-options
🩺 Diagnosediagnose
🔬 DiagnoseStructureddiagnose-structured
🤫 DisableInteractiondisable-interaction
🧩 DumpAutoloaddump-autoload
🛠️ DumpAutoloadWithOptionsdump-autoload-with-options
👤 EnableSuperuserenable-superuser
🔧 EnsureInstalledensure-installed
🌟 ExecAllexec-all
⚙️ Execexec
🐘 ExecPHPexec-php
🎯 ExecuteScriptexecute-script
📋 ExecWithListexec-with-list
📦 ExtractPackageNamesFromOutputextract-package-names-from-output
🎯 ExtractVersionFromOutputextract-version-from-output
🧮 FormatVersionConstraintformat-version-constraint
💰 Fundfund
📊 FundWithJSONfund-with-json
⚠️ GetAbandonedPackagesFromLockget-abandoned-packages-from-lock
🚫 GetAbandonedPackagesget-abandoned-packages
📈 GetAuditInfoget-audit-info
📖 GetAuthConfigget-auth-config
💾 GetCacheDirget-cache-dir
🏠 GetComposerHomeget-composer-home
📊 GetConfigStructuredget-config-structured
🔧 GetConfigWithGlobalget-config-with-global
🎯 GetDirectDependencyNamesget-direct-dependency-names
🧭 GetEnvironmentInfoget-environment-info
🔍 GetEnvVariableget-env-variable
🧩 GetExtensionsget-extensions
🔗 GetFundingURLsget-funding-urls
🚨 GetHighSeverityVulnerabilitiesget-high-severity-vulnerabilities
📋 GetInstalledPackageNamesget-installed-package-names
🧾 GetLicensesInfoget-licenses-info
🗺️ GetNamespaceMapget-namespace-map
⬆️ GetOutdatedInfoget-outdated-info
🐘 GetPHPVersionget-php-version
📊 GetProjectDependenciesget-project-dependencies
📦 GetProjectInfoget-project-info
🏗️ GetProjectSummaryget-project-summary
🔍 GetRequireWithVersionget-require-with-version
⌨️ GetScriptsget-scripts
📁 GetVendorDirget-vendor-dir
📊 GetVersionInfoget-version-info
🔢 GetVersionget-version
📦 GlobalInstallglobal-install
📋 GlobalListglobal-list
🗑️ GlobalRemoveglobal-remove
🌐 GlobalRequireglobal-require
🔄 GlobalUpdateglobal-update
🔒 HasComposerLockhas-composer-lock
🔍 HasExtensionhas-extension
✅ HasFundinghas-funding
📁 HasVendorDirhas-vendor-dir
⚠️ HasVulnerabilitieshas-vulnerabilities
🏥 HealthCheckhealth-check
🏗️ InitProjectinit-project
🚀 InitSatisinit-satis
🔍 InstallDryRuninstall-dry-run
📦 Installinstall
🚫 InstallNoScriptsinstall-no-scripts
⚡ InstallWithAPCu 启用 APCu 自动加载缓存安装依赖install-with-apcu
🛠️ InstallWithOptionsinstall-with-options
📥 InstallWithPreferDistinstall-with-prefer-dist
📥 InstallWithPreferSourceinstall-with-prefer-source
✅ IsInstalledis-installed
🧩 IsPackageDevis-package-dev
✅ IsPackageInstalledis-package-installed
✅ IsPlatformAvailableis-platform-available
📦 IsProjectis-project
📜 Licenseslicenses
📜 LicensesWithFormatlicenses-with-format
📋 ListConfiglist-config
🔍 ListRepositorieslist-repositories
📚 ListScriptslist-scripts
⚙️ LocalExeclocal-exec
🔒 LockPackageVersionlock-package-version
🚀 Newnew
📝 NormalizeComposerJsonnormalize-composer-json
📦 OutdatedPackagesDirect 仅显示直接依赖中过时的包outdated-packages-direct
⬆️ OutdatedPackagesoutdated-packages
✅ ParseCheckOutputparse-check-output
🔒 ParseComposerAuditJSONparse-composer-audit-json
📈 ParseComposerOutdatedJSONparse-composer-outdated-json
🔍 ParseComposerShowJSONparse-composer-show-json
🌳 ParseDependencyTreeJSONparse-dependency-tree-json
🩺 ParseDiagnoseOutputparse-diagnose-output
📦 ParseInstallOutputparse-install-output
📋 ParseStatusOutputparse-status-output
🔄 ParseUpdateOutputparse-update-output
🏷️ ParseVersionOutputparse-version-output
🚫 Prohibitprohibit
🚀 QuickSetupquick-setup
📄 ReadComposerJSONread-composer-json
♻️ Reinstallreinstall
🧪 RemoveDryRun 模拟移除包remove-dry-run
➖ Removeremove
➖ RemoveMultipleremove-multiple
🗑️ RemoveRepositoryremove-repository
🗑️ RemoveRequireremove-require
🧹 RemoveScriptremove-script
🧹 RemoveTokenremove-token
🧪 RequireDryRun 模拟添加包依赖require-dry-run
➕ RequireMultiplerequire-multiple
➕ RequirePackagerequire-package
📦 RequirePackageWithOptions 带自定义选项添加包依赖require-package-with-options
🛠️ Runrun
⚡ RunScriptrun-script
🌐 RunWithContextrun-with-context
⏱️ RunWithTimeoutrun-with-timeout
💾 SaveAuthConfigsave-auth-config
🔎 SearchInfosearch-info
🔎 Searchsearch
🔎 SearchOnlyNamesearch-only-name
🏷️ SearchWithTypesearch-with-type
🚀 SelfUpdateself-update
⚙️ SetConfigWithGlobalset-config-with-global
🌐 SetEnvVariableset-env-variable
💾 SetMemoryLimitset-memory-limit
📊 SetMinimumStabilityset-minimum-stability
🎯 SetPreferredInstallset-preferred-install
✅ SetPreferStableset-prefer-stable
⏱️ SetProcessTimeoutset-process-timeout
🔧 SetPropertyset-property
🔧 SetWorkingDirset-working-dir
📦 ShowAllPackagesshow-all-packages
🌳 ShowDependencyTreeshow-dependency-tree
✨ ShowPackageInfoshow-package-info
🔎 ShowPackageshow-package
🔗 ShowReverseDependenciesshow-reverse-dependencies
📊 Statusstatus
📈 StatusStructuredstatus-structured
💡 Suggestssuggests
🔍 UpdateDryRunupdate-dry-run
⚡ Updateupdate
🔄 UpdatePackageVersionupdate-package-version
🔗 UpdateWithDependenciesupdate-with-dependencies
🔒 UpdateWithLockupdate-with-lock
🛠️ UpdateWithOptionsupdate-with-options
🧪 ValidateComposerJsonvalidate-composer-json
🔒 ValidateComposerLockvalidate-composer-lock
✅ Validatevalidate
🔍 ValidateSchemavalidate-schema
✅ ValidateStrictvalidate-strict
🧪 ValidateStructuredvalidate-structured
🚫 WhyNotPackagewhy-not-package
❓ WhyPackagewhy-package
✍️ WriteComposerJSONwrite-composer-json

基于 MIT 许可证发布