-
-
Notifications
You must be signed in to change notification settings - Fork 52
CLI Reference
The synapse command manages the backend and frontend servers.
| Dependency | Minimum | Required |
|---|---|---|
| Python | 3.11 | Yes |
| Node.js | 20.9.0 | Yes |
| npm | bundled with Node | Yes |
| ollama | any | No (local models only) |
Warnings are printed at startup if versions are below minimums. Missing ollama is non-fatal — cloud API models still work.
# Editable install (recommended for development)
python -m pip install -e .
# Or install normally
python -m pip install synapse-ai
# Run without installing
python -m synapse startRun the interactive setup wizard before first start:
synapse setup| Variable | Default | Description |
|---|---|---|
SYNAPSE_DATA_DIR |
~/.synapse/data |
Path to data directory |
SYNAPSE_BACKEND_PORT |
8765 |
Backend API server port |
SYNAPSE_FRONTEND_PORT |
3000 |
Frontend web UI port |
SYNAPSE_PROFILING |
false |
Enable performance profiling (set by --profile) |
Values in a .env file at the project root are loaded automatically. Environment variables already set are not overridden.
synapse start # start backend + frontend, open browser
synapse start --detach # start in background (writes pidfiles)
synapse start --no-browser # start but don't open browser
synapse start --backend-port 8080 --frontend-port 4000 # custom ports
synapse start --profile # start with performance profiling
synapse stop # stop background processes
synapse status # show process status
synapse restart # stop + start
synapse restart --detach --backend-port 8080 # restart detached on custom ports
synapse setup # interactive setup wizard (API keys, settings)
synapse upgrade # pull latest code and rebuild everything
synapse uninstall # remove Synapse (prompts for confirmation)
synapse uninstall --keep-data # uninstall but keep ~/.synapse dataStarts the backend and frontend. Waits for both to be ready, then opens the browser (unless --no-browser or --detach).
In foreground mode, Ctrl+C shuts down both processes cleanly. In detach mode, PIDs are written to the data directory.
| Flag | Default | Description |
|---|---|---|
--detach, -d
|
off | Run in background and write pidfiles |
--no-browser |
off | Do not open a browser on start |
--backend-port PORT |
8765 |
Port for the backend API server |
--frontend-port PORT |
3000 |
Port for the frontend web UI |
--profile |
off | Enable performance profiling |
Reads PID files and terminates both processes. Sends SIGTERM first, then SIGKILL if the process does not exit within 5 seconds. On Windows uses taskkill /F /T.
Prints whether the backend and frontend processes are running or have a stale PID.
Equivalent to stop followed by start. Accepts the same port and detach flags as start.
| Flag | Default | Description |
|---|---|---|
--detach, -d
|
off | Leave processes detached after restart |
--backend-port PORT |
8765 |
Port for the backend API server |
--frontend-port PORT |
3000 |
Port for the frontend web UI |
Runs the interactive setup wizard. Prompts for API keys and settings and writes them to the project .env file.
Pulls the latest code and rebuilds everything in place:
- Stops running services
git pull --ff-only- Recreates the backend virtual environment and reinstalls requirements
- Reinstalls
synapse-aiin editable mode - Runs
npm installandnpm run buildin the frontend directory
Permanently removes Synapse AI. Prompts for confirmation before proceeding.
Steps performed:
- Stops running services
- Removes startup registration (systemd on Linux, LaunchAgent on macOS, Registry on Windows)
- Removes data directory (
~/.synapse/data) — skipped with--keep-data - Removes installation directory (including
backend/venvandfrontend/node_modules) - Runs
pip uninstall -y synapse-ai - Cleans
PATHentries from shell config files
| Flag | Default | Description |
|---|---|---|
--keep-data |
off | Preserve ~/.synapse data directory |
PID files are written to the data directory:
~/.synapse/data/backend.pid
~/.synapse/data/frontend.pid
The profile subcommand queries backend performance. Requires synapse start --profile.
synapse profile stats # per-endpoint latency (avg, p50, p95, p99, max)
synapse profile reset # clear collected timing stats
synapse profile cpu-start # start CPU profiling
synapse profile cpu-report # print CPU profile report
synapse profile cpu-report -o report.html # save as HTML
synapse profile memory-start # start memory profiling
synapse profile memory-snapshot # snapshot current allocations (top 20)
synapse profile memory-snapshot --limit 50 # top 50
synapse profile spy # record py-spy flame graph (requires: pip install py-spy)
synapse profile spy -o profile.svg --duration 60| Flag | Default | Description |
|---|---|---|
--output FILE, -o
|
— | Output file (.html for cpu-report, .svg for spy) |
--limit N |
20 |
Top allocations to show (memory-snapshot) |
--duration SECS |
30 |
Recording duration in seconds (spy) |
python -m pip install -e .
synapse setup
synapse start --detach
synapse status
# ... use Synapse ...
synapse stop