The command-line tool
The tanzahost command: log in through your browser, link a folder to an app, deploy it, follow its logs, set variables and roll back. Works in CI too.
Updated 17 Oct 20264 min read
tanzahost is our command-line tool, for macOS, Windows and Linux. It deploys the folder you're in, follows the build, shows your app's logs, sets its variables and rolls back, without opening the dashboard. It uses the same API and the same permissions as the dashboard.
The tool is built, and its download opens with its first signed release. Until then, the dashboard's Developers tab says so, and you can deploy from the dashboard, from GitHub, or from your AI tool through our hosted AI tools server.
Log in
tanzahost loginThe tool shows a code, like KXDP-7QMB, and opens the dashboard in your browser. Check that the page shows the same code, pick the account, and choose Approve. The terminal then says you're logged in.
The code works once, for 10 minutes.
Approving needs an owner of the account.
The tool gets its own token, with the Full scope, for 90 days, named after your computer. It's listed under Developers, marked Made by the command-line tool.
The token is kept in your own settings folder, readable only by you:
~/.config/tanzahost/tokenon Linux,~/Library/Application Support/tanzahost/tokenon macOS, and%AppData%\tanzahost\tokenon Windows.
tanzahost whoami shows who you are, the account, and the token's scope and end date. tanzahost logout revokes this computer's token and forgets it.
Deploy a folder
Asha has her shop's code in a folder called duka on her laptop.
cd duka
tanzahost link
tanzahost deploy --waittanzahost linklists her apps, likeduka / web, and asks for a number. It keeps her choice in.tanzahost/app.json, and adds.tanzahost/to her.gitignore. To skip the question, give the app's ID:tanzahost link APP_ID.tanzahost deploysends the folder as a ZIP, as the dashboard's upload does, and starts a build. We detect the framework and build it.With
--wait, it follows the build and the deploy to the end, and prints the build's last lines if it fails.
Some files never leave your computer: what your .gitignore and a .tanzahostignore name, .git, node_modules, .DS_Store, Thumbs.db, and every .env file except .env.example. Secrets belong in variables, not in files. The ZIP can be up to 500 MB.
The tool finds the link from any folder inside the linked one, as Git does.
Every command
| Command | What it does |
|---|---|
tanzahost login | Log in through your browser, and keep the token on this computer |
tanzahost logout | Revoke this computer's token and forget it |
tanzahost whoami | Show which account and token you're using |
tanzahost projects | List your projects, with their IDs and addresses |
tanzahost apps | List your apps, with their IDs and state. --project shows one project's |
tanzahost link | Link this folder to an app |
tanzahost deploy | Send this folder's code and deploy it. --wait follows it to the end |
tanzahost logs | Show the app's newest log lines. --follow keeps going, --level error shows only errors, --search TEXT finds a word |
tanzahost vars list | List the app's variables' names. Values are never printed |
tanzahost vars set NAME=VALUE | Set one or more variables |
tanzahost vars unset NAME | Remove one or more variables |
tanzahost rollback | Put the version before live again. --to 12 puts build 12 live |
tanzahost mcp | Connect an AI coding tool, like Claude Code or Cursor, through this computer |
tanzahost version | Show the tool's version |
tanzahost help | Show the commands |
Variables you set apply at the next deploy. Run tanzahost deploy, or restart the app in the dashboard.
tanzahost vars set SHOP_NAME=Duka MAIL_FROM=orders@duka.co.tz
tanzahost logs --follow --level error
tanzahost rollbackDeploy from CI
In CI there's no browser, so the tool reads two variables instead of a login:
| Variable | What it holds |
|---|---|
TANZAHOST_TOKEN | A token from Developers, with the Deploy scope, reaching the app's project only |
TANZAHOST_APP | The app's ID, from the app's Settings tab |
Then tanzahost deploy --wait deploys the folder it runs in, and fails the job if the build or the deploy fails.
Here's a GitHub Actions workflow that deploys Asha's shop on every push to main. Add the two values as repository secrets first, under your repository's Settings, Secrets and variables, Actions:
name: Deploy to Tanzahost
on:
push:
branches: [main]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the tanzahost tool
run: curl -fsSL https://tanzahost.com/cli/install.sh | sh
- name: Deploy, and fail the job if the deploy fails
run: tanzahost deploy --wait
env:
TANZAHOST_TOKEN: ${{ secrets.TANZAHOST_TOKEN }}
TANZAHOST_APP: ${{ secrets.TANZAHOST_APP }}The install step works once the tool's download is open. If your app already deploys from GitHub through our GitHub app, you don't need this: every push deploys by itself.
Next
Call the API yourself: the Tanzahost API.
Let Cursor or Claude Code deploy for you: AI coding tools.