Run a service locally¶
Start a service on your machine with the environment variables of one of its deployment environments loaded, on macOS, Linux and Windows alike.
Prerequisites¶
- The service's packages installed:
alis packages install <pkg>. -
The product's
.alis/.envfile, written for the deployment environment you want to mirror:In the TUI, Set active deployment environment (ShiftE on a deployment environment cell) writes the same file. Without it,
alis runfails withENV_NOT_FOUND.
Run¶
From inside a service folder, the command loads <product>/.alis/.env into the process environment and starts the service using the first of these that applies:
- the Makefile
runtarget, when the folder has one andmakeis installed; - otherwise the Go main package in the folder (
go run .); - otherwise the first component it detects: a Go server in a subfolder, else a frontend app (
npm run devorpnpm dev).
Pass a service folder path or a package id to run something other than the current directory. Arguments after -- go to the program; with make they arrive as ARGS="...". The service runs in the foreground; CtrlC stops it and alis exits with the service's status (130 when interrupted). --no-env runs without loading the file.
alis service run is the same command.
See what would run¶
Prints the plan: the directory, the env file, the variable names (never the values), the runner and the command.
Give the service a Makefile¶
alis run and the TUI's M action both execute make run, so a Makefile is the way to run anything beyond go run .. The conventions every Alis Makefile follows (why each exists is in How Makefiles work):
- A
runtarget starts the service locally, and.DEFAULT_GOAL := runsits above the targets so a baremakedoes the same. -
Recipes that need configuration start with
$(LOAD_ENV), which sources the repo's.alis/.env: -
A trailing
## commentdocuments a target; thehelptarget lists documented targets and the TUI's ShiftM action shows them. - A service that needs another one adds a
dep-<service>target that starts it directly on its own port, never by recursing into the other service'smake run. - Recipes are indented with a tab.
On Windows, GNU make and bash are not installed by default: use alis run, which knows this contract, rather than calling make yourself.
Let your agent see the frontend¶
Says where the service's web frontend answers: the port from --url, --port, ALIS_APP_URL, the service's .claude/launch.json, the Makefile's APP_URL or a Vite config, else localhost:8080. Nothing is launched: your agent opens that address with its own browser tools (Claude in Chrome, the Codex browser, a Playwright MCP) in your browser on the machine. See Preview a service frontend.