Services and previews
Declare a dev server in linkcode.json and LinkCode runs it, health-checks it, and gives you a stable local preview link.
If your project has a long-running dev server, you can declare it in a linkcode.json file at the workspace root so LinkCode runs and tracks it for you, instead of you managing it in a separate terminal. See the linkcode.json reference for the full schema.
{
"scripts": {
"web": { "type": "service", "command": "pnpm dev" }
}
}The Services menu
When a workspace declares scripts, a Services chip appears in the window header, listing each one with a colored dot showing its state — running, and for a service, whether it's currently passing its health check; stopped; or idle:
- Run / Stop — start or stop the script.
- View logs — jumps to a terminal tab attached to the script's live output.
- Open — for a running service, loads its preview URL. The first time you open a link, LinkCode asks whether to open it in the Browser panel or your system browser, with an option to remember your choice so it stops asking.
A task-type script (a one-shot command, as opposed to a persistent service) shows its exit code if it fails.
The Services menu open from the window header: a running web service with a green health dot and Run/Stop, View logs, and Open actions
Screenshot coming soon
/images/docs/interface-preview-services.pngPorts and environment variables
You don't pick a port yourself — LinkCode allocates one automatically for each declared service (unless you fix one with a port field in linkcode.json) and injects it into the script's environment as LINKCODE_PORT and LINKCODE_URL. Every other running service in the same workspace is also exposed to each script as LINKCODE_SERVICE_<NAME>_PORT and LINKCODE_SERVICE_<NAME>_URL, so one service can address another by name without hardcoding ports.
The preview address
The preview URL isn't the raw port — it's a stable address like web--my-project-a1b2c3.localhost, proxied by your host (the LinkCode daemon). It stays the same across restarts for a given script in a given workspace, which makes it easy to bookmark, but it only resolves on your own machine: it is not shareable with anyone else, even on your local network.
Planned
Sharing a running preview with someone outside your machine is on the roadmap but not available yet.