Skip to main content
kRouter

CLI reference

Every flag the `krouter` command supports. Tray mode, port override, MITM toggle, log streaming, version pinning.


The krouter command is what NPM installs globally and what you run to start the server. It boots the dashboard on localhost:20128 and (optionally) launches a tray icon.

Basics

# Start in the foreground with logs in the terminal
krouter
 
# Start in the background with a tray icon
krouter -t
 
# Stop a running tray-mode instance
pkill -f krouter

All flags

FlagWhat it does
-t, --trayLaunch the tray icon and detach from the terminal. The dashboard runs in the background.
-p PORT, --port PORTOverride the default 20128 port. Useful if you have another service on that port.
-l, --logsStream the server log to your terminal (only meaningful without -t).
-v, --versionPrint the installed version and exit.
-h, --helpShow usage and exit.
--reset-passwordReset the dashboard login password to the value of INITIAL_PASSWORD (default 123456). Use if you lost your password.
--no-mitmForce-disable MITM mode on this run, even if it's enabled in the saved settings. Useful for troubleshooting.
--config FILELoad a JSON config file overriding env vars. Mostly for CI / scripted setups.

Common workflows

Quick dashboard view

krouter -t
# Tray icon → right-click → Open Dashboard
# Or just visit http://localhost:20128/dashboard

Test that an upgrade works

# Stop the running server
pkill -f krouter
 
# Upgrade
npm install -g @sifxprime/krouter@latest
 
# Start fresh in the terminal so you can see boot logs
krouter

Run on a non-standard port

krouter -p 28128
# Dashboard: http://localhost:28128

If you run on a custom port, IDEs you've already configured will keep pointing to :20128. Update your IDE's endpoint URL too.

Run on a server (no tray)

On Linux servers without a graphical environment, drop the -t flag and use a process manager instead:

# pm2 (recommended)
npm install -g pm2
pm2 start "$(which krouter)" --name krouter
pm2 save
pm2 startup
 
# Or systemd
sudo tee /etc/systemd/system/krouter.service << 'EOF'
[Unit]
Description=kRouter
After=network.target
 
[Service]
Type=simple
User=youruser
WorkingDirectory=/home/youruser
ExecStart=/usr/bin/env krouter
Restart=on-failure
Environment=PORT=20128
Environment=HOSTNAME=0.0.0.0
Environment=NODE_ENV=production
 
[Install]
WantedBy=multi-user.target
EOF
 
sudo systemctl daemon-reload
sudo systemctl enable --now krouter

Stream logs without restarting

If kRouter is running in tray mode and you want to see the live log:

# macOS / Linux
tail -F "$HOME/.krouter/logs/server.log"
 
# Windows PowerShell
Get-Content -Wait "$env:APPDATA\krouter\logs\server.log"

Exit codes

kRouter returns standard Unix exit codes:

CodeMeaning
0Clean exit (Ctrl-C or krouter --version)
1Generic error — check the log
2Port already in use
3Database lock (another process is holding data.sqlite)
4Missing/corrupted MITM certificate (run --reset-mitm)
5Out of memory (try a node arg: NODE_OPTIONS=--max-old-space-size=4096 krouter)

Where to go next