← 返回命令列表

Linux command

phive 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Install a PHAR tool

phive install [phpunit]

Pin to a specific version

phive install [phpunit@^9.5]

Install system-wide

phive install --copy --target [/usr/local/bin] [phpunit]

Show installed tools and available updates

phive status

Update all installed tools

phive update

List which tools are outdated

phive outdated

Remove a tool

phive remove [phpunit]

Update Phive itself

phive selfupdate

说明

phive — the PHAR Installation and Verification Environment — manages command-line PHP tools distributed as PHAR archives. It downloads PHARs from a trusted repository, verifies their GPG signatures, and records pinned versions in a project-local phive.xml so they can be reproducibly reinstalled. Typical usage is project-local: phive install phpunit writes the tool into tools/ in the current project. System-wide installs are performed by combining --copy and --target with a directory on $PATH.

参数

--copy
Copy the PHAR to the target location instead of symlinking it (needed for shared/system-wide installs).
--target _DIR_
Install the PHAR into _DIR_. Use this together with --copy for a global install (there is no --global flag).
--force-accept-unsigned
Accept PHARs that lack a valid GPG signature (not recommended).
--trust-gpg-keys _KEYIDS_
Pre-trust specific GPG key IDs without prompting.
--prefer-offline
Use cached metadata (useful with update).
--help
Display help.

FAQ

What is the phive command used for?

phive — the PHAR Installation and Verification Environment — manages command-line PHP tools distributed as PHAR archives. It downloads PHARs from a trusted repository, verifies their GPG signatures, and records pinned versions in a project-local phive.xml so they can be reproducibly reinstalled. Typical usage is project-local: phive install phpunit writes the tool into tools/ in the current project. System-wide installs are performed by combining --copy and --target with a directory on $PATH.

How do I run a basic phive example?

Run `phive install [phpunit]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --copy do in phive?

Copy the PHAR to the target location instead of symlinking it (needed for shared/system-wide installs).