CLI

Connect projects and generate types from the terminal.

voidhash-cli is not a dependency of the SDK. Run it directly, without installing anything:

npx voidhash-cli --help

pnpm dlx voidhash-cli --help works the same way. Isolated invocation keeps the CLI out of your app's dependency tree, so it cannot influence your bundle or lockfile resolution.

Install it as a dev dependency

Install it when you run it repeatedly, and specifically when you use the Metro plugin. The plugin spawns voidhash-cli types generate --watch alongside the Metro dev server and resolves the binary from PATH, which a dev-dependency install provides:

npm install voidhash-cli --save-dev
metro.config.js
const { getDefaultConfig } = require("expo/metro-config");
const { withVoidhash } = require("@voidhash/react-native/metro");

module.exports = withVoidhash(getDefaultConfig(__dirname));

If the binary is not on PATH, withVoidhash warns and returns the Metro config unchanged, so the dev server still starts.

Commands

CommandUse
initSign in, select a project, and create local config, client, and generated types.
auth loginSign in through the browser.
auth statusShow the current CLI identity.
auth logoutRemove the stored login.
auth token --project <slug>Print headers for MCP or another authenticated tool.
types generateRefresh voidhash.gen.d.ts from the project schema.
types checkFail when committed types are behind the server schema.
configInspect or change CLI URLs, credentials, and profiles.

Initialize an app

npx voidhash-cli init

The interactive command creates voidhash.config.ts, src/lib/voidhash.ts, and voidhash.gen.d.ts. It does not install packages or create a local schema.

Keep types in sync

npx voidhash-cli types generate

Commit the generated declaration. Add this CI check to catch dashboard changes that have not been pulled into the repository:

npx voidhash-cli types check

Profiles

Use a profile to keep environment-specific CLI settings separate:

npx voidhash-cli config set api_url https://example.test --profile staging
npx voidhash-cli types generate --profile staging

The base configuration lives in ~/.voidhash; project selection lives in the committed voidhash.config.ts.

Troubleshooting

  • Not logged in — run npx voidhash-cli auth login.
  • Project config missing — run npx voidhash-cli init from the app root.
  • Generated types are stale — run npx voidhash-cli types generate and commit the file.