| Crates.io | port-claim |
| lib.rs | port-claim |
| version | 3.0.0 |
| created_at | 2025-03-20 23:16:35.40383+00 |
| updated_at | 2025-03-21 00:58:23.07448+00 |
| description | A tool to check if ports are in use and kill processes using them |
| homepage | |
| repository | https://github.com/jasenmichael/port-claim |
| max_upload_size | |
| id | 1599872 |
| size | 54,896 |
# Using npm
npm install -g port-claim
# Using pnpm
pnpm add -g port-claim
# Using npm
npm install port-claim --save-dev
# Using pnpm
pnpm add -D port-claim
Then add to your package.json scripts:
"scripts": {
"predev": "port-claim 3000",
"dev": "nuxt dev"
// "dev": "port-claim 3000 && nuxt dev"
}
# Install directly from crates.io
cargo install port-claim
# Or install from source
git clone https://github.com/jasenmichael/port-claim.git
cd port-claim
cargo install --path .
You can download pre-compiled binaries from the GitHub Releases page.
Available for:
port-claim -h | --help | -V | --version
port-claim <port> [<additional-ports>] [-v | --verbose]
-h, --help: Prints usage information-V, --version: Prints the version-v, --verbose: Prints verbose information about port status and process killing<port>: Required argument specifying the port to check and kill if in use[<additional-ports>]: Optional additional ports to check and kill# Check if port 8080 is in use and kill the process if it is
port-claim 8080
# Check multiple ports with verbose output
port-claim 3000 8080 9000 --verbose
# Display help information
port-claim --help
# Display version information
port-claim --version
--verbose flag, the tool will print information about each step of the process.The tool works on both Unix-based systems (Linux, macOS) and Windows, using different system commands to identify and kill processes on each platform.
# Clone the repository
git clone https://github.com/jasenmichael/port-claim.git
cd port-claim
# Install dependencies (for the npm wrapper)
npm install
# Build the Rust binary
cargo build --release
# Run tests
cargo test
# Format code
cargo fmt
# Lint code
cargo clippy