# Set up KIVA in Claude Code

You are a coding agent running in Claude Code. Follow these steps in order to connect this computer to the user's KIVA workspace, so you can work in it for them: search and update records, create webforms and automations, query data.

## Rules

- You run the commands. The user does not.
- Reply in the language the user writes in.
- Never ask the user to paste a password, a token or an API key into the chat. Sign-in happens in their browser.
- Put `-g` right after `kiva` (for example `kiva -g apps list --json`), so the sign-in works in every folder.
- Use `kiva <command> --help` for exact flags instead of guessing, and add `--json` for structured output.
- Before you create, update or delete records, change a schema, send an email or a message, or turn on an automation, say exactly what you will do and wait for the user to approve it.

## 1. Check Node.js

Kiva CLI needs Node.js 24.11 or newer. If the version is older or Node.js is missing, update it before you continue.

```bash
node --version
```

## 2. Install Kiva CLI

Check whether the CLI is already there. If `kiva --help` lists `ds`, `studio` and `automation`, it is ready.

If the command is missing, install it. If a `kiva` command exists without those commands, stop and ask before changing anything.

```bash
kiva --help
npm install -g @kivacore/cli
```

## 3. Sign in

Check who is signed in. If nobody is, start the sign-in: the CLI prints a link and a code. Open the link, approve it in the browser, and the CLI finishes on its own.

With more than one workspace, list them and choose the one to work in.

Claude Code asks before it runs a new command. Approve the `kiva` commands when it asks.

```bash
kiva -g auth who --json
kiva -g auth login
kiva -g auth tenants list --json
```

## 4. Install the Kiva skills

The first command adds a reference for every Kiva CLI command. The second adds the Kiva skills for webforms, automations, data sources, queries, agents and more.

The skills are installed in `~/.claude/skills/`. Read the skills that match a task before starting it.

```bash
kiva skills add
npx skills add Kivacore/agent-skills -a claude-code -g -y
```

## 5. Add KIVA to CLAUDE.md

Optional, for a project that works with KIVA often. Add this note to `CLAUDE.md` so every new session starts with it.

CLAUDE.md:

```markdown
## KIVA

- Work in the KIVA workspace with the `kiva` CLI (`@kivacore/cli`). Run `kiva <command> --help` for exact flags and add `--json` for structured output.
- Read the matching Kiva skill (`kiva-*`) before each task.
- Before creating, updating or deleting records, changing a schema, sending an email or turning on an automation, say exactly what you will do and wait for approval.
```

## 6. Check the connection

Read only, nothing changes. Show the account and the active workspace, list the apps, then suggest five things to do with them.

```bash
kiva -g auth who --json
kiva -g apps list --json
```

## Not available yet

Kiva MCP and the Kiva plugins for Claude and ChatGPT are in development. Until they are ready, Kiva CLI is the way to work with KIVA from an agent. Without terminal access, tell the user to use an agent that can run commands.

## More

- Kiva CLI: https://kiva.sh/cli
- Kiva skills: https://github.com/Kivacore/agent-skills
- Kiva Agent in the browser: https://kiva.sh/agent
