搜索

PythonReactSEOPDF
OpenClaw

port-manager

Port Manager - Track and manage system port usage. Use when: (1) Port conflict when installing software, (2) Check port usage, (3) Release occupied ports, (4) List all recorded service ports

damiencronw0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install damiencronw/port-manager

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Port Manager Skill

Intelligently manage system port usage and avoid conflicts.

Features

1. Record Port (--record)

Record a port when starting a service:

Port record <service_name> <port>
Example: port record postgres 5432
2. Query Port (--query)

Check usage of a specific port:

Port query 5432
3. List All Ports (--list)

Show all recorded services and ports:

Port list
4. Free Port (--free)

Release an occupied port (terminate the process):

Port free 5432
5. Check and Resolve Conflicts (--check)

Check if a port is occupied, and ask user if they want to free it:

Port check 5432
6. Auto Port Allocation (--allocate)

When port is occupied, automatically allocate an available port:

Port allocate <service_name> [preferred_port]

File Location

  • Port records: ~/.openclaw/workspace/.port-manager/ports.json

Usage Scenarios

  1. Check before installing software

    • Check port 5432 before installing PostgreSQL
    • If occupied, ask user whether to free it
  2. Service startup recording

    • Record ports like 2375, 5432 when starting Docker
    • Quickly see which services should run after restart
  3. Port conflict resolution

    • Two services fighting for the same port
    • Auto-assign new port or free old port

Command Examples

# Record ports
port record mysql 3306
port record redis 6379
port record postgres 5432

# List all
port list

# Check port
port check 8080

# Free port
port free 5432

# Auto allocate
port allocate nginx 80

Implementation

Use lsof and netstat to check ports:

# Check port usage
lsof -i :5432

# Kill process
kill $(lsof -t -i :5432)

来源信息

Source
github
Repository
openclaw/skills
Path
skills/damiencronw/port-manager
Version
—
Commit
3bfa8c7b137c021f0e6a7eb706680648b9b2c097
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# Port Manager Skill

Intelligently manage system port usage and avoid conflicts.

## Features

### 1. Record Port (--record)
Record a port when starting a service:
```
Port record <service_name> <port>
Example: port record postgres 5432
```

### 2. Query Port (--query)
Check usage of a specific port:
```
Port query 5432
```

### 3. List All Ports (--list)
Show all recorded services and ports:
```
Port list
```

### 4. Free Port (--free)
Release an occupied port (terminate the process):
```
Port free 5432
```

### 5. Check and Resolve Conflicts (--check)
Check if a port is occupied, and ask user if they want to free it:
```
Port check 5432
```

### 6. Auto Port Allocation (--allocate)
When port is occupied, automatically allocate an available port:
```
Port allocate <service_name> [preferred_port]
```

## File Location

- Port records: `~/.openclaw/workspace/.port-manager/ports.json`

## Usage Scenarios

1. **Check before installing software**
   - Check port 5432 before installing PostgreSQL
   - If occupied, ask user whether to free it

2. **Service startup recording**
   - Record ports like 2375, 5432 when starting Docker
   - Quickly see which services should run after restart

3. **Port conflict resolution**
   - Two services fighting for the same port
   - Auto-assign new port or free old port

## Command Examples

```bash
# Record ports
port record mysql 3306
port record redis 6379
port record postgres 5432

# List all
port list

# Check port
port check 8080

# Free port
port free 5432

# Auto allocate
port allocate nginx 80
```

## Implementation

Use `lsof` and `netstat` to check ports:
```bash
# Check port usage
lsof -i :5432

# Kill process
kill $(lsof -t -i :5432)
```

相关技能

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.