Skip to content

Getting Started

Set up with a coding agent

A copyable prompt that has your coding agent install and configure Clivly in your app, and the steps that stay with you.

There are two ways to the same result. The Quickstart walks through the commands yourself. This page gives you a prompt to paste into whatever coding agent you use, so it inspects your project and does the editing for you. Both end at the same point: your app paired with your Clivly workspace and npx clivly status passing.

Not the same as agent access

This page is about an agent that edits your app's code. To let an AI agent work inside your CRM — read contacts, draft emails, create tasks — see Connect an agent.

What the agent does, and what you do

The agent can do everything that happens inside your repository. A few steps need you, because they involve your account or your secrets.

The agent:

  • Works out your framework, package manager, ORM and auth library, and whether Clivly is already partly installed.
  • Installs clivly, previews clivly init with --dry-run, then runs it.
  • Checks which tables init chose as contacts and companies, and corrects the choice when it is wrong.
  • Applies the manual steps init prints, such as a bundler setting.
  • Runs your type check and build, then npx clivly status.

You:

  • Create your account and organization at clivly.com/sign-up, if you have not yet.
  • Run npx clivly login in your own terminal. It opens a browser where you approve the machine, then writes CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET to your env file. The agent never needs to see either key.
  • Later, set the same two values in your hosting provider and deploy. See Deployment.

clivly init skips browser pairing on its own when no one is at a terminal to approve it, as with an agent or CI, and prints Skipped browser pairing. That is expected here, not an error: pairing is the step you run.

Package manager
terminal
npx clivly login

The setup prompt

Paste this into your coding agent from your app's root folder. In a monorepo, start from the app that should connect to Clivly. The prompt works on its own and does not depend on this page.

prompt
Set up Clivly in this project, so the app connects to my Clivly workspace and syncs its customer records.

Clivly is a hosted CRM. Its npm package "clivly" adds a config file (clivly.config.ts), a sync route and a boot hook to this app. It does not create database tables or change the ORM schema.

Read these before changing anything:
- Quickstart: https://clivly.com/docs/getting-started/quickstart
- CLI commands: https://clivly.com/docs/reference/cli
- Entities and mapping: https://clivly.com/docs/concepts/entities
- The page for this framework: https://clivly.com/docs/frameworks/next-js, /tanstack-start, /sveltekit, /remix or /nuxt; anything else uses https://clivly.com/docs/frameworks/manual
- Once installed, node_modules/clivly/README.md documents the installed version. Where it disagrees with the website, follow the README.

You may inspect and edit files in this project, install dependencies, and run local commands and checks. Ask me first before you create any account, handle credentials, change anything outside this repository (dashboards, DNS, hosting or environment settings), touch production data, publish, or deploy. Never ask me to paste a secret into this chat, never print one, and never commit one.

1. Inspect. Read the project's own instructions (AGENTS.md, CLAUDE.md, CONTRIBUTING, README or similar) and follow them. Identify the framework, the package manager (from the lockfile), the Node version (Clivly needs 22 or newer), the ORM and where its schema, database client and auth instance are exported, and, in a monorepo, which app should hold Clivly. Check whether Clivly is already partly installed (clivly.config.ts, "clivly" in package.json, CLIVLY_* keys in an env file); if so, extend that setup rather than starting over. Note any uncommitted changes and leave them alone.

2. Check fit. Clivly needs a server runtime the app owns; a static-only site cannot host the sync route. "clivly init" scaffolds routes for Next.js, TanStack Start, SvelteKit, Remix and Nuxt, and generates a config for Drizzle only. For another framework, mount the handler by hand as the manual page shows. For Prisma, Kysely or raw SQL, write the fetchPage source the docs describe. If the project cannot fit any of these, stop and tell me why.

3. Preview. Install clivly with the project's package manager. Run "clivly init --dry-run --yes" through that package manager (npx, pnpm exec, yarn or bunx). Add --schema, --db-import, --auth-import, --contact-table, --company-table or --framework only where detection is wrong or missing. The dry run writes nothing. Read the files it would create, the tables it chose as contact and company, and everything under "You will also need to".

4. Check the mapping. Confirm the contact table holds this app's customers or users and the company table holds their companies, not an auth library's internal tables (sessions, accounts, organizations used only for login) unless those really are the right records. If the code does not settle it, show me the candidate tables and ask which to use. Never map password, token or secret columns.

5. Apply. Run "clivly init --yes --no-login" with the same flags. Make the changes it lists under "You will also need to". Change clivly.config.ts only where step 4 found a problem. Keep the generated route files as generated, and do not edit unrelated code.

6. Verify locally. Run the project's type check, lint and build, whichever exist, and fix anything your changes broke. Run "clivly status". Before pairing, the credential steps fail; that is expected. The config, edge-safety and boot hook steps should pass.

7. Hand the keys to me. Confirm the env file clivly init wrote to is git-ignored. Then ask me to run "npx clivly login" in my own terminal: it opens a browser to approve this machine and writes CLIVLY_SECRET_KEY and CLIVLY_SYNC_TRIGGER_SECRET to that file. If I already copied those two keys from the Clivly dashboard, I can paste them into the env file myself instead. If I have no account yet, I start at https://clivly.com/sign-up. Wait for me to confirm.

8. Confirm the connection. Start the app the way the project normally does, let it serve a request, then run "clivly status" again. Success is: every step under "This project" passes and "Application connected" under "Workspace" shows a recent heartbeat. A warning about the sync trigger URL is fine for local development.

Finish with a short report: what you detected, the files you created or changed, the contact and company tables you chose and why, the manual steps you applied, the checks you ran and their results, and anything left for me. If you could not finish, name the step that stopped you, quote the exact error or status output, and say what you tried.

When it is done

Open your dashboard: the app shows as Live, and records appear once the first sync runs. From here:

  • To change which tables sync, or add deals and custom objects, see Entities & mapping. It has a focused prompt for that job.
  • Before you deploy, see Deployment. It has a prompt that prepares the code without deploying anything.
  • If a step fails, see Diagnostics. It has a prompt that works through clivly status with you.