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 --helppnpm 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-devconst { 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
| Command | Use |
|---|---|
init | Sign in, select a project, and create local config, client, and generated types. |
auth login | Sign in through the browser. |
auth status | Show the current CLI identity. |
auth logout | Remove the stored login. |
auth token --project <slug> | Print headers for MCP or another authenticated tool. |
types generate | Refresh voidhash.gen.d.ts from the project schema. |
types check | Fail when committed types are behind the server schema. |
config | Inspect or change CLI URLs, credentials, and profiles. |
Initialize an app
npx voidhash-cli initThe 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 generateCommit the generated declaration. Add this CI check to catch dashboard changes that have not been pulled into the repository:
npx voidhash-cli types checkProfiles
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 stagingThe 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 initfrom the app root. - Generated types are stale — run
npx voidhash-cli types generateand commit the file.