dx-devkit 0.0.0-stage → 1.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/CHANGELOG.md +81 -0
- package/LICENSE +21 -0
- package/README.md +475 -2
- package/bin/dx-mcp.js +2 -0
- package/dist/command.d.ts +9 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +2 -0
- package/dist/command.js.map +1 -0
- package/dist/commands/ai.d.ts +7 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +148 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/clean.d.ts +3 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +72 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/deps.d.ts +3 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +98 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/go.d.ts +3 -0
- package/dist/commands/go.d.ts.map +1 -0
- package/dist/commands/go.js +202 -0
- package/dist/commands/go.js.map +1 -0
- package/dist/commands/log.d.ts +3 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +51 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/new.d.ts +3 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +117 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/port.d.ts +4 -0
- package/dist/commands/port.d.ts.map +1 -0
- package/dist/commands/port.js +106 -0
- package/dist/commands/port.js.map +1 -0
- package/dist/commands/projects.d.ts +5 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +46 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/stack.d.ts +34 -0
- package/dist/commands/stack.d.ts.map +1 -0
- package/dist/commands/stack.js +140 -0
- package/dist/commands/stack.js.map +1 -0
- package/dist/commands/summary.d.ts +3 -0
- package/dist/commands/summary.d.ts.map +1 -0
- package/dist/commands/summary.js +88 -0
- package/dist/commands/summary.js.map +1 -0
- package/dist/commands/system.d.ts +5 -0
- package/dist/commands/system.d.ts.map +1 -0
- package/dist/commands/system.js +104 -0
- package/dist/commands/system.js.map +1 -0
- package/dist/commands/ui.d.ts +3 -0
- package/dist/commands/ui.d.ts.map +1 -0
- package/dist/commands/ui.js +96 -0
- package/dist/commands/ui.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/dist/ui.d.ts +27 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +104 -0
- package/dist/ui.js.map +1 -0
- package/node_modules/@dx/core/dist/config.d.ts +46 -0
- package/node_modules/@dx/core/dist/config.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/config.js +131 -0
- package/node_modules/@dx/core/dist/config.js.map +1 -0
- package/node_modules/@dx/core/dist/fuzzy.d.ts +15 -0
- package/node_modules/@dx/core/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/fuzzy.js +63 -0
- package/node_modules/@dx/core/dist/fuzzy.js.map +1 -0
- package/node_modules/@dx/core/dist/index.d.ts +17 -0
- package/node_modules/@dx/core/dist/index.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/index.js +19 -0
- package/node_modules/@dx/core/dist/index.js.map +1 -0
- package/node_modules/@dx/core/dist/runs.d.ts +19 -0
- package/node_modules/@dx/core/dist/runs.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/runs.js +41 -0
- package/node_modules/@dx/core/dist/runs.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.d.ts +58 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.js +243 -0
- package/node_modules/@dx/core/dist/tools/aiSetup.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/cleanup.d.ts +61 -0
- package/node_modules/@dx/core/dist/tools/cleanup.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/cleanup.js +171 -0
- package/node_modules/@dx/core/dist/tools/cleanup.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/deps.d.ts +57 -0
- package/node_modules/@dx/core/dist/tools/deps.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/deps.js +151 -0
- package/node_modules/@dx/core/dist/tools/deps.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/devErrors.d.ts +74 -0
- package/node_modules/@dx/core/dist/tools/devErrors.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/devErrors.js +261 -0
- package/node_modules/@dx/core/dist/tools/devErrors.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/doctor.d.ts +12 -0
- package/node_modules/@dx/core/dist/tools/doctor.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/doctor.js +176 -0
- package/node_modules/@dx/core/dist/tools/doctor.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/github.d.ts +31 -0
- package/node_modules/@dx/core/dist/tools/github.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/github.js +80 -0
- package/node_modules/@dx/core/dist/tools/github.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/journal.d.ts +23 -0
- package/node_modules/@dx/core/dist/tools/journal.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/journal.js +80 -0
- package/node_modules/@dx/core/dist/tools/journal.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/launch.d.ts +24 -0
- package/node_modules/@dx/core/dist/tools/launch.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/launch.js +137 -0
- package/node_modules/@dx/core/dist/tools/launch.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/ports.d.ts +42 -0
- package/node_modules/@dx/core/dist/tools/ports.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/ports.js +220 -0
- package/node_modules/@dx/core/dist/tools/ports.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/projects.d.ts +58 -0
- package/node_modules/@dx/core/dist/tools/projects.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/projects.js +208 -0
- package/node_modules/@dx/core/dist/tools/projects.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/scaffold.d.ts +40 -0
- package/node_modules/@dx/core/dist/tools/scaffold.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/scaffold.js +188 -0
- package/node_modules/@dx/core/dist/tools/scaffold.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/stacks.d.ts +119 -0
- package/node_modules/@dx/core/dist/tools/stacks.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/stacks.js +386 -0
- package/node_modules/@dx/core/dist/tools/stacks.js.map +1 -0
- package/node_modules/@dx/core/dist/tools/summary.d.ts +87 -0
- package/node_modules/@dx/core/dist/tools/summary.d.ts.map +1 -0
- package/node_modules/@dx/core/dist/tools/summary.js +331 -0
- package/node_modules/@dx/core/dist/tools/summary.js.map +1 -0
- package/node_modules/@dx/core/package.json +20 -0
- package/node_modules/@dx/mcp/dist/index.d.ts +3 -0
- package/node_modules/@dx/mcp/dist/index.d.ts.map +1 -0
- package/node_modules/@dx/mcp/dist/index.js +540 -0
- package/node_modules/@dx/mcp/dist/index.js.map +1 -0
- package/node_modules/@dx/mcp/package.json +8 -0
- package/node_modules/@dx/web/dist/api.d.ts +13 -0
- package/node_modules/@dx/web/dist/api.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/api.js +351 -0
- package/node_modules/@dx/web/dist/api.js.map +1 -0
- package/node_modules/@dx/web/dist/background.d.ts +2 -0
- package/node_modules/@dx/web/dist/background.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/background.js +24 -0
- package/node_modules/@dx/web/dist/background.js.map +1 -0
- package/node_modules/@dx/web/dist/check.d.ts +39 -0
- package/node_modules/@dx/web/dist/check.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/check.js +97 -0
- package/node_modules/@dx/web/dist/check.js.map +1 -0
- package/node_modules/@dx/web/dist/dev.d.ts +109 -0
- package/node_modules/@dx/web/dist/dev.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/dev.js +645 -0
- package/node_modules/@dx/web/dist/dev.js.map +1 -0
- package/node_modules/@dx/web/dist/link.d.ts +45 -0
- package/node_modules/@dx/web/dist/link.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/link.js +150 -0
- package/node_modules/@dx/web/dist/link.js.map +1 -0
- package/node_modules/@dx/web/dist/proxy.d.ts +21 -0
- package/node_modules/@dx/web/dist/proxy.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/proxy.js +140 -0
- package/node_modules/@dx/web/dist/proxy.js.map +1 -0
- package/node_modules/@dx/web/dist/server.d.ts +33 -0
- package/node_modules/@dx/web/dist/server.d.ts.map +1 -0
- package/node_modules/@dx/web/dist/server.js +184 -0
- package/node_modules/@dx/web/dist/server.js.map +1 -0
- package/node_modules/@dx/web/package.json +26 -0
- package/node_modules/@dx/web/public/app.js +1553 -0
- package/node_modules/@dx/web/public/icon.svg +1 -0
- package/node_modules/@dx/web/public/index.html +47 -0
- package/node_modules/@dx/web/public/styles.css +1124 -0
- package/package.json +52 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Notable changes to dx, newest first. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 1.1.0 (2026-11-03)
|
|
8
|
+
|
|
9
|
+
Your AI coding agent can now run your app and see what it does, whole stacks start with one command at readable `.localhost` addresses, and nothing needs setting up. Install it with `npm install -g dx-devkit`.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Published on npm as `dx-devkit`**: one global install gives the `dx` command, the dashboard and the MCP server.
|
|
14
|
+
- **Stacks**: a project's front end, API, workers and databases start together, in order, with one command or button (`dx up`, `dx go`, Run, or an AI agent's `start_dev_server`).
|
|
15
|
+
- **Found with no configuration** from:
|
|
16
|
+
- Procfiles;
|
|
17
|
+
- turbo, nx, concurrently, npm-run-all or lerna dev scripts, with their output split back into services;
|
|
18
|
+
- `dev:*` scripts;
|
|
19
|
+
- npm, yarn and pnpm workspaces;
|
|
20
|
+
- databases in docker-compose.
|
|
21
|
+
- **Order**: databases first, then back ends, then front ends. A service whose dependency failed isn't started.
|
|
22
|
+
- **Addresses passed along** as `DX_<SERVICE>_URL` and `DX_<SERVICE>_PUBLIC_URL`.
|
|
23
|
+
- **Two repositories**: `set_stack` (MCP) or `"stack"` in `.devrc.json` define a stack dx can't guess.
|
|
24
|
+
- **Local domains**: running apps at `http://<project>.localhost`, stack services at `http://<service>.<project>.localhost`, and the dashboard at `http://dx.localhost`.
|
|
25
|
+
- **Nothing to set up**: browsers resolve `*.localhost` by themselves.
|
|
26
|
+
- **Live reload works**: WebSockets pass through, and redirects are rewritten.
|
|
27
|
+
- **Port**: 80, or 1355 when 80 isn't available.
|
|
28
|
+
- **Dashboard**:
|
|
29
|
+
- A stack shows as one card, with a row per service (status, address, errors) and their combined output labelled by service, with a filter.
|
|
30
|
+
- Errors show which service they came from.
|
|
31
|
+
- **`dx up` and `dx down`** start and stop a stack in the background.
|
|
32
|
+
- **`dx doctor`** checks Docker (when a stack needs it) and whether local domains got port 80, with fixes.
|
|
33
|
+
- **Project detection**: projects with only a Gemfile, a Procfile or a compose file are found too.
|
|
34
|
+
- **AI agents can run your app and see what it does.** Nine new MCP tools:
|
|
35
|
+
- `start_dev_server` waits until the app is ready and reports its URL, errors and output.
|
|
36
|
+
- `wait_for_rebuild` says whether an edit added or fixed errors.
|
|
37
|
+
- `check_url` requests a page and returns what the server logged while answering.
|
|
38
|
+
- `dev_errors` and `dev_logs` read errors and output.
|
|
39
|
+
- `dev_servers`, `stop_dev_server` and `restart_dev_server` list, stop and restart servers.
|
|
40
|
+
- `dx_setup_check` gives each setup problem with its fix.
|
|
41
|
+
- **Error detection in dev server output**:
|
|
42
|
+
- TypeScript, Vite, esbuild, webpack and Next.js, Node stack traces and syntax errors, Python tracebacks, Go errors and panics.
|
|
43
|
+
- Each error has its file and line and a repeat count, and is cleared once the server rebuilds cleanly.
|
|
44
|
+
- **Dashboard**:
|
|
45
|
+
- Each dev server shows its errors; clicking an error's file opens your editor at that line.
|
|
46
|
+
- A "Started by AI" label marks servers an agent started.
|
|
47
|
+
- The Health page shows which AI tools are connected, with buttons, and how to fix each failed check.
|
|
48
|
+
- **No setup**:
|
|
49
|
+
- On first use dx finds your code folders and editor, and connects itself to Claude Code, Claude Desktop, Cursor, Windsurf and VS Code, whichever are installed.
|
|
50
|
+
- AI tools start the dashboard in the background when they need it; it stops itself when idle.
|
|
51
|
+
- **New commands**:
|
|
52
|
+
- `dx setup` (`--list`, `--undo`) manages the AI tool connections.
|
|
53
|
+
- `dx logs <project> -f` follows a server's output.
|
|
54
|
+
- `dx errors` lists current errors.
|
|
55
|
+
- `dx ui --background` and `dx ui --stop` start and stop the dashboard without a terminal.
|
|
56
|
+
- **Better `dx doctor`**: each problem now comes with how to fix it.
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- `dx ui` opens the running dashboard instead of starting a second one.
|
|
61
|
+
- On a new install, the default projects folder is the code folders dx finds, rather than `~/Desktop/projects`.
|
|
62
|
+
|
|
63
|
+
## 1.0.0 (2026-11-03)
|
|
64
|
+
|
|
65
|
+
The first public release, on GitHub only (its git tag is `v0.1.0`).
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- **The dashboard, `dx ui`**: a local web interface with eight pages: Projects, New project, Ports, Journal, Summary, Cleanup, Dependencies, and Health & settings. Dev servers run inside it, with live output.
|
|
70
|
+
- **The `dx` command**:
|
|
71
|
+
- `go` opens a project, starts its dev server and opens the browser.
|
|
72
|
+
- `new` creates a project from a template or a copy of another.
|
|
73
|
+
- `projects`, `port` and `kill` list projects and free ports.
|
|
74
|
+
- `log` keeps a work journal.
|
|
75
|
+
- `summary` reports your week: commits, pull requests, journal, where the time went, uncommitted work.
|
|
76
|
+
- `clean` deletes `node_modules` and build folders in idle projects.
|
|
77
|
+
- `deps` lists outdated packages and vulnerabilities across projects.
|
|
78
|
+
- `config`, `runs` and `doctor` cover settings and setup.
|
|
79
|
+
- **An MCP server** with nine tools, so Claude and other AI tools can list and open projects, free ports, write and read the journal, summarise your week, and check cleanup and dependencies.
|
|
80
|
+
- **A Raycast extension** with Open Project, Kill Port, Log Work and Work Journal. It's an early preview that hasn't been tested in Raycast yet.
|
|
81
|
+
- **Windows, macOS and Linux support**, tested in CI with Node 22 and 24.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dx-toolkit contributors
|
|
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
CHANGED
|
@@ -1,3 +1,476 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dx toolkit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Your projects, dev servers, ports, work journal and weekly summary in one place: a local dashboard, a `dx` command, and tools your AI assistant can call. Runs on Windows, macOS and Linux.
|
|
4
|
+
|
|
5
|
+
**Your AI coding agent can run your app and see what it does.** Claude Code, Cursor and the others start the dev server through dx, read its output, see compile errors and stack traces with their file and line, request pages, and check that a fix worked, while you watch the same server in the dashboard. dx connects itself to the AI tools on your computer: there's nothing to configure.
|
|
6
|
+
|
|
7
|
+
<picture>
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="docs/images/projects-light.png">
|
|
9
|
+
<img alt="The dx dashboard's Projects page: a running stack called shop, with its api and web services at api.shop.localhost and web.shop.localhost; a todo-app dev server marked Started by AI with 1 error; and the project list below." src="docs/images/projects.png">
|
|
10
|
+
</picture>
|
|
11
|
+
|
|
12
|
+
Each tool is written once in `packages/core` and can be used four ways:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
packages/core the tools (projects, ports, journal, …), plain Node, no dependencies
|
|
16
|
+
├── packages/web → the dashboard in your browser: `dx ui`
|
|
17
|
+
├── packages/cli → `dx` in any terminal, VS Code included
|
|
18
|
+
├── packages/raycast → Raycast commands with hotkeys
|
|
19
|
+
└── packages/mcp → Claude (Desktop / Code) and Raycast AI can call the tools
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Everything dx stores is in one folder: `~/.dx` (`C:\Users\<you>\.dx`).
|
|
23
|
+
|
|
24
|
+
| File | What it is |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `config.json` | Settings: where your projects are, which editor to open |
|
|
27
|
+
| `journal.md` | Your work journal, plain markdown, edit it by hand any time |
|
|
28
|
+
| `runs.jsonl` | One line per tool run, so a failure is never silent (`dx runs`) |
|
|
29
|
+
| `summaries/` | Saved work summaries, one markdown file per day you ran `dx summary --save` |
|
|
30
|
+
| `templates/` | Your project templates for `dx new`, one folder each |
|
|
31
|
+
| `dashboard.json` | While the dashboard runs: its address and access token, readable by you only, so the `dx` command and AI tools can reach it |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Setup
|
|
36
|
+
|
|
37
|
+
dx runs on **Windows, macOS and Linux**. You need **Node 22 or newer** (`node -v`) and git. Then, in a terminal (PowerShell on Windows):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install -g dx-devkit
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
dx ui
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That's all. The first time you use dx it sets itself up:
|
|
48
|
+
- **Your projects**: it looks in the usual code folders (`~/projects`, `~/code`, `~/dev`, `~/src`, `~/repos`, `~/Documents/GitHub`, `~/Desktop/projects` and similar) and uses the ones you have.
|
|
49
|
+
- **Your editor**: the first of VS Code, Cursor, Windsurf, Zed, Sublime Text or JetBrains it finds.
|
|
50
|
+
- **Your AI tools**: it adds itself to Claude Code, Claude Desktop, Cursor, Windsurf and VS Code, whichever are installed, and says so. A tool you install later is connected the next time the dashboard starts. `dx setup --undo` takes it all back.
|
|
51
|
+
|
|
52
|
+
Projects somewhere else? `dx config add-root <folder>`, or add the folder on the dashboard's Health page. `dx doctor` checks everything and says how to fix what isn't right; your AI tool can run the fixes for you (ask it to "check dx's setup").
|
|
53
|
+
|
|
54
|
+
- **macOS and Linux**: if `npm install -g` fails with a permissions error, your global npm folder belongs to root. Use a Node version manager (nvm, fnm, Volta) rather than `sudo`.
|
|
55
|
+
- **Linux**: `dx port` and `dx kill` need `lsof` (`sudo apt install lsof` or your distro's equivalent). Copying a summary needs `wl-copy` or `xclip`, and "open in a terminal window" uses `x-terminal-emulator`.
|
|
56
|
+
- **macOS**: "open in a terminal window" uses Terminal.app; the first time, macOS asks whether your terminal may control it.
|
|
57
|
+
|
|
58
|
+
> If you switch Node versions with nvm, install dx again on the new version; dx repoints your AI tools at it the next time the dashboard starts.
|
|
59
|
+
|
|
60
|
+
**Updating**: `npm install -g dx-devkit@latest`. **Removing**: `dx setup --undo` (takes dx out of your AI tools), then `npm uninstall -g dx-devkit`; your settings and journal stay in `~/.dx`.
|
|
61
|
+
|
|
62
|
+
**From source**, to change dx itself: clone this repository, then run `npm install`, `npm run build` and `npm run link` in it. [CONTRIBUTING.md](CONTRIBUTING.md) has the rest.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## The dashboard: `dx ui`
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
dx ui
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
It opens the dx dashboard in your browser, where everything `dx` does is a button:
|
|
73
|
+
|
|
74
|
+
| Page | What you can do there |
|
|
75
|
+
|---|---|
|
|
76
|
+
| **Projects** | Search your projects; **Run** a dev server right in the page and watch its output live, open it in the browser when it's ready, **Stop** it; see its **errors** with file and line, and open your editor at that line; see servers your AI agent started; open a project in your editor, in a terminal window or in File Explorer; save one as a template |
|
|
77
|
+
| **New project** | Create a project from a template or a copy of another, with git and packages installed |
|
|
78
|
+
| **Ports** | See what's listening and stop it (it asks first, naming the process) |
|
|
79
|
+
| **Journal** | Add what you did, read back 7, 30 or 90 days |
|
|
80
|
+
| **Summary** | Your week: commits, pull requests, journal, where the time went, uncommitted work; copy it as markdown or save it |
|
|
81
|
+
| **Cleanup** | See which `node_modules` and build folders can go, pick them, delete them (it asks first) |
|
|
82
|
+
| **Dependencies** | Run the audit across all projects with a progress bar; open a row for its outdated packages |
|
|
83
|
+
| **Health & settings** | `dx doctor`'s checks with how to fix each problem, which AI tools are connected (with Connect and Disconnect buttons), your projects folders, editor and GitHub username, and recent activity |
|
|
84
|
+
|
|
85
|
+
| Summary | Cleanup |
|
|
86
|
+
|---|---|
|
|
87
|
+
|  |  |
|
|
88
|
+
|
|
89
|
+
- **It runs on your computer only**, at `http://dx.localhost` (or `http://127.0.0.1:4646`). Every action needs a secret the page gets when it loads, so other websites can't use it.
|
|
90
|
+
- **It's started for you when needed.** When an AI tool asks dx to run a dev server, dx starts the dashboard in the background; `dx ui` then just opens it. A background dashboard stops itself after 30 minutes with no dev servers running and nobody using it. `dx ui --stop` stops it now.
|
|
91
|
+
- **Dev servers you start from the dashboard stop when the dashboard stops**, like a dev server stops when you close its terminal. For one that keeps running, use **More → Run in a terminal window**.
|
|
92
|
+
- Light and dark follow your system, or pick one at the bottom of the sidebar. It works on a phone-sized window too.
|
|
93
|
+
- `dx ui --port 5000` uses another port; `dx ui --no-open` doesn't open the browser. From the project folder, `npm run ui` does the same as `dx ui`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Stacks and local domains
|
|
98
|
+
|
|
99
|
+
**A stack is everything an app needs running**: its front end, API, worker and database. dx finds it by itself, starts every part in order, and serves each one at a readable address:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
dx up shop
|
|
103
|
+
```
|
|
104
|
+
```
|
|
105
|
+
postgres ready http://localhost:5432
|
|
106
|
+
api ready http://api.shop.localhost
|
|
107
|
+
web ready http://web.shop.localhost
|
|
108
|
+
✓ shop is up at http://shop.localhost
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**How dx finds a stack**, with nothing to configure:
|
|
112
|
+
|
|
113
|
+
| The project has | dx runs |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `Procfile.dev` or `Procfile` | one service per line, with `PORT` set like foreman does |
|
|
116
|
+
| a root `dev` script that runs turbo, nx, concurrently, npm-run-all or lerna | that one command, as the project intends; its output is split back into services by the prefixes those tools print |
|
|
117
|
+
| root scripts `dev:web`, `dev:api`, … | each one as a service |
|
|
118
|
+
| npm, yarn or pnpm workspaces whose packages have a `dev` script | each package, in its own folder |
|
|
119
|
+
| databases in `docker-compose.yml` (postgres, mysql, mongo, redis, …) | `docker compose up -d` for them, first; services built from your own code are left to run natively |
|
|
120
|
+
| a `stack` in `.devrc.json` | exactly that: see below |
|
|
121
|
+
|
|
122
|
+
- **Start order**: databases first, then back ends (`api`, `server`, `worker`, …), then front ends, each group only once the one before is ready. A service whose dependency failed isn't started, and the dashboard says so.
|
|
123
|
+
- **Addresses passed along**: each service gets the others' addresses as environment variables: `DX_API_URL` (direct, for server code) and `DX_API_PUBLIC_URL` (the `.localhost` one, for the browser).
|
|
124
|
+
- **One place to watch**: in the dashboard a stack is one card, with a row per service (status, address, errors) and their output combined, labelled by service, with a filter. In the terminal, `dx go shop` follows it the same way, and Ctrl+C stops it all.
|
|
125
|
+
- **Two repositories**, such as `shop-web` and `shop-api`, can't be guessed safely. Ask your AI tool to "run shop-web together with shop-api": it uses the `set_stack` tool to write the stack for you. Or write it yourself (below).
|
|
126
|
+
|
|
127
|
+
**Local domains**: every running app is also at `http://<project>.localhost`, and each stack service at `http://<service>.<project>.localhost`, so you don't need to remember port numbers, and ports clashing stops mattering.
|
|
128
|
+
- **No setup**: browsers send every `*.localhost` name to your own computer. There's no hosts file to edit.
|
|
129
|
+
- **Live reload keeps working**: WebSocket connections pass through. Redirects to `localhost:<port>` are rewritten to the `.localhost` address.
|
|
130
|
+
- **Port 80, or a fallback**: dx serves these on port 80 when it can. When something else has port 80 (or on Linux, where it needs one system setting), it uses port 1355, and the addresses become `shop.localhost:1355`. `dx doctor` says which one and how to get 80; your AI tool can apply that fix for you.
|
|
131
|
+
- **Safety**: it listens on your computer only, and forwards only to dev servers dx is running. Any other name gets a "not a dx address" page.
|
|
132
|
+
- **Off**: set `"localDomains": false` in `~/.dx/config.json` to turn it off.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## The `dx` command
|
|
137
|
+
|
|
138
|
+
| Command | What it does |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `dx ui` | The dashboard: everything below, with buttons, in your browser |
|
|
141
|
+
| `dx ui --background` / `dx ui --stop` | Start it without a terminal / stop it and the dev servers it runs |
|
|
142
|
+
| `dx up shop` / `dx down shop` | Start a project's whole stack in the background, and print its addresses / stop it |
|
|
143
|
+
| `dx logs todo-app -f` | Follow the output of a dev server running in the dashboard, one your AI agent started included |
|
|
144
|
+
| `dx errors` | Errors in every running dev server, with file and line (`dx errors todo-app` for one) |
|
|
145
|
+
| `dx setup` | Connect dx to your AI tools (it does this by itself; `--list` shows them, `--undo` removes dx from them) |
|
|
146
|
+
| `dx go todo-app` | Open the project in your editor, start its dev server here (its whole stack, if it has one), open the browser when it's ready |
|
|
147
|
+
| `dx go todo-app -w` | Same, but the dev server runs in a new terminal window |
|
|
148
|
+
| `dx go` | Pick from your most recently active projects |
|
|
149
|
+
| `dx go .` | The project in the current folder |
|
|
150
|
+
| `dx new vite-app shop` | New project `shop` from a template or a copy of a project, then open it |
|
|
151
|
+
| `dx projects` / `dx ls flam` | List projects (most recent first) / search them |
|
|
152
|
+
| `dx port` | Every listening port 1024+, with the process and its command line |
|
|
153
|
+
| `dx port 3000` | What's on port 3000 |
|
|
154
|
+
| `dx kill 3000` | Kill it (asks first; `-y` skips the question) |
|
|
155
|
+
| `dx log "fixed seat map overflow"` | Add a line to your work journal |
|
|
156
|
+
| `dx log` / `dx log --days 30` | Read the journal back |
|
|
157
|
+
| `dx summary` | Your commits across all projects plus your journal for the last 7 days, as markdown |
|
|
158
|
+
| `dx summary --copy` / `--save` | Copy it to the clipboard / save it to `~/.dx/summaries/` |
|
|
159
|
+
| `dx clean` | Delete `node_modules` and build folders in projects idle for 30+ days (asks first) |
|
|
160
|
+
| `dx deps` | Outdated packages and known vulnerabilities in every Node project |
|
|
161
|
+
| `dx runs` / `dx runs --failed` | Recent tool runs |
|
|
162
|
+
| `dx config` | Show settings; `dx config edit`, `dx config add-root <folder>`, `dx config editor <cmd>`, `dx config github <user>` |
|
|
163
|
+
| `dx doctor` | Check the setup |
|
|
164
|
+
|
|
165
|
+
`dx help <command>` shows every option.
|
|
166
|
+
|
|
167
|
+
**`dx go` details:**
|
|
168
|
+
- It reads the dev command from `package.json` (`dev`, then `start`, `serve`) and uses the right package manager (npm, pnpm, yarn, bun).
|
|
169
|
+
- If the port is already taken by this project's own server, it just opens the browser.
|
|
170
|
+
- If the port is taken by something else, it offers to kill it.
|
|
171
|
+
- Ctrl+C stops the server as usual.
|
|
172
|
+
|
|
173
|
+
**`dx summary` details:**
|
|
174
|
+
- It reads `git log` in every project that's a git repo (all branches, merges left out) and your journal, for the last 7 days with today included. `--days 1` is just today, for a standup.
|
|
175
|
+
- Only your commits count: the ones made under the `user.name` or `user.email` git has for that repo. `--all-authors` counts everyone's.
|
|
176
|
+
- Commits are listed per project, oldest first, with each message once even if you committed it several times.
|
|
177
|
+
- A repo git can't read is skipped with a warning instead of failing the whole summary.
|
|
178
|
+
- **Pull requests**: the ones you merged and the ones you reviewed on GitHub. Your username comes from `dx config github <user>`, or is guessed from your repos' GitHub remotes. Without a token only public repos are searched; for private ones set `GITHUB_TOKEN` (a fine-grained token with read access to pull requests), or install the GitHub CLI and run `gh auth login`. `--no-github` skips this.
|
|
179
|
+
- **Where the time went**: per project, the days you committed or opened it with `dx go`, and how long its dev server ran when `dx go` ran it in the same terminal.
|
|
180
|
+
- **Not committed yet**: projects active in the period with changes you haven't committed. It's a reminder for you; delete the section before sending if you like.
|
|
181
|
+
|
|
182
|
+
**Every Thursday, automatically:** these save the summary at 4 pm each Thursday. Run them once, after installing dx; they find where npm put it. The file lands in `~/.dx/summaries/<date>.md`, and `dx runs` shows whether it ran.
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
<summary><b>Windows</b>: Task Scheduler. If the computer is off or asleep at 4 pm, it runs as soon as it's back on.</summary>
|
|
186
|
+
|
|
187
|
+
```powershell
|
|
188
|
+
$script = Join-Path (npm root -g) "dx-devkit\dist\index.js"
|
|
189
|
+
$action = New-ScheduledTaskAction -Execute (Get-Command node).Source -Argument "`"$script`" summary --save"
|
|
190
|
+
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Thursday -At 4pm
|
|
191
|
+
$settings = New-ScheduledTaskSettingsSet -StartWhenAvailable
|
|
192
|
+
Register-ScheduledTask -TaskName "dx weekly summary" -Action $action -Trigger $trigger -Settings $settings
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
To remove it: `Unregister-ScheduledTask -TaskName "dx weekly summary"`.
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary><b>macOS</b>: a launchd agent. If the Mac is asleep at 4 pm, it runs when it wakes; if it's shut down, that week is skipped.</summary>
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cat > ~/Library/LaunchAgents/dev.dx.weekly-summary.plist <<EOF
|
|
203
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
204
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
205
|
+
<plist version="1.0"><dict>
|
|
206
|
+
<key>Label</key><string>dev.dx.weekly-summary</string>
|
|
207
|
+
<key>ProgramArguments</key><array>
|
|
208
|
+
<string>$(command -v node)</string>
|
|
209
|
+
<string>$(npm root -g)/dx-devkit/dist/index.js</string>
|
|
210
|
+
<string>summary</string><string>--save</string>
|
|
211
|
+
</array>
|
|
212
|
+
<key>StartCalendarInterval</key><dict>
|
|
213
|
+
<key>Weekday</key><integer>4</integer>
|
|
214
|
+
<key>Hour</key><integer>16</integer>
|
|
215
|
+
<key>Minute</key><integer>0</integer>
|
|
216
|
+
</dict>
|
|
217
|
+
</dict></plist>
|
|
218
|
+
EOF
|
|
219
|
+
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/dev.dx.weekly-summary.plist
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
To remove it: `launchctl bootout gui/$(id -u)/dev.dx.weekly-summary`, then delete the `.plist` file.
|
|
223
|
+
</details>
|
|
224
|
+
|
|
225
|
+
<details>
|
|
226
|
+
<summary><b>Linux</b>: a systemd user timer. If the computer is off at 4 pm, it runs as soon as it's back on.</summary>
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
mkdir -p ~/.config/systemd/user
|
|
230
|
+
cat > ~/.config/systemd/user/dx-summary.service <<EOF
|
|
231
|
+
[Service]
|
|
232
|
+
Type=oneshot
|
|
233
|
+
ExecStart="$(command -v node)" "$(npm root -g)/dx-devkit/dist/index.js" summary --save
|
|
234
|
+
EOF
|
|
235
|
+
cat > ~/.config/systemd/user/dx-summary.timer <<EOF
|
|
236
|
+
[Timer]
|
|
237
|
+
OnCalendar=Thu 16:00
|
|
238
|
+
Persistent=true
|
|
239
|
+
|
|
240
|
+
[Install]
|
|
241
|
+
WantedBy=timers.target
|
|
242
|
+
EOF
|
|
243
|
+
systemctl --user daemon-reload
|
|
244
|
+
systemctl --user enable --now dx-summary.timer
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`systemctl --user list-timers` shows when it runs next. To remove it: `systemctl --user disable --now dx-summary.timer`, then delete the two files. Without systemd, a crontab line does the same, but skips a week the computer was off: `0 16 * * 4 "$(command -v node)" "$(npm root -g)/dx-devkit/dist/index.js" summary --save` (write the two paths out in full; cron doesn't run `$(…)` for you).
|
|
248
|
+
</details>
|
|
249
|
+
|
|
250
|
+
**`dx clean` details:**
|
|
251
|
+
- It only looks at projects you haven't touched for 30 days (`--days` changes that), and only at folders an install or a build recreates: `node_modules`, `.next`, `.nuxt`, `.svelte-kit`, `.turbo`, `dist`, `build`, `out`, `coverage`, `target` and similar, up to three levels down for monorepos.
|
|
252
|
+
- In a git repo a folder only counts if git ignores it, so a committed `build/` folder is never touched. Outside git, `dist`, `build` and the like are left alone, since they may be the only copy.
|
|
253
|
+
- It lists everything with sizes and asks before deleting. `--list` only shows, `-y` skips the question. Run `npm install` to get a project's `node_modules` back.
|
|
254
|
+
|
|
255
|
+
**`dx deps` details:**
|
|
256
|
+
- It runs `npm outdated` and `npm audit` in every Node project, four at a time, so it needs the internet and takes a few seconds per project. `dx deps todo-app` checks one, `--active 30` only the projects active in the last 30 days.
|
|
257
|
+
- The table shows how many packages are outdated, how many of those are a major version behind (an update that may need code changes), and the vulnerabilities by severity. `--details` lists each package.
|
|
258
|
+
- pnpm projects are checked with pnpm when it's installed; yarn and bun projects are skipped for now. Nothing is changed: fix with `npm update` or `npm audit fix` in the project.
|
|
259
|
+
|
|
260
|
+
**`dx new` details:**
|
|
261
|
+
- `dx new <source> <name>`: the source is a template in `~/.dx/templates`, or an existing project. A git project is copied as the files git tracks plus new files it doesn't ignore, so local reports, uploads and caches stay behind; `.git`, `node_modules`, build output and `.env` files are always left out (`.env.example` is kept). The new project goes in your first projects folder (`--in <folder>` to choose), gets a git repository and its packages installed, then opens like `dx go`.
|
|
262
|
+
- Make a template from a project with `dx new --save todo-app vite-app`. In template files, `{{name}}` is replaced with the new project's name, in file names too; `package.json` always gets the new name.
|
|
263
|
+
- `--no-install`, `--no-git`, `--no-open` and `--no-dev` skip those steps. `dx new` alone lists your templates.
|
|
264
|
+
|
|
265
|
+
### Per-project settings: `.devrc.json`
|
|
266
|
+
|
|
267
|
+
Optional, in a project's folder, when the detected values aren't right:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"name": "shop",
|
|
272
|
+
"dev": "npm run dev -- --turbo",
|
|
273
|
+
"url": "http://localhost:3000",
|
|
274
|
+
"editor": "cursor"
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
A folder containing only a `.devrc.json` also counts as a project.
|
|
279
|
+
|
|
280
|
+
**A stack of your own**, for when dx can't find it by itself (two repositories, say). Each service has a command (`dev`), another project's folder (`project`, whose own dev command is used), or a docker compose service (`docker`):
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"stack": {
|
|
285
|
+
"web": { "dev": "npm run dev", "dependsOn": ["api"] },
|
|
286
|
+
"api": { "project": "../shop-api", "dependsOn": ["db"] },
|
|
287
|
+
"db": { "docker": "postgres" }
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
`dir` runs a command in another folder, `url` says where a service listens if it doesn't print it, and `role` (`data`, `backend`, `frontend`) sets the order when there's no `dependsOn`.
|
|
293
|
+
|
|
294
|
+
### Settings: `~/.dx/config.json`
|
|
295
|
+
|
|
296
|
+
Created on first run, with the code folders and editor dx found:
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"projectsRoots": ["~/code", "~/Documents/GitHub"],
|
|
301
|
+
"editor": "cursor",
|
|
302
|
+
"scanDepth": 2,
|
|
303
|
+
"ignore": ["node_modules", "dist", "build", "out", "vendor", "target", "bin", "obj"],
|
|
304
|
+
"devServerTimeout": 90,
|
|
305
|
+
"aiToolsSeen": ["claude-code", "cursor"]
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
- **`localDomains`** / **`localDomainsPort`**: `false` turns `*.localhost` addresses off; a number picks their port instead of 80 (or 1355).
|
|
310
|
+
- **`aiToolsSeen`**: the AI tools dx has connected itself to once. A tool you disconnect stays disconnected. Set `"autoConnectAi": false` to stop dx connecting itself to new ones (`dx setup --undo` does both).
|
|
311
|
+
|
|
312
|
+
A folder counts as a project when it has a `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, `requirements.txt`, a `.sln`/`.csproj`, a `.git` folder or a `.devrc.json`.
|
|
313
|
+
|
|
314
|
+
- **`scanDepth: 2`** also finds projects one folder down, e.g. `projects/archive/old-thing`. To skip a folder like that, add `"archive"` to `ignore`.
|
|
315
|
+
- **Folders starting with `.`** are always skipped.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Raycast
|
|
320
|
+
|
|
321
|
+
Works from a source checkout (see Setup). Needs [Raycast for Windows](https://www.raycast.com) installed and running, and `npm run build` done first.
|
|
322
|
+
|
|
323
|
+
```powershell
|
|
324
|
+
npm run raycast:install
|
|
325
|
+
npm run raycast:dev
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Four commands appear in Raycast:
|
|
329
|
+
- **Open Project**: open in the editor, start the dev server, open in the browser, terminal here, show in File Explorer.
|
|
330
|
+
- **Kill Port**
|
|
331
|
+
- **Log Work**
|
|
332
|
+
- **Work Journal**
|
|
333
|
+
|
|
334
|
+
To give them hotkeys, go to Raycast Settings → Extensions → DX Toolkit and assign one per command (for example Alt+P for Open Project, Alt+K for Kill Port).
|
|
335
|
+
|
|
336
|
+
If the `dx` command is installed, "Start Dev Server" runs `dx go .` in the new terminal window, so you also get the port check and the browser opening.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Claude and other AI tools (MCP)
|
|
341
|
+
|
|
342
|
+
dx connects itself to **Claude Code, Claude Desktop, Cursor, Windsurf and VS Code** (Copilot's agent mode), whichever you have: see [Setup](#setup). Restart Claude Desktop once afterwards; the others pick it up in new chats.
|
|
343
|
+
|
|
344
|
+
### Let your AI run your app
|
|
345
|
+
|
|
346
|
+
Ask your agent to work on a project and check its own work, for example *"Start todo-app, then fix whatever error the checkout page shows."* It can:
|
|
347
|
+
|
|
348
|
+
| Tool | What the agent gets |
|
|
349
|
+
|---|---|
|
|
350
|
+
| `start_dev_server` | Starts the project's dev server, waits until it's ready or has failed, and returns the URL, any errors and the output |
|
|
351
|
+
| `wait_for_rebuild` | After it edits files: waits for the server to rebuild, then says whether the change added or fixed errors |
|
|
352
|
+
| `check_url` | Requests a page or API route (localhost only) and returns the status, title and start of the body, plus anything the server logged and any error it hit while answering |
|
|
353
|
+
| `dev_errors` | Current errors across running servers: TypeScript, Vite, esbuild, webpack and Next.js, Node stack traces, Python tracebacks, Go panics, with file and line. An error disappears once the server rebuilds cleanly |
|
|
354
|
+
| `dev_logs` | The server's output, only what's new since it last looked |
|
|
355
|
+
| `dev_servers`, `stop_dev_server`, `restart_dev_server` | What's running, and stopping or restarting it |
|
|
356
|
+
| `set_stack` | Defines a stack dx can't find by itself, such as two repositories, by writing it to `.devrc.json` |
|
|
357
|
+
| `dx_setup_check` | dx's health checks, each problem with the command that fixes it, so the agent can fix your setup for you |
|
|
358
|
+
|
|
359
|
+
These work on stacks too: `start_dev_server` starts every service in order and reports each with its address, errors are labelled with their service, and `check_url` accepts `.localhost` addresses such as `http://api.shop.localhost/health`.
|
|
360
|
+
|
|
361
|
+
The servers run in the dx dashboard, not inside the AI tool, so they keep running after the chat ends, and you can watch them, with a **Started by AI** label and their errors, in the Projects page or with `dx logs <project> -f`.
|
|
362
|
+
|
|
363
|
+
### Your projects, ports, journal and week
|
|
364
|
+
|
|
365
|
+
- `list_projects`, `open_project`
|
|
366
|
+
- `list_ports`, `kill_port`
|
|
367
|
+
- `add_log_entry`, `read_log`
|
|
368
|
+
- `work_summary`: your commits, pull requests and journal for the last few days
|
|
369
|
+
- `find_cleanup`: which folders `dx clean` would delete and how much space that frees (it never deletes)
|
|
370
|
+
- `audit_dependencies`: outdated packages and vulnerabilities per project
|
|
371
|
+
|
|
372
|
+
Then you can say things like "free port 3000 and start todo-app" or "write my standup from what I did this week".
|
|
373
|
+
|
|
374
|
+
### Connecting by hand
|
|
375
|
+
|
|
376
|
+
Only needed for a tool dx doesn't know, such as Raycast AI. The server is the `dx-mcp` command. For apps that don't see your PATH, run it with Node instead: `node <global folder>/dx-devkit/node_modules/@dx/mcp/dist/index.js`, where `npm root -g` prints the global folder. In JSON on Windows, double the backslashes. From a source checkout, it's `packages/mcp/dist/index.js`.
|
|
377
|
+
|
|
378
|
+
For reference, this is what `dx setup` writes for Claude Desktop in `claude_desktop_config.json` (`%APPDATA%\Claude\` on Windows, `~/Library/Application Support/Claude/` on macOS):
|
|
379
|
+
|
|
380
|
+
```json
|
|
381
|
+
{
|
|
382
|
+
"mcpServers": {
|
|
383
|
+
"dx": {
|
|
384
|
+
"command": "/usr/local/bin/node",
|
|
385
|
+
"args": ["/usr/local/lib/node_modules/dx-devkit/node_modules/@dx/mcp/dist/index.js"]
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
And for Claude Code:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
claude mcp add -s user dx -- node "$(npm root -g)/dx-devkit/node_modules/@dx/mcp/dist/index.js"
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**Raycast AI**: add an MCP server in Raycast with the same command (`node`) and path.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Adding a new tool
|
|
402
|
+
|
|
403
|
+
1. **Write the logic** in `packages/core/src/tools/<tool>.ts` and export it from `packages/core/src/index.ts`.
|
|
404
|
+
2. **Terminal**: add `packages/cli/src/commands/<tool>.ts` (copy `log.ts` as a template) and add it to the list in `packages/cli/src/index.ts`.
|
|
405
|
+
3. **Raycast** (optional): add `packages/raycast/src/<tool>.tsx` and an entry under `commands` in `packages/raycast/package.json`.
|
|
406
|
+
4. **AI** (optional): add one `server.registerTool(...)` block in `packages/mcp/src/index.ts`.
|
|
407
|
+
5. **Dashboard** (optional): add a route in `packages/web/src/api.ts` (it must check the project with `scanProjects()` like the others) and a page in `packages/web/public/app.js`.
|
|
408
|
+
6. **Build**: run `npm run build`, then `npm test`. Tests go in `packages/<pkg>/src/__tests__`.
|
|
409
|
+
|
|
410
|
+
Call `recordRun(tool, ok, detail)` from anything that changes something, so it shows up in `dx runs`.
|
|
411
|
+
|
|
412
|
+
## Tests and CI
|
|
413
|
+
|
|
414
|
+
`npm test` builds everything and runs the tests in `packages/core`, `packages/web` and `packages/mcp`:
|
|
415
|
+
- **core**: the tools, including error detection on real output from each tool it knows and connecting to AI tools on a pretend computer.
|
|
416
|
+
- **web**:
|
|
417
|
+
- the dashboard's server: its security checks, and a real dev server started, streamed, checked for errors and stopped through it;
|
|
418
|
+
- a real two-service stack: started in order, reached through `shop.localhost` (WebSockets and redirects included), then stopped.
|
|
419
|
+
- **mcp**: a real MCP client that starts an app, finds an error through a request and sees it cleared, as an agent would. On GitHub, [.github/workflows/ci.yml](.github/workflows/ci.yml) runs them on every push to `main` and every pull request, on Windows, macOS and Linux with Node 22 and 24, and tries the `dx` command itself.
|
|
420
|
+
|
|
421
|
+
## Working on dx with Claude Code
|
|
422
|
+
|
|
423
|
+
[CLAUDE.md](CLAUDE.md) tells Claude Code how this repo is built, its conventions and the dashboard's security rules. [docs/MEMORY.md](docs/MEMORY.md) keeps the decisions made so far and why, the gotchas, and the backlog. CLAUDE.md imports it, so both load in every session here. Update MEMORY.md when a decision is made.
|
|
424
|
+
|
|
425
|
+
## Next on the list
|
|
426
|
+
|
|
427
|
+
- **Raycast**: install and check the extension, and add commands for the summary and cleanup.
|
|
428
|
+
- **Local HTTPS** (`https://shop.localhost`): it needs a certificate your system trusts, which means an admin prompt once, so it'll be an opt-in step your AI tool can do for you.
|
|
429
|
+
- **Browser console errors** for agents: dx sees the server's output; pairing it with a browser MCP server covers what happens in the page.
|
|
430
|
+
- **Tests for the CLI**: `core`, the dashboard and the MCP server are tested today.
|
|
431
|
+
- **`dx deps --fix`**, and yarn and bun projects in `dx deps`.
|
|
432
|
+
|
|
433
|
+
The full backlog is in [docs/MEMORY.md](docs/MEMORY.md).
|
|
434
|
+
|
|
435
|
+
## Troubleshooting
|
|
436
|
+
|
|
437
|
+
- **"Access is denied" when killing a process**: it belongs to another user or needs admin rights. Run the terminal as administrator.
|
|
438
|
+
- **`dx` not found after `npm run link`**: open a new terminal. If it still isn't found, check that the folder `npm prefix -g` prints is on your PATH.
|
|
439
|
+
- **Editor doesn't open**: run `dx doctor`, then set the editor with `dx config editor "C:\Path\To\Editor.exe"`.
|
|
440
|
+
- **Debug output**: set `DX_DEBUG=1` to print full error stacks.
|
|
441
|
+
|
|
442
|
+
## Releasing
|
|
443
|
+
|
|
444
|
+
For maintainers:
|
|
445
|
+
1. Move the CHANGELOG's *Unreleased* notes under a new version, and bump `version` in every `package.json`.
|
|
446
|
+
2. Build and check the package:
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
npm run release
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
This puts it in `release/` and packs it.
|
|
453
|
+
|
|
454
|
+
3. Install that package into a temporary folder and try it:
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
node scripts/smoke-package.mjs
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
4. Publish, after `npm login`:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
npm publish ./release
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
5. Tag `vX.Y.Z` and draft a GitHub release from the CHANGELOG.
|
|
467
|
+
|
|
468
|
+
CI runs steps 2 and 3 on every push.
|
|
469
|
+
|
|
470
|
+
## Contributing
|
|
471
|
+
|
|
472
|
+
Bug reports, ideas and pull requests are welcome: [CONTRIBUTING.md](CONTRIBUTING.md) has the setup and the conventions, and [CHANGELOG.md](CHANGELOG.md) what changed in each version. Please follow the [code of conduct](CODE_OF_CONDUCT.md), and report security problems privately as [SECURITY.md](SECURITY.md) explains.
|
|
473
|
+
|
|
474
|
+
## License
|
|
475
|
+
|
|
476
|
+
[MIT](LICENSE)
|
package/bin/dx-mcp.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Every dx subcommand has this shape. To add a tool: write a file in commands/ and list it in index.ts. */
|
|
2
|
+
export interface Command {
|
|
3
|
+
name: string;
|
|
4
|
+
aliases?: string[];
|
|
5
|
+
summary: string;
|
|
6
|
+
usage: string;
|
|
7
|
+
run(args: string[]): Promise<number | void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7C"}
|
package/dist/command.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Command } from "../command.js";
|
|
2
|
+
export declare const setupCommand: Command;
|
|
3
|
+
/** Runs once, the first time dx is used, so connecting AI tools needs no setup step. */
|
|
4
|
+
export declare function firstRunSetup(): Promise<void>;
|
|
5
|
+
export declare const logsCommand: Command;
|
|
6
|
+
export declare const errorsCommand: Command;
|
|
7
|
+
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/commands/ai.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAK7C,eAAO,MAAM,YAAY,EAAE,OAgD1B,CAAC;AAEF,wFAAwF;AACxF,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAYnD;AAqBD,eAAO,MAAM,WAAW,EAAE,OAiCzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OA2B3B,CAAC"}
|