Command-line interface

A single binary for your project workflow: sign in, link a directory to a project, run SQL migrations, deploy Edge Functions, and generate types for the JavaScript SDK.

Install

Run it on demand with npm — no global install needed:

npx @kethosbase/cli --help

Or install it so the kethosbase command is on your PATH:

npm install -g @kethosbase/cli
kethosbase --help

The npm package wraps a self-contained Go binary and picks the right build for your OS and architecture; there is nothing else to install.

Log in

Authenticate the CLI to your account. It opens the dashboard to authorize and stores a session on this machine for later commands:

kethosbase login

Link a project

Run this at the root of your app to associate the working directory with one project. It writes a small config file so later commands know which project to act on:

kethosbase link

You pick the project interactively, or pass its ref directly:

kethosbase link --project-ref <project-ref>

Run migrations

Apply your SQL migration files to the linked project's database, in order. This is the same schema surface you get over Direct SQL — the CLI just drives it for you:

# applies the migration files in the project directory
kethosbase migrate

Deploy a function

Author an Edge Function in TypeScript and ship it in one command. The CLI bundles your entrypoint with the SDK, compiles it to a WebAssembly module, validates it, and uploads it to the linked project:

kethosbase functions deploy app.ts
# → Deployed function app (sha256 …).

The TypeScript toolchain is provisioned automatically on first use: the CLI downloads and checksum-verifies its WebAssembly compiler for your platform, so there is nothing else to set up. Add --dry-run -o app.wasm to build and inspect the module without uploading.

Generate types

Introspect the linked project's schema and emit a TypeScript Database type. Import it into createClient so the SDK knows your tables, columns, and function signatures:

kethosbase gen types > database.types.ts
import { createClient } from "@kethosbase/client";
import type { Database } from "./database.types";

const kb = createClient<Database>(url, key);
// kb.from("todos").select(...) is now fully typed
Run kethosbase <command> --help for the flags a command accepts. Migrations, function deploys, and type generation act on the project the current directory is linked to, so link once per project.