Skip to content

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:

Terminal
npx -y @switchboard-host/cli@latest status

Except 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).
Terminal
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.
Terminal
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.
Terminal
npx -y @switchboard-host/cli@latest env set CONTACT_EMAIL info@bakerysmith.com
npx -y @switchboard-host/cli@latest env set MOLLIE_API_KEY --secret

See 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.
Terminal
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.json and on Linux in ~/.config/switchboard/config.json.
  • Every website folder has .switchboard/app.json with the website's name. It contains no secrets.
  • SWITCHBOARD_TOKEN and SWITCHBOARD_API_URL override the login details, for example for automation.
  • Exit codes: 0 success, 1 error, 2 publishing failed.

Was this helpful?

Guide

Search the guide

Type a word or a question. Tip: press Ctrl K to open this anywhere.