← 返回
开发者工具 中文

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...
端口管理器 ‑ 跟踪并管理系统端口使用情况。使用场景: (1) 安装软件时端口冲突; (2) 查看端口占用情况; (3) 释放被占用的端口; (4…
damiencronw
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 504
下载
💾 5
安装
1
版本
#latest

概述

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
  1. Service startup recording
    • Record ports like 2375, 5432 when starting Docker
    • Quickly see which services should run after restart
  1. 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)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 06:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,842
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,727
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,791