Skip to content

Add VS Code extension for dev-process-manager - #177

Open
nsams with Copilot wants to merge 18 commits into
mainfrom
copilot/implement-vscode-plugin-socket
Open

Add VS Code extension for dev-process-manager#177
nsams with Copilot wants to merge 18 commits into
mainfrom
copilot/implement-vscode-plugin-socket

Conversation

Copilot AI commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a VS Code extension that connects to the dev-pm daemon socket to provide sidebar-based process management. Users currently need to switch to a terminal to check script status or run start/stop/restart commands — this extension surfaces that directly in the editor.

The extension lives in vscode-extension/ with its own package.json and tsconfig.json. No monorepo tooling needed — it's a self-contained subfolder.

What it provides:

  • TreeView in activity bar — shows all scripts with status, CPU, memory, PID, restart count. Auto-refreshes every 2s via the status socket command.
  • Inline actions — context-aware start/stop/restart buttons per script (e.g., "Start" only shown for stopped scripts)
  • Live log streaming — opens a VS Code Output Channel per script, streams logs via the logs socket command
  • Bulk actions — Start All / Stop All in the view title bar
  • Auto-discovery — finds .pm.sock in workspace folders, watches for socket creation/deletion

Communicates with the daemon using the existing plain-text socket protocol (<COMMAND> <JSON_OPTIONS>), parses the cli-table3 status output, and strips ANSI codes for clean display.

Example

Bildschirmfoto 2026-04-14 um 16 31 23

Related tasks and documents

Inspired by pm2-vscode and pm2-explorer.

Open TODOs/questions

  • Should the extension be published to the VS Code Marketplace under vivid-planet?
  • Consider adding a structured JSON status command to the daemon to avoid parsing cli-table3 output
  • The daemon currently sends ANSI-colored table output designed for terminals — a machine-readable protocol would be more robust for tooling consumers

Further information

Architecture:

  • daemon-client.ts — socket connection, command sending, status table parsing, ANSI stripping
  • scripts-tree-provider.tsTreeDataProvider with auto-refresh timer, status icons via ThemeIcon
  • extension.ts — activation, command registration, socket path discovery, log channel management

Build: cd vscode-extension && npm install && npm run compile

Package: cd vscode-extension && npm run package produces a .vsix

Copilot AI and others added 2 commits April 14, 2026 06:58
Implements a VS Code extension in vscode-extension/ subfolder that:
- Connects to the dev-pm daemon via Unix socket (.pm.sock)
- Shows script statuses in a TreeView with auto-refresh
- Provides start/stop/restart actions per script
- Opens live log streams in VS Code Output Channels
- Has Start All / Stop All bulk actions

Agent-Logs-Url: https://github.com/vivid-planet/dev-process-manager/sessions/3a1e6f9e-3767-4634-9ac4-9fddc51567e9

Co-authored-by: nsams <50764+nsams@users.noreply.github.com>
nsams added 4 commits April 14, 2026 09:41
Move table rendering from daemon to CLI client so the VS Code extension
can parse structured JSON directly. Add a version command to the daemon
and version compatibility checking in the extension with auto-reconnect
when the daemon goes down or restarts.
@nsams
nsams marked this pull request as ready for review April 14, 2026 14:41
@nsams
nsams requested a review from Fabian-Fynn April 14, 2026 14:42
Comment thread vscode-extension/src/scripts-tree-provider.ts Outdated
Comment thread vscode-extension/resources/icon.svg
Comment thread .changeset/rich-chairs-leave.md Outdated
@nsams
nsams force-pushed the copilot/implement-vscode-plugin-socket branch from 7ea9b42 to 8cf4255 Compare April 17, 2026 06:39
@nsams
nsams force-pushed the copilot/implement-vscode-plugin-socket branch from bf45eef to a146f45 Compare April 17, 2026 07:40
@Fabian-Fynn
Fabian-Fynn self-requested a review April 17, 2026 10:58
Fabian-Fynn
Fabian-Fynn previously approved these changes Apr 17, 2026
@netlify

netlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Preview for dev-process-manager canceled.

Name Link
🔨 Latest commit 7bca6b0
🔍 Latest deploy log https://app.netlify.com/projects/dev-process-manager/deploys/6a703584b54cd800085f18f8

@VPS-Fabi
VPS-Fabi requested review from VPS-Fabi and removed request for Fabian-Fynn July 21, 2026 09:12
VPS-Fabi
VPS-Fabi previously approved these changes Jul 21, 2026
nsams added a commit that referenced this pull request Jul 21, 2026
mainly in preparation for #177, but imho generally a better idea to use
a json protocol and render the table client side.

## Description

The status command previously rendered tables directly in the daemon
process and streamed the formatted output to the client. This approach
mixed presentation logic with daemon logic and made it difficult to
handle the status command differently from other commands.

This change separates concerns by:
1. Moving table rendering logic from the daemon to the client command
2. Having the daemon send structured JSON data instead of formatted text
3. Extracting script status data collection into a reusable
`getScriptEntries()` function
4. Exporting a new `ScriptStatusEntry` interface for type safety

Additionally, the `connect()` function's default data handler is
extracted into a new `pipeToStdout()` function, which is now explicitly
called by commands that need it (logs, restart, shutdown, start, stop).
This allows the status command to handle data differently without
affecting other commands.

**Benefits:**
- Cleaner separation between daemon and client concerns
- Status command can now parse and render data on the client side
- Easier to extend or modify status output formatting without touching
daemon code
- Other commands continue to work as before with explicit
`pipeToStdout()` calls

https://claude.ai/code/session_01Atpc7SdHY1FwGiMUyjXAMB

---------

Co-authored-by: Claude <noreply@anthropic.com>
nsams added a commit that referenced this pull request Jul 28, 2026
## Description

Add a new `version` command to the daemon that allows clients to query
the package version. This enables external tools and clients to
programmatically check the daemon's version without needing to parse
other outputs or access the filesystem directly.

The command reads the version from `package.json` and returns it as a
JSON response, consistent with the daemon's existing command response
format.

in preparation for #177 where we need to query the version

https://claude.ai/code/session_01HvmQcsv8ncXZ6E5KW4H6V8

Co-authored-by: Claude <noreply@anthropic.com>
@nsams

nsams commented Jul 30, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Copilot AI added 2 commits July 30, 2026 13:18
…ode-plugin-socket

# Conflicts:
#	.gitignore
#	src/commands/connect.ts
#	src/commands/logs.command.ts
#	src/commands/restart.command.ts
#	src/commands/start.command.ts
#	src/commands/status.command.ts
#	src/commands/stop.command.ts
#	src/daemon-command/script.ts
#	src/daemon-command/status.daemon-command.ts

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts in commit c05c3b7. The conflicts were mostly import style differences (import { type X } vs import type { X }) and the shared-types file location. I adopted main's import style, moved shared-types.d.ts into src/ to preserve the lib/ output structure, and included all new changes from main (tsconfig.tsbuildinfo in .gitignore, log-update v8 named export, TODO comment). Both builds and all 15 tests pass.

Copilot finished work on behalf of nsams July 30, 2026 13:21
Copilot AI requested a review from nsams July 30, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants