Start, inspect, restart, or stop an Onyx development stack with ODS. Prefer frontend-only previews for frontend-only diffs, shared infrastructure for ordinary work, and explicit isolation for independent datasets. Do not use for Kubernetes development.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Onyx Dev Stack?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/onyx-dot-app-onyx-dev-stack)
---
name: onyx-dev-stack
description: Start, inspect, restart, or stop an Onyx development stack with ODS. Prefer frontend-only previews for frontend-only diffs, shared infrastructure for ordinary work, and explicit isolation for independent datasets. Do not use for Kubernetes development.
---
# Onyx dev stack
Run from the worktree that contains the code being tested. ODS owns processes, ports, state, and logs.
## Select ODS
Check for `uv`, `bun`, and a running Docker daemon. Use the repository-pinned ODS when it provides the stack command:
```bash
uv run --frozen --only-group ods ods stack --help
```
Check `ods web dev --help` and `ods --help` too. If the pinned package lacks the shared-stack behavior, build ODS from this checkout. This requires Go:
```bash
ODS_BUILD_DIR="$(mktemp -d "$(git rev-parse --path-format=absolute --git-path ods-stack-bin).XXXXXX")"
ODS="$ODS_BUILD_DIR/ods"
go -C tools/ods build -o "$ODS" .
"$ODS" stack --help
```
Use the selected command for the remaining steps. Examples below use `"$ODS"`; replace that prefix with the pinned invocation when available.
## Start and discover
For frontend-only diffs on macOS or Linux, run the frontend against an existing healthy managed API:
```bash
"$ODS" web dev
```
This foreground command starts only the web server. Keep its terminal running.
It requires a healthy managed API. Ctrl-C stops a newly launched preview.
If a matching frontend already runs in this checkout, ODS attaches instead;
Ctrl-C then only detaches. `stack status` does not list standalone previews.
Ctrl-C also cancels dependency installation and library builds during startup.
It does not run migrations, start workers, or start containers. If no healthy API
exists, start the default stack first. Use a full stack for backend changes and
OAuth callback testing, because the reused API retains its original web origin.
Other `ods web` scripts, including build and test, remain package-script commands.
On Windows, `web dev` and `backend` use portable foreground launchers and
configured connection variables. Managed stacks, API discovery, and attachment
are macOS/Linux behavior. Check the frontend URL directly after a Windows launch.
For ordinary work, start the default profile with shared infrastructure:
```bash
"$ODS" stack up --timeout 12m
"$ODS" stack status --json
```
Use the reported web URL for browser tests and HTTP requests. Do not assume port `3000` or call a backend port directly.
`up` prepares local environment files and dependencies, reuses shared infrastructure, applies migrations, and reconciles background application services. Existing secrets stay private. Ask for a model key only when the requested test needs one.
Pending migrations stop managed application services before changing the schema.
If the database is already at head, unchanged healthy services keep running.
Run a slow startup in a background terminal when available. Wait for its exit and inspect status before reporting success.
Read `"$ODS" stack up --help` before choosing a different profile:
- `minimal` runs web and API for UI/API work.
- `default` adds the workers needed for ordinary indexing and background tasks.
- `full` runs the full launch compound for integration work.
Use `--local-model-server` only when changing model-server code. Other profiles use Compose inference and avoid a duplicate local model process.
Repeat the profile and local-model flag with `start` or `restart`. Use `up` to change model mode or recover infrastructure.
## Multiple agents
- Agents in the same worktree share one stack. Reuse a healthy stack through `up` and `status`.
- By default, worktrees share infrastructure and one active application checkout. Running `up` elsewhere stops the prior managed app before migrations.
- Use `ods --isolated stack up` for separate state, ports, Compose projects, databases, queues, indexes, and object storage. Repeat `--isolated` for later commands.
- Use `ods web dev` for frontend-only diffs with a healthy managed API. Its Ctrl-C behavior leaves the reused API running.
- Shared status reports the active checkout. Run stop, down, start, and restart there. Only up transfers ownership.
- Legacy datasets are preserved. If several exist at first shared startup, select the intended one with `--project`; never choose by timestamps. Stop its legacy stack with `--isolated` before adoption.
- Legacy discovery reads saved `ods stack` state. Compose-only setups need their previous `--project NAME` explicitly. Use `ods --project NAME stack up` to save that shared selection before using the default commands.
- Project ownership is durable. An explicit project collision fails, including in isolated mode. Select a different project for independent infrastructure.
- ODS keeps a stack's ports while it runs. `stop` releases the application ports (web, API, MCP, model, metrics) and keeps the infrastructure ports. `down` releases all of them. Another stack can reclaim the ports of a stopped stack, and a stopped stack moves back to the lowest free port. Read status again after a restart or start.
- The selected stack lock coordinates lifecycle changes. Shared handoffs serialize; isolated stacks can start independently.
- Foreground services and full stacks use the same service specifications and process launchers. A full stack replaces a same-checkout preview and retains its port.
- Database operations target exact project containers and use state/project locks. Do not work around a target conflict or another checkout's ownership guard.
- Stop managed services before manual `db upgrade` or `db downgrade`. Use `stack up` for pending-aware upgrades.
- An explicit loopback database port resolves to its actual managed owner. `ods env` leaves dotenv files unchanged if the selected Postgres container has no published port.
- Do not stop another worktree's services or kill unrelated processes to free a port.
- Keep `.vscode/.env` and `.vscode/.env.web` untracked. Do not print their contents.
Use shared mode for sequential development and frontend previews. Use isolated mode for simultaneous backend branches, incompatible schemas, destructive tests, or independent datasets.
## Inspect and recover
```bash
"$ODS" stack status --json
"$ODS" stack logs
```
Inspect the reported phase, failed services, and logs when startup is incomplete. Re-run `up` to recover a partial start. Preserve healthy services and report optional integrations that remain unavailable.
If the stack starts on unexpected ports, or Docker resources run low, run `"$ODS" stack ls --all` to see the other stacks on the machine.
Run `"$ODS" stack logs --help` to select a service or follow logs. Follow logs in a background terminal when continued observation is needed.
Successful startup requires the readiness check through the reported frontend URL. A process that exists is insufficient evidence.
## Setup traps
ODS sets `WEB_DOMAIN` to its HTTP web URL, for example `http://localhost:3000`.
This value replaces `WEB_DOMAIN` in `.vscode/.env` and `.vscode/.env.web`.
An HTTPS proxy in front of the stack does not change it.
Before you test HTTPS behavior, such as `Secure` cookies or OAuth redirects, read the running process environment:
```bash
tr '\0' '\n' < /proc/<api-or-web-pid>/environ | grep '^WEB_DOMAIN='
```
To test an HTTPS origin, stop the managed API and web processes.
Start them manually with the same environment and an HTTPS `WEB_DOMAIN`.
After the test, run `"$ODS" stack restart` to return to the managed stack.
A relative `PYTHONPATH`, for example `PYTHONPATH=./backend` from the shell, breaks indexing.
The workers run in `backend/`, so the path resolves to `backend/backend`.
The worker starts, but its spawned fetch process fails with `ModuleNotFoundError: No module named 'onyx'`.
Before you test indexing, set `PYTHONPATH` to the absolute `backend` path, and then restart the stack from the repository root:
```bash
PYTHONPATH="$PWD/backend" "$ODS" stack restart
```
## Validate changes
For lifecycle, concurrency, browser, or real worker validation, read [the ODS integration guide](../../../tools/ods/integration/README.md).
Use disposable worktrees with `ods --isolated stack up` for these tests. They create accounts, change the default test LLM provider, and stop services.
The browser smoke configuration supports an unlicensed local deployment. Its chat checks use a scripted local LLM, not a paid model key.
Never reset a developer database to satisfy a test fixture.
Database restore errors fail the command; SQL restores stop on SQL errors.
## Stop
Stop managed application processes while keeping infrastructure available:
```bash
"$ODS" stack stop
```
Stop the worktree's application processes and infrastructure:
```bash
"$ODS" stack down
```
Normal shutdown preserves volumes. Delete database, index, or object-store data only when the user explicitly requests a reset.
After shutdown, inspect status to confirm the targeted stack stopped. Check that another running worktree remains available when testing isolation.
When your task is complete, run `"$ODS" --isolated stack down` for an isolated stack you started. Each isolated stack keeps about 4 GB of memory for OpenSearch and the model servers, even after `stack stop`. Do not stop a shared stack, because other worktrees use it.
## Find and stop old stacks
Run `"$ODS" stack ls` from any directory. It lists every stack on the machine and prints the command that stops each one. Add `--all` for stopped stacks, `--json` for the same rows with a `next` field. Run `"$ODS" stack ls --help` for the statuses.
Stop `orphaned` stacks; no worktree owns them. Run the printed command, or confirm with the user before you stop a stack that another agent may still use.
An orphan whose `next` is `ods stack prune --volumes` has only Docker volumes left. Deleting them deletes its data, so ask the user first.
`"$ODS" stack prune --idle 6h` also stops isolated stacks whose worktree had no Git operation, file edit, or running coding agent for 6 hours. It stops stacks of other worktrees, so run it only when the user asks.
Do not add `--force`, `--idle`, `prune --yes`, or `prune --volumes` unless the user asks.