Integrate with a coding agent
Add Voidhash to an app with one command: the CLI sets it up, a coding agent you already have wires it into your code, and the CLI checks the result.
voidhash integrate takes an app from no Voidhash at all to an integration that builds and is
wired into your code. Run it in the app's root:
voidhash integrateIt works in three parts, and tells you the plan before it changes anything.
- The CLI sets up what needs no reading of your code. It finds out what kind of app this is,
signs you in, lets you choose or create the project, creates the perk and product you ask for,
installs the SDK with your package manager, and writes
voidhash.json, the SDK client or environment values, and the generated types. - A coding agent wires the SDK into your code. The CLI runs the agent you already have (Claude Code, Codex, OpenCode, Grok Build, Cursor or fx), with a task written for your platform and project: start the SDK where the app starts, identify the user where you sign them in, gate on a perk, sell a product.
- The CLI checks the result. Your typecheck or build has to pass, the SDK has to be in your code, and, if you start the app, its first event has to arrive. The summary lists the files git shows as changed, what the agent says it did, and what is left for you.
Nothing is committed. Review the changes with git diff, and undo them with
git restore . && git clean -fd if you don't want them.
Before you run it
- A clean git working tree. Everything the run changes can then be reviewed and undone.
--allow-dirtylifts this, also for a directory that isn't a git repository. - A coding agent, signed in. The CLI uses the one you have, with your own account; it sends your code nowhere itself. Without one, see Without an agent.
- A Voidhash account. The command signs you in when needed.
Platforms
| App | --platform | Support | What the agent wires in |
|---|---|---|---|
| Expo | expo | Supported | Provider, config plugin, identify, a perk gate, a purchase screen |
| Next.js | nextjs | Supported | Provider, identify, one or two key events |
| React with Vite | react | Supported | Provider, identify, one or two key events |
| React Native without Expo | react-native | Best effort | As Expo, without the config plugin |
| Other sites built with Vite | web | Best effort | Client module, identify, one or two key events |
| Node.js server | node | Best effort | Client module, a perk check where the server grants paid access |
| iOS app in Swift | ios | Best effort | Configure at launch, identify, a perk gate, purchases |
| Android app in Kotlin | android | Best effort | Configure at launch, identify, a perk gate, purchases |
Supported platforms are the ones the command is tested on with a real app and a real agent. On a best-effort
platform the steps are the same, but less is set up and checked for you: the CLI doesn't edit Xcode or Gradle
project files, and runs no build unless you name one with --check. Go, PHP and Rust servers
aren't covered; follow their library guides instead.
The command picks the platform from what it finds. Pass --platform when it picks wrong.
Agents
| Agent | --agent | Signed in with |
|---|---|---|
| Claude Code | claude | claude auth login |
| Codex | codex | codex login |
| OpenCode | opencode | opencode auth login |
| Grok Build | grok | grok login |
Cursor (cursor-agent) | cursor | cursor-agent login |
| fx | fx | fx login |
The CLI uses the one that is installed. With several, it asks which in a terminal, and otherwise takes the first in this order. The agent runs with its own settings, on your account.
Choose the model
The agent works with the model it is set up with, and the usage is billed to your account with
that agent. To choose a cheaper or a stronger one for this run, pass --model, named the way that
agent names its models:
voidhash integrate --agent claude --model sonnet
voidhash integrate --agent opencode --model anthropic/claude-sonnet-4-5Claude Code takes an alias such as sonnet, opus or haiku, or a full model name. OpenCode
takes provider/model; opencode models, cursor-agent --list-models and grok models list
what those agents offer. fx takes its model from its own settings only. A run that continues an
earlier one keeps that run's model.
What the agent may do
The agent runs without its own interface, so nothing is asked of you while it works: what it isn't allowed is refused.
- It changes files in the app's directory only, and no
.envfile. It is given the names of the variables, not their values. - It runs your project's checks and
git status,git diffandgit log. It installs nothing; the CLI installed the SDK before it started. - It never gets a secret key. Publishable keys, which are safe to ship in an app, are the only keys in its task.
How these limits are kept depends on the agent, and the plan shown before anything runs says it for the one you use:
| Agent | Changing files | Running commands | Reading .env files |
|---|---|---|---|
| Claude Code | Refused outside the limits | Refused | Refused |
| Codex | Refused outside the directory by its sandbox | No network in its sandbox | Told not to |
| OpenCode | Refused outside the limits | Refused | Refused |
| Grok Build, fx | Refused outside the limits | Refused | Told not to |
| Cursor | Told where it may; the CLI warns afterwards | Refused | Told not to |
OpenCode, Grok Build, Cursor and fx are driven over the Agent Client Protocol: the agent asks the CLI before it acts, and the CLI answers by the limits above. Cursor asks before it runs a command but not before it changes a file, so where it writes is only what its task tells it; the CLI warns you when it changes a file outside the limits. "Told not to" means the task says so and nothing enforces it. fx is supported but not yet tested with a real app.
The task is written to .voidhash/integrate/task.md before the agent starts, so you can read
exactly what it is told. That directory ignores itself in git.
Choose what the app uses
On a terminal the command asks for what it needs. A project without perks or products gets an offer to create a first one. In a script, pass flags:
voidhash integrate --project acme/app --perk premium --product pro_monthly --yes| Flag | What it does |
|---|---|
--project | The project to integrate. Without it: the one voidhash.json names, else the command asks. |
--platform | The kind of app, when the one found is wrong. |
--agent | One of the agents, or none. Without it, the one installed. |
--model | The model the agent works with. Without it, the one the agent is set up with. |
--perk | The perk the app gates on. Created when the project has none by that slug. |
--product | The product the app sells. Created as a monthly subscription that grants the perk. |
--location | A paywall location the app presents, with your own screen as the fallback. |
--check | A command that must pass, instead of the typecheck or build the CLI finds. Repeat for several. |
--wait | How long to wait for the app's first event, such as 5m. |
--mcp | Also connect your AI agents to Voidhash. |
--timeout | How long the agent may work. 30 minutes by default. |
--dry-run | Prints the plan and changes nothing. |
--yes | Goes ahead without asking, with the defaults for what isn't passed. |
--json | Prints the result as JSON. |
--allow-dirty | Runs with uncommitted changes, or outside a git repository. |
--restart | Forgets an earlier run in this directory. |
The web SDK doesn't check perks or sell products, so --perk and --product are left out for a
website.
How the result is checked
The CLI runs your project's own checks before it changes anything and again at the end: a
typecheck script or the TypeScript compiler, and for a website the build script too. A check
that fails after the changes goes back to the agent once, with its output. A check that already
failed before the changes isn't held against the run, except for errors it didn't report then.
It then looks for the SDK in your code, and offers to wait while you start the app. An event that arrives shows the app starts the SDK with the right key against the right server. A debug build sends events with the test key; they appear in Studio under Test.
The command exits with 0 when the checks pass and the SDK is in your code, and with 1 when something is missing, which the summary names.
Run it again
The command is safe to repeat. It looks at the project before each step and does only what is missing: a perk that exists isn't created twice, an installed package isn't installed again, a file that exists is kept, and an agent that finished isn't asked again. After an interruption, the agent continues its own earlier conversation.
voidhash integrate # continue, or check again
voidhash integrate --restart # forget the earlier runWithout an agent
With no such agent installed, or with --agent none, the CLI still does its own
part and writes the task:
voidhash integrate --agent noneGive .voidhash/integrate/task.md to the coding agent you use, or follow it
yourself. Then run voidhash integrate again: it checks the result the same way.
In CI and scripts
Nothing is asked when there is no terminal. Pass --project and --yes, and --json for a result
a script can read:
voidhash integrate --project acme/app --agent claude --yes --json{
"outcome": "verified",
"platform": { "id": "react", "name": "React (Vite)", "support": "supported" },
"agent": { "id": "claude", "status": "finished", "report": { "status": "done" } },
"checks": [{ "command": "npm run build", "passed": true, "failedBefore": false, "newErrors": 0 }],
"sdkFoundIn": "src/main.tsx",
"firstRequest": "not_checked",
"changedFiles": [" M src/main.tsx", "?? voidhash.json"],
"leftForYou": ["Set VITE_VOIDHASH_KEY to the production publishable key where you build for production."],
"task": ".voidhash/integrate/task.md"
}outcome is verified, incomplete or handed_off. The agent itself has to be signed in on the
machine that runs it. Sign the CLI in with a person's token in VOIDHASH_API_KEY: a project secret
key doesn't show the team that voidhash.json names.
What stays with you
- Store setup. Connect the App Store, Google Play or Stripe and map your products before you sell for real. Until then, debug builds of the mobile SDKs simulate purchases.
- Native builds. The mobile SDKs contain native code, so rebuild the app; Expo Go can't load it.
- Secret keys. A server needs a secret key, which you create in Studio and put in your environment. The CLI never creates or writes one.
- The production key on the web.
.env.localgets the test key. Set the production key where you build for production. - Review. Read the diff before you commit it, as you would a teammate's.
Something wrong or missing on this page? Tell us by email or on Discord.