# Set up this site on NxisAI — instructions for your coding agent These are instructions for you, the coding agent, to set up the user's site on NxisAI from inside the project that builds it. NxisAI makes a site actionable by AI agents. Out on the web, an MCP server lets external agents query the site's data and call the actions it declares. On the page, the NxisAI site tag registers those actions as WebMCP tools and brings a hosted chat that visitors can use. All of it is generated from the site's live pages. Do the steps yourself wherever you have a shell and the project's files. Do not hand the user commands to copy. Stop only where a step needs the user: signing in, choosing a plan, spending credits, deploying, publishing, and the other points under "Ask the user before". Work in order. These instructions are published at https://nxis.ai/agent-setup.md. Fetch that URL again whenever you want to check you have the current version. If the user is reading this instead of an agent: every step can also be done by hand in the dashboard at https://app.nxis.ai, and the quick start is at https://nxis.ai/quick-start. ## Before you start Check that this run can work: - **You are in the project that builds the site,** with a shell. Verification and the site tag are changes to the site's own HTML. - **The user can deploy the site to production.** The run stops twice for a production deploy. A site the user can't deploy never verifies, and nothing after verification does anything. - **The user can sign in with Google in a browser,** on this machine or on their phone. Then ask the user for **the site's production URL.** Do not infer it from the repository: a monorepo, a staging domain or a subdomain is easy to get wrong, and the host can't be changed later. `www.example.com` and `example.com` are different sites; use the host production serves. ## 1 · Install the nxis CLI Every step below runs through the `nxis` command-line tool. Check whether it is already installed with `nxis --help`. If it isn't, install it. macOS and Linux (and Windows inside WSL). The installer checks the release's signature and checksum before installing, and puts `nxis` in `~/.local/bin`: ``` curl -fsSL https://github.com/nxisai/cli/releases/latest/download/install.sh | sh ``` Anywhere with Node.js 20 or later, without installing: ``` npx -y @nxisai/cli@latest --help ``` With npx, write `npx -y @nxisai/cli@latest` wherever these instructions say `nxis`. If `nxis --help` has no "Hosted agents" section, the version is too old for step 12: install again, or run `nxis update`. Pass `--json` on every command. Each one prints a single JSON object and exits with one of four codes: | Exit | Means | Do | |---|---|---| | `0` | Done | Continue | | `2` | Waiting on the user: a sign-in, a payment, a deploy, or a choice | Relay the message and its `reason`. **Never run the command again on your own** | | `3` | Not signed in, or not allowed | `nxis login`, then run the command again | | `1` | Failed | Report the error as given | **Optional: the step-by-step skill.** `npx -y skills add nxisai/skills --skill agentic-site-onboarding` installs a longer version of these steps as an agent skill, with the edge cases. If it installs, read it and follow it. If it doesn't, the steps below are complete on their own. **Optional: MCP tools.** If the user prefers tool calls to shell commands, `nxis mcp install` adds NxisAI's onboarding tools to your agent as a local MCP server that uses the CLI's sign-in, so no key goes into your config. Reload your MCP servers afterwards. Sign-in, plans and the hosted agents still run through the CLI. Do not add `--allow-unconfirmed`. ## 2 · Sign in, pick the organization, choose a plan 1. **Where things stand.** `nxis status --json` never fails for "not signed in". It reports whether the user is signed in, their organizations, the current organization and site, the plan and the credits. Skip every step it shows is done. A user coming back may need only the last few steps. 2. **Sign in.** `nxis login`. It prints a URL and a short code, then waits. Relay both exactly as printed, and tell the user to check that the code on the page matches. The URL works from any device. Never ask for a password or a one-time code in the conversation; if the user offers one, tell them not to. 3. **The organization.** - **If the user's request names one,** as in `… set up this site on NxisAI in organization "Acme" ()`, use that one. Once signed in, find it among the organizations `nxis status --json` lists: by its id when the request gives one, otherwise by its exact name (if more than one has that name, ask which). Run `nxis orgs use --json`. If none matches, or `orgs use` fails with `org_not_found`, the signed-in account can't see that organization: **stop.** Tell the user which account is signed in (the `email` from `status`) and that they need to sign in with the account that owns or belongs to that organization (`nxis logout`, then `nxis login`). Never create an organization in this case, and never carry on in a different one. - **If it doesn't,** with one organization, use it. With several, ask which, then `nxis orgs use `. With none, ask what to call it (usually the site's own name) and run `nxis orgs create --name "…" --website "https://…"`. 4. **The plan.** Skip this if `status` shows an active plan. Otherwise run `nxis plans --json` and put the plans to the user as a numbered list with each price, interval and credit grant, plus **Cancel**, and wait for their pick. The free plan needs no card: `nxis subscribe free`. A paid plan, `nxis subscribe `, opens a payment page and waits; payment details go to that page, never to you. If it exits `2` with `payment_pending`, **do not run it again** (a second run opens a second checkout): wait for the user, then `nxis status`. Never choose a paid plan for the user, and never read "set me up" as consent to be charged. ## 3 · Create the site and add the verification tag 1. `nxis sites list --json`. If the site is already there, `nxis sites use ` and carry on from the first step it hasn't done. Otherwise `nxis sites create --json`, with the URL the user gave you. The CLI makes it the current site. 2. `nxis sites verify --token --json` returns a META tag. Add it to the site's HTML head, where the project already keeps its meta tags (a layout, a template, a head component). 3. **Stop and tell the user to deploy to production.** Say why: the verifier fetches the site's own URL, so a deploy preview or branch deploy never verifies, however correct the tag in it is. Say how this project reaches production if you can tell (a merge to the production branch, a promote, a deploy command). ## 4 · Verify Once the user says the deploy is live: `nxis sites verify --check --json`. `site_not_verified` almost always means the deploy hasn't landed yet. Say so, and check again when the user says it's live, or every 20 to 30 seconds, never in a tight loop. If it keeps failing, check whether what was deployed was a preview. `site_unreachable` means the site can't be fetched at all. Do not continue until this passes. The steps after it report success and do nothing on an unverified site. ## 5 · Check the site names its own host, then crawl it The next step bills for every page the crawl finds, so check before crawling: - The live sitemap lists pages on the site's own host, not a generated one such as `*.netlify.app`, `*.vercel.app` or `*.pages.dev`. `nxis crawl submit` checks this and refuses with `sitemap_off_host`. - The source has no absolute URLs on another host in its metadata, structured data, canonical links or config. - The site's origin is a constant in the code (which an environment variable may override), not a host-generated variable. If any of these fails, stop, show the user what you found, and fix it. That is a code change and another deploy. Then `nxis crawl submit --wait --json`. It finds the sitemap at the root's `/sitemap.xml`; pass the sitemap's URL if the project puts it elsewhere. If the site has no sitemap, say so and stop rather than inventing URLs. `crawl_running` means the wait ran out and the crawl carries on: `nxis crawl status --wait --json`. Don't move on while it runs. ## 6 · Generate structured data, then publish it This is the step that **spends the user's credits.** Everything before it is free. 1. **Plan.** `nxis autofill plan --existing import_and_complete --json` returns the number of pages, a breakdown by media type, and the credit balance. If the project's templates already output JSON-LD, say so and what kinds of records. 2. **Ask, as a numbered choice, with the count and the balance:** 1. **Import and complete** (recommended): keep the site's own JSON-LD, generate only what's missing 2. **Import only**: the site's own JSON-LD, no AI, at a fixed price per page 3. **Generate everything**: AI writes all of it 4. **Narrow it**: one media type (`--media-type HTML`) or one path (`--pattern /products/*`), combined with any of the above 5. **Cancel** If they narrow it or pick another mode, plan again with that and show the new count, so the number they approve is the number that runs. Don't estimate a total cost. If the count is large next to the balance, say the batch may stop partway. 3. **Submit once, on an explicit yes, with exactly what was approved:** `nxis autofill submit --existing … [--media-type …] [--pattern …] --yes --wait --json`. `--yes` means the user approved this plan; never pass it otherwise. Never submit twice: on a timeout, `nxis autofill status --recent --json` finds the batch. A batch that ran out of credits partway (`autofill_paused`) still produced drafts for the pages it finished. 4. **Publish.** Generated records are drafts until published. The first publish creates an access key for the organization, kept in the OS keychain: say so before it. `nxis publish --json` counts what would go live and stops; show the user the count, then `nxis publish --yes --json`. If they would rather review the records in the dashboard first, leave them unpublished and say so in your report. ## 7 · Turn on the site's MCP server Read first: `nxis mcp settings --json`. Report what is already on, and never turn off something you didn't turn on. Ask the user, then `nxis mcp public on --json`. This makes the published records queryable by any agent without a key, and prints the server's address. The address is `