jackwener / jackwener/OpenCLI

[Feature]: OPENCLI_CDP_ENDPOINT manager for multi-instance support / OPENCLI_CDP_ENDPOINT 多实例管理器

Open
#988 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
29.5k
Forks
2.9k
Avg merge
15h 36m
Merged PRs (30d)
70

Description

### Feature Description

OpenCLI currently centers on a single OPENCLI_CDP_ENDPOINT workflow. This is limiting for users running multiple CDP-enabled desktop apps
We need a built-in manager layer to launch, register, observe, and execute commands across instances.
Please add a lightweight manager for multiple endpoints/instances.

OpenCLI 目前以单个 OPENCLI_CDP_ENDPOINT 为主流程,这对多 CDP 桌面应用或同应用多实例场景不够友好。
需要内置管理层,用于启动、注册、观测并跨实例执行命令。
希望增加一个轻量的多端点/多实例管理器。

### Use Case

As a user, I run multiple Cursor instances and I want to launch any CDP-capable app and run OpenCLI commands per instance (or across all instances) without manually switching env vars each time.
This improves reliability, observability, and automation ergonomics.

作为用户,我会同时运行多个 Cursor 实例,可按实例或批量执行 OpenCLI 命令,而不是每次手动切环境变量。
这会显著提升可靠性、可观测性和自动化体验。

### Proposed Solution

Introduce a generic CDP instance-management layer in OpenCLI (not limited to Cursor). This layer should support:

standardized lifecycle management for CDP-enabled apps (launch, attach, detach, cleanup),
persistent instance registry and identity mapping,
instance-scoped and multi-instance command dispatch,
unified health/status observation with periodic polling,
safe-by-default networking and clear endpoint risk controls.

`opencli cdp list/start/exec`

在 OpenCLI 中引入通用的 CDP 实例管理层(不局限于 Cursor),支持:

对 CDP 应用的标准化生命周期管理(启动、连接、断开、清理),
持久化实例注册与标识映射,
按实例与跨实例的统一命令分发,
周期性轮询的健康状态与可观测性视图,
默认安全的网络策略与清晰的端点风险控制。

### Alternatives Considered

if we use **external scripts**: can rotate endpoints, but behavior is non-standard, brittle across OS/shell, and hard to share/reuse in teams.
Manual launch with debug port: repetitive, error-prone (port conflicts, wrong target), and discourages adoption.
No framework layer: keeps core simple, but pushes multi-instance complexity to every user, causing duplicated tooling.
Observability gap: without built-in monitor/health view, users cannot reliably know which instance is connected/active.

如果我们使用 **外部脚本方案**:可实现端点轮换,但跨系统/跨 shell 不稳定,团队复用困难。
手工启动+端口:重复操作多、易出错(端口冲突、目标选错),使用门槛高。
不做框架层:看似简单,但复杂度转嫁给用户,导致重复造轮子。
可观测性不足:缺少统一监控/健康视图,难以确认实例连接与活跃状态。

Contributor guide

Open the contributing guide

Research direction

Start by tracing the current single-OPENCLI_CDP_ENDPOINT workflow and the CLI entry points for the proposed `opencli cdp list/start/exec` commands. Clarify lifecycle, registry, dispatch, polling, and network-safety requirements before implementation. Done means multiple CDP instances can be launched, registered, observed, and targeted individually or together without manual environment switching.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.