Docs

File DA-005 View as Markdown

CLI

npx @doubleagent-so/cli init                               # keyless install, prints the claim URL
npx @doubleagent-so/cli init --email you@company.com       # create account + site, install its pk
npx @doubleagent-so/cli init --key pk_live_xxx             # install with an existing public key
npx @doubleagent-so/cli init --yes --json                  # for coding agents
npx @doubleagent-so/cli verify https://SITE [--api <origin>] [--json]
npx @doubleagent-so/cli login | logout [--all]
npx @doubleagent-so/cli sites
npx @doubleagent-so/cli keys [list|create|rotate|revoke] [key_id] [--site st_…] [--kind pk|sk] [--env live|test]
npx @doubleagent-so/cli verify-domain shop.example.com --method dns|meta|file|script [--site st_…]

Node 18+, no runtime dependencies. npm package: doubleagent.

init

Flag
noneKeyless. Prints Installed without a key. Claim <domain> at https://app.doubleagent.so/claim?domain=<domain> to see the data (everything collected until then is kept). Domain from --domain, package.json homepage or CNAME. --portal or $DOUBLEAGENT_PORTAL changes the portal.
--key pk_…Adds data-key; re-running on a keyless install adds it in place. sk_… is refused.
--email you@x.com [--domain] [--name] [--test]POST /v1/accounts, solves the proof-of-work, installs the pk, prints sk_test once
--profile, --cwd, --dry-run, --yes/-y, --jsonAs named. --dry-run never creates an account.
StackWhere the snippet goes
Next.js App Routerapp/layout.* (next/script)
Next.js Pages Routerpages/_document.* <Head>, created if missing
Vite, React, Vue (Lovable, Bolt, v0)index.html <head>
Static HTMLEvery root *.html, or public/index.html
Astrosrc/layouts/*.astro, is:inline
Nuxtnuxt.config app.head.script, or plugins/doubleagent.client.*
SvelteKitsrc/app.html, before %sveltekit.head%
Remix / React Routerapp/root.* <head>
WordPress themeheader.php, before wp_head()
Shopify themeNo edits. Use the app embed.
{ "stack": "next-app", "status": "install", "dry_run": false, "keyless": true, "key": null,
  "domain": "shop.example.com", "claim_url": "https://app.doubleagent.so/claim?domain=shop.example.com",
  "account": null, "files_changed": ["app/layout.tsx"], "integrations": ["ga4"], "next_steps": ["…"], "diff": "…" }

Exit codes: 0 ok, 1 error or aborted, 2 unsupported stack.

login, sites, keys, verify-domain

verify

Checks the server HTML for the script, the stub and (optional) key, then calls GET /v1/install-check. A keyless script passes. Exit 0 only if all pass.