$npx -y skills add superdesigndev/tools-registry --skill dev-localOne-command local dev stack for tools-registry. Use when asked to "start the dev server", "run treg locally", "test login locally", "bring the stack up", or before any manual/browser test against localhost.
| 1 | # dev-local — the local treg stack in one command |
| 2 | |
| 3 | `scripts/dev-local.sh` runs the FastAPI server in a tmux session with dev-safe |
| 4 | settings, and gives you a sandboxed CLI that never touches `~/.treg/config.json`. |
| 5 | |
| 6 | | Service | Command (managed by the script) | Port | |
| 7 | |---|---|---| |
| 8 | | treg server | `uv run python -m treg --reload` + `TREG_EMAIL_DEV_MODE=true`, own sqlite `treg-dev.db` | 18790 | |
| 9 | |
| 10 | No infra deps (sqlite). Prerequisites: `tmux`, `uv` (the script runs `uv sync` if `.venv` is missing). |
| 11 | |
| 12 | ## Subcommands |
| 13 | |
| 14 | ``` |
| 15 | scripts/dev-local.sh up # start (idempotent) — prints URLs when healthy |
| 16 | scripts/dev-local.sh down # stop the session |
| 17 | scripts/dev-local.sh status # windows + port check |
| 18 | scripts/dev-local.sh logs # last 200 lines of the server window |
| 19 | scripts/dev-local.sh restart # respawn the server window |
| 20 | scripts/dev-local.sh attach # attach to tmux |
| 21 | scripts/dev-local.sh cli <args> # working-tree treg CLI, sandboxed HOME, pre-pointed at localhost |
| 22 | scripts/dev-local.sh reset # down + wipe treg-dev.db and the CLI sandbox |
| 23 | ``` |
| 24 | |
| 25 | `cli` is the key trick for login testing: `scripts/dev-local.sh cli login` runs the |
| 26 | repo's CLI against localhost with `HOME=scripts/.dev-home`, so the real |
| 27 | `~/.treg/config.json` (usually pointing at production) is never overwritten. |
| 28 | Email OTP dev mode is on — codes appear in the login page / API response, no mail sender needed. |
| 29 | |
| 30 | ## Troubleshooting |
| 31 | |
| 32 | - **Port 18790 in use, no session** → something else owns it: `lsof -i :18790`. |
| 33 | - **Server window died** → `scripts/dev-local.sh logs` for the traceback, then `restart`. |
| 34 | - **Stale dev state / want a fresh DB** → `scripts/dev-local.sh reset` then `up`. |