@roblourens/dap-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rob Lourens
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # dap-cli
2
+
3
+ Give your agent debugging skills!
4
+
5
+ A command-line debugger built for AI agents. Drive any [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/) target — Node.js, Python, Chrome, custom adapters — from shell commands, with stable JSON output and `.vscode/launch.json` support.
6
+
7
+ ```bash
8
+ npm install -g dap-cli
9
+ ```
10
+
11
+ ## Why
12
+
13
+ Agents already know how to run shell commands. They don't know how to drive an IDE debugger. `dap-cli` closes that gap so an agent can:
14
+
15
+ - **Set breakpoints, step, and inspect variables** in any runtime with a DAP adapter — no ad-hoc `console.log` campaigns or re-building the program for every new question.
16
+ - **Reuse your `.vscode/launch.json` configs** — `dap-cli launch --config "Launch App"` runs the same configuration you'd pick from the Run and Debug picker in VS Code.
17
+ - **Coordinate with other tools like [`playwright-cli`](https://www.npmjs.com/package/@playwright/cli)** — Playwright drives the page, dap-cli polls the debugger, both attached to the same Chromium instance.
18
+
19
+ ## Install the CLI
20
+
21
+ ```bash
22
+ npm install -g dap-cli
23
+ dap-cli --version
24
+ ```
25
+
26
+ The first time the agent uses an adapter, dap-cli provisions it (js-debug binary; a Python venv with debugpy). See [docs/adapter-setup.md](docs/adapter-setup.md) for custom adapters and troubleshooting.
27
+
28
+ ## Install the agent skill
29
+
30
+ The repo includes an [Open Plugins](https://open-plugins.com/) plugin. The [SKILL.md](dap-cli/skills/dap-cli/SKILL.md) at the root teaches your agent how to use the CLI — common commands, the polling loop, breakpoint verification, and language-specific gotchas for `js-debug` and `debugpy`.
31
+
32
+ **VS Code (Copilot Chat agent mode):**
33
+
34
+ 1. Run **Chat: Install Plugin from Source**.
35
+ 2. Enter `roblourens/dap-cli`.
36
+
37
+ **Claude Code / Copilot CLI / other Open Plugins hosts:**
38
+
39
+ ```text
40
+ /plugin install roblourens/dap-cli
41
+ ```
42
+
43
+ ## Quick taste
44
+
45
+ The philosophy: drive the target with explicit commands, poll `status` for state changes, every reply is a JSON envelope. Pass `--human` for human-readable output.
46
+
47
+ ```bash
48
+ # launch a Node script paused at entry
49
+ dap-cli launch --program app.js --stop-on-entry
50
+
51
+ # set a breakpoint, continue, poll until paused
52
+ dap-cli breakpoints set --source app.js --line 12
53
+ dap-cli continue
54
+ dap-cli status
55
+
56
+ # inspect — IDs come from these calls, never guess
57
+ dap-cli stack
58
+ dap-cli scopes --frame-id 1000
59
+ dap-cli variables --variables-reference 1001
60
+ dap-cli evaluate --expression "user.email"
61
+ ```
62
+
63
+ ## Use your existing `launch.json`
64
+
65
+ If the project has `.vscode/launch.json`, run a config by name:
66
+
67
+ ```bash
68
+ # discover available configs (bare list, not envelope)
69
+ dap-cli launch --list-configs
70
+
71
+ # run a named config
72
+ dap-cli attach --config "Attach to App"
73
+
74
+ # layer extra fields onto a named config without abandoning it
75
+ dap-cli launch --config "Attach to App" \
76
+ --json-overrides '{"sourceMaps":true,"resolveSourceMapLocations":["**","!**/node_modules/**"]}'
77
+ ```
78
+
79
+ `--workspace` defaults to the current directory; pass it explicitly to point at a different repo. Compounds and most VS Code launch variables (`${workspaceFolder}`, `${env:NAME}`, etc.) are supported. See [docs/adapter-setup.md](docs/adapter-setup.md) for the full list.
80
+
81
+ ## Multiple sessions
82
+
83
+ dap-cli is able to be running several debug sessions at once. Pass `--name <session>` to target one explicitly; when omitted, commands act on the active session (the most recent one, or whatever was set with `dap-cli use <name>`).
84
+
85
+ ```bash
86
+ dap-cli launch --program api.js --name api
87
+ dap-cli launch --program worker.js --name worker
88
+ dap-cli status --name api
89
+ dap-cli close api
90
+ ```
91
+
92
+ ## Going deeper
93
+
94
+ Most of what an agent needs lives in [the SKILL.md](dap-cli/skills/dap-cli/SKILL.md). For longer-form material:
95
+
96
+ | Doc | What it covers |
97
+ |---|---|
98
+ | [docs/adapter-setup.md](docs/adapter-setup.md) | Built-in adapter readiness; configuring custom stdio / socket adapters; supported launch variables |
99
+ | [docs/playwright-interop.md](docs/playwright-interop.md) | Driving Chromium UI with `playwright-cli` while dap-cli polls — setup order, fixed CDP port, conditional breakpoints |
100
+
101
+ ## Building from source
102
+
103
+ ```bash
104
+ git clone https://github.com/roblourens/dap-cli
105
+ cd dap-cli
106
+ npm install
107
+ npm run build
108
+ node dist/index.js --version
109
+ ```
110
+
111
+ `npm run check` runs typecheck, lint, tests, and build.
112
+
113
+ ## License
114
+
115
+ MIT