Overview

What the Voidhash CLI is, how to run it, and how its configuration files work.

The Voidhash CLI (voidhash-cli) is the command-line companion for a Voidhash project. It signs you in, wires a React Native project to a team and project, keeps your generated TypeScript types in sync with the server schema, launches the local paywall Studio, and builds and deploys your paywalls.

Running the CLI

Add it as a dev dependency and run it with npx:

npm i voidhash-cli -D
npx voidhash-cli init

Package name

The published package and binary are both named voidhash-cli. Older material referring to @voidhash/cli is out of date — that package name does not exist.

Commands

CommandDescription
voidhash-cli initInitialize a Voidhash project: sign in, pick a team and project, and scaffold the config files
voidhash-cli authManage authentication — login, logout, status, and token
voidhash-cli typesGenerate and validate the voidhash.gen.d.ts declaration file — generate and check
voidhash-cli studioLaunch the local paywall preview Studio
voidhash-cli deployBuild and deploy paywalls to Voidhash
voidhash-cli configPrint and manage the CLI configuration — set and reset

Global flags

Two flags are shared by every command and can be placed before or after the subcommand — npx voidhash-cli deploy --profile staging and npx voidhash-cli --profile staging deploy are equivalent.

--debug, -d

Enables debug logging with full error traces. By default the CLI prints a short, friendly error message and exits with code 1; with --debug it also prints the full cause chain, which is what you want when reporting an issue.

npx voidhash-cli --debug types generate

--profile <name>

Selects a named configuration profile: a sparse set of overrides (api_key, api_url, web_url) merged on top of the shared base configuration in ~/.voidhash. Any key the profile does not override falls back to the base value. There is no short alias — -p is used by studio for --port.

npx voidhash-cli deploy --profile staging

While a profile is active, configuration writes (for example auth login storing an API key, or config set) go into that profile's overrides only — the base configuration is untouched. See voidhash-cli config for managing profiles.

CLI configuration: ~/.voidhash

The CLI stores its own configuration as JSON in .voidhash in your home directory. It holds the shared base keys plus an optional profiles map:

~/.voidhash
{
  "api_key": "<set by voidhash-cli auth login>",
  "api_url": "https://api.voidhash.com",
  "web_url": "https://voidhash.com",
  "profiles": {
    "staging": {
      "api_url": "https://api.staging.voidhash.com"
    }
  }
}
KeyDescription
api_keyYour login credential, written by voidhash-cli auth login. null when logged out
api_urlThe Voidhash API endpoint. Defaults to https://api.voidhash.com
web_urlThe Voidhash dashboard URL, used for the browser login flow. Defaults to https://voidhash.com
profilesOptional map of named profiles. Each profile stores only the keys it overrides

You rarely edit this file by hand — voidhash-cli config prints the resolved configuration and config set / config reset manage it for you.

Project configuration: voidhash.config.ts

Each project has a voidhash.config.ts at its root, created by voidhash-cli init. It ties the directory to a Voidhash team and project and is read by types generate, types check, and deploy:

voidhash.config.ts
import { defineConfig } from "voidhash-cli";

export default defineConfig({
  team: "my-team",
  project: "my-app",
});
FieldDescription
teamThe team (organization) slug the project belongs to
projectThe project slug within the team
typesOutputOptional output path for the generated declaration file. Defaults to voidhash.gen.d.ts at the project root

Two config files, two scopes

~/.voidhash is per-machine and holds your credentials and endpoints; voidhash.config.ts is per-project, checked into the repository, and holds no secrets.