"Commands"

The Tether CLI handles project setup, migrations, and deployment.

Installation

npm install -g tthr

After installation, the tthr command is available globally.

Commands

tthr init <name>

Create a new Tether project.

tthr init my-app

# With template
tthr init my-app --template todo

tthr dev

Start the local development server with hot reloading.

tthr dev

# With specific port
tthr dev --port 3002

tthr generate

Generate TypeScript types from your schema.

tthr generate

Creates tether/_generated/db.ts and tether/_generated/api.ts.


tthr migrate create

Create a migration from schema changes.

tthr migrate create

# With name
tthr migrate create --name add-users-table

tthr migrate up

Apply pending migrations.

tthr migrate up

tthr migrate down

Roll back the last migration.

tthr migrate down

tthr migrate status

Show migration status.

tthr migrate status

tthr deploy

Deploy schema and functions to Tether Cloud.

The target environment is resolved automatically from your TETHER_API_KEY in .env (e.g. a tthr_prod_* key deploys to production). You can override with -e:

tthr deploy

# Deploy schema only
tthr deploy --schema

# Deploy functions only
tthr deploy --functions

# Deploy to a specific environment
tthr deploy -e production

# Preview what would be deployed
tthr deploy --dry-run

tthr exec <sql>

Execute a SQL query directly against your project database.

tthr exec "SELECT * FROM users LIMIT 10"

# Check table schema
tthr exec "PRAGMA table_info(users)"

tthr update

Update all Tether packages to the latest version.

tthr update

# Preview changes without updating
tthr update --dry-run

tthr login

Authenticate with Tether Cloud.

tthr login

The CLI uses a device-code flow: it prints a URL and short code, you approve the device in the dashboard, and the CLI receives a Tether-issued session token stored in ~/.tether/credentials.json (permissions 0600).

Session lifetime. CLI sessions are separate from dashboard (web) sessions and last much longer: a CLI token is valid for 90 days from last use (a sliding window). Any command that talks to the API silently extends the session (at most once every 24 hours), so a CLI you use regularly never expires. Web sessions are short-lived Strands Accounts tokens and are refreshed by the dashboard independently.

Expiry and revocation. If a token has expired, or has been revoked from the dashboard's Devices page, you are not left with a "please run tthr login" error. Instead the CLI signs you out and straight back in inline, in the middle of whatever command you ran, and once the device is approved it carries on with the original command (the failed request is replayed with the new token). The same happens if you run any authenticated command while not logged in at all.

In non-interactive shells (no TTY, or CI set) the CLI cannot open the login flow, so it exits with a message asking you to run tthr login.


tthr logout

Log out from Tether Cloud.

tthr logout

tthr whoami

Show the currently authenticated user and how long the current session has left if it goes unused.

tthr whoami