All commands (CLI)
Every Switchboard terminal command, with examples.
You use the Switchboard commands (the CLI, command line interface) in the terminal. Usually your AI runs them for you, but you can use them yourself too.
There's nothing to install. Every command starts with npx -y @switchboard-host/cli@latest, followed by what you want to do:
npx -y @switchboard-host/cli@latest statusExcept for login, init and apps, the commands work on the website of the folder you're in.
Use --app name to pick another website.
#Getting started
| Command | What it does |
|---|---|
login |
Log in through your browser (you approve the connection on a Switchboard page). |
logout |
Log out on this computer. |
whoami |
Shows which account you're logged in with. |
apps |
Your websites. |
init <name> [folder] |
Brings a website onto this computer and sets everything up: logging in, fetching the files, installing what's needed. |
link [name] |
Connects the folder you're in to a website (if you already have the files). |
npx -y @switchboard-host/cli@latest init smiths-bakery
npx -y @switchboard-host/cli@latest init smiths-bakery bakery-website#Publishing
| Command | What it does |
|---|---|
deploy |
Saves your changes and publishes them. Follows the build and gives you the address, or an explanation if something fails. |
deploy -m "text" |
The same, with a description of what you changed. |
deploy --no-follow |
Starts publishing without waiting for the result. |
status |
How your website is doing. |
logs |
What your website is writing to its logs right now. -f keeps watching; --role backend shows only the separate backend. |
rollback [number] |
Puts an earlier version back online (without a number: the previous one). |
restart |
Restarts your website, for example after changing a setting. |
open |
Opens your website in the browser. With --dashboard it opens the dashboard. |
npx -y @switchboard-host/cli@latest deploy -m "Updated prices"
npx -y @switchboard-host/cli@latest logs -f
npx -y @switchboard-host/cli@latest rollback 12#Settings
| Command | What it does |
|---|---|
env list |
Your settings and secrets (secrets stay hidden). |
env set NAME VALUE |
Saves a setting. With --secret it becomes a secret. Without a value it asks for one. |
env unset NAME |
Removes a setting. |
domains |
Your domain names and whether they work yet. |
npx -y @switchboard-host/cli@latest env set CONTACT_EMAIL info@bakerysmith.com
npx -y @switchboard-host/cli@latest env set MOLLIE_API_KEY --secretSee also settings and secrets.
#Help
| Command | What it does |
|---|---|
doctor |
Checks that everything is ready: Node.js, Git, login and the connection. With --fix it fixes what it can. |
mcp |
Starts the MCP connection for your AI tool. See MCP. |
git-credential |
Used by Git to log in. Don't run it yourself. |
--help |
Shows all commands. |
npx -y @switchboard-host/cli@latest doctor#Options for every command
| Option | Meaning |
|---|---|
--app <name> |
Pick the website (default: the one of this folder). |
--lang nl or --lang en |
Language of the messages. |
--json |
Output for programs and AI tools. |
--verbose |
More detail; for deploy, the full build log. |
#For advanced users
- Login details are stored in a file on your computer: on Windows in
%APPDATA%\switchboard\config.json, on a Mac in~/Library/Application Support/switchboard/config.jsonand on Linux in~/.config/switchboard/config.json. - Every website folder has
.switchboard/app.jsonwith the website's name. It contains no secrets. SWITCHBOARD_TOKENandSWITCHBOARD_API_URLoverride the login details, for example for automation.- Exit codes:
0success,1error,2publishing failed.