← 返回命令列表

Linux command

needs 命令

文本

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

常用示例

Check if tools are installed and show their versions

needs [tool1] [tool2] [tool3]

Check without retrieving version information

needs --no-versions [tool1] [tool2]

Show full version strings instead of short versions

needs --full-versions [tool1] [tool2]

Run quietly, only reporting via exit code

needs -q [tool1] [tool2]

Check with verbose logging

needs -vvv [tool1] [tool2]

说明

needs is a CLI tool that verifies whether specified executables are installed on a system and optionally retrieves their version information. It runs checks using multi-threaded execution for speed, provides colored output, and supports pipe-friendly output. Binary names can be provided as command-line arguments or listed in a `needsfile` (one or more binaries per line). Exit codes indicate whether all required tools are present (0 for success, 1 for missing), making it suitable for use in scripts and CI pipelines.

参数

-n, --no-versions
Skip version checks, only verify that binaries exist.
-f, --full-versions
Show the full version string for each binary instead of a shortened version.
-q, --quiet
Stay quiet, only communicate results via exit code (0 if all found, 1 if any missing).
-v, --verbosity
Increase verbosity level. Can be repeated for more detail (e.g., -vvv for logs, -vvvv for timing info).
--help
Display help information.
--version
Show the version of needs itself.

FAQ

What is the needs command used for?

needs is a CLI tool that verifies whether specified executables are installed on a system and optionally retrieves their version information. It runs checks using multi-threaded execution for speed, provides colored output, and supports pipe-friendly output. Binary names can be provided as command-line arguments or listed in a `needsfile` (one or more binaries per line). Exit codes indicate whether all required tools are present (0 for success, 1 for missing), making it suitable for use in scripts and CI pipelines.

How do I run a basic needs example?

Run `needs [tool1] [tool2] [tool3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -n, --no-versions do in needs?

Skip version checks, only verify that binaries exist.