# Command line (/docs/javascript/cli)

`@tracepanel/js` installs the `tracepanel` command. Run it with `npx` from
your project's directory, so it finds the project's store.

| Command | What it does |
| --- | --- |
| `tracepanel run <command>` | Runs a command with Tracepanel on. |
| `tracepanel dev` | Runs the agent in the foreground and serves the console. |
| `tracepanel mcp` | Runs an MCP server for AI coding agents. |

## tracepanel run [#tracepanel-run]

```bash
npx tracepanel run node server.js
```

`tracepanel run` starts the command with `--import @tracepanel/js/register`
added to `NODE_OPTIONS`, and with `TRACEPANEL_ENABLED=1`. Use it in a
`package.json` script, so the app starts with Tracepanel and no flag:

```json
{ "scripts": { "dev": "tracepanel run node server.js" } }
```

## tracepanel dev [#tracepanel-dev]

```bash
npx tracepanel dev [--port 8765]
```

`tracepanel dev` runs the agent in the foreground, with the console on
http://127.0.0.1:8765/. Use it to watch the agent's output, or to read the
traces after your app has stopped. `--port` moves the console.

## tracepanel mcp [#tracepanel-mcp]

```bash
npx tracepanel mcp [--values]
```

`tracepanel mcp` runs the agent's MCP server on stdin and stdout, for Claude
Code, Cursor and other coding agents. `--values` adds SQL parameters and
local variables to its answers. See [AI coding agents](/docs/ai-agents).
