Stand Guidebook
Chapter 13 of 14
Field guide
What to learn in this chapter
Start with installation and sign-in, then jump to the job you need. Command examples use placeholder IDs: replace them with IDs returned by your own account. Ordinary examples use readable terminal output; use --json when an agent or script needs to parse the result.
Need an exact capability definition, plan requirement, or limitation? Browse the Feature Reference.
Start here
Install the official package.
You need Node.js 22 or newer and npm on macOS, Linux, or WSL. On Windows, run these commands inside WSL; native Windows is not supported. A coding agent needs access to that terminal too.
Install @standchat/cli globally, then check the executable and version. You can run Stand commands from any folder. If the official package cannot be installed, check the error instead of substituting a similarly named package.
The unpinned install command follows npm’s latest tag. Run the same command to update, and record stand --version when asking for help. Package versions and npm tags do not choose your API environment.
Install or update
node --version
npm install --global @standchat/cli
stand --version
stand --helpIf stand is not found after installation, check that your npm global executable directory is on PATH in this terminal and in the agent’s terminal.
Your account
Approve access in your browser.
For website setup, use the setup permission preset. Keep the login command running. It prints a verification URL and a separate user code; open the URL yourself, sign in or create an account, and review the requested access.
After the browser says “Stand CLI authorized”, return to the terminal and wait for credential storage to finish. Then check setup status. If it reports browser_onboarding_required, open the indicated dashboard with the same account, complete your profile and organization, and run the check again.
Inspect the ready and status fields, not just the command’s exit code. A ready result means account configuration can begin. It does not mean a widget is installed or a visitor has received an answer.
First website setup
stand auth login --setup
stand setup status
stand auth status --checkauth status alone shows local sign-in metadata. Adding --check verifies your identity through the API; it does not check completed onboarding.
If this host has no usable OS keychain
stand auth login --setup --credential-store filemacOS defaults to Keychain; Linux uses the OS secret service when available. File storage is an explicit choice for hosts such as headless Linux or WSL. Credentials stay in private user storage, outside the project.
Environments
Keep each target in its own profile.
The default profile targets Stand production. Create a named profile before logging in to staging or a preview. A name such as preview1936 is only a label: it does not discover URLs or start a preview environment.
Save the verified API origin and issuer together, then use --profile on each command. A preview needs its own deployed endpoints. For a custom environment, setup status also accepts --app-url with its verified dashboard origin.
config list shows saved configuration. auth status shows the endpoints resolved for the current invocation. STAND_PROFILE selects a saved profile; STAND_API_URL and STAND_ISSUER override endpoints without rewriting it. Credentials are bound to the selected API and issuer, so changing the target may require a new login.
Example: a separate staging profile
stand config set --profile staging \
--api-url https://api.staging.stand.chat \
--issuer https://auth.staging.stand.chat/realms/stand
stand config list
stand auth login --profile staging --setup
stand setup status --profile staging
stand sites list --profile stagingUse these endpoints only for the Stand staging environment. Use the actual preview endpoints for a preview profile. Commands without --profile use STAND_PROFILE when set, otherwise default.
Find your way
Inspect before you change anything.
Use --help for a readable overview and commands --json for machine-readable discovery. Each named command describes its inputs and whether it needs mutation confirmation. schema takes an operation ID and shows its required scopes and request shape.
List existing Sites, Stand-ins, and knowledge bases before creating more. Keep their returned IDs in your working notes, reuse the intended resources, and check the account’s plan and usage. A display name is not a reliable resource identifier.
For an operation without a named shortcut, stand api accepts its published method and /v1/ path. It uses the same authentication and permissions and only supports operations in the bundled public API contract.
Reference
Look up the full command and API contract.
The reference covers scopes, request shapes, output, and operations beyond these walkthroughs.
Discover commands and read the account
stand commands --json
stand schema createStandin
stand sites list
stand standins list
stand knowledge list
stand org plan
stand org usageA generic API read
stand api GET /v1/knowledge-bases/KNOWLEDGE_BASE_ID/tasks \
--query-param view=inspection --query-param limit=20Explicit knowledge inspection returns bounded metadata pages. Follow nextCursor as after with the same filters when another page is available.
Website setup
Create, configure, then verify.
Start with the Site and Stand-in lists. If the website has no matching authorized Site, create one using its hostname, such as example.com, rather than a full URL. Read its returned snippet field for the installation code.
For a new Stand-in, save the example below as standin.json, replace SITE_ID, and write an approved briefing. Creation leaves the Stand-in disabled. Add and verify its knowledge before enabling it.
When updating an existing Stand-in, read it and inspect updateStandin first. The update body is a complete set of writable settings; omitted values can clear existing configuration. Keep the standinProfileId returned by the save, because it can change. Attachment writes likewise replace the full list.
Guided setup
Prefer to hand this workflow to your agent?
The short setup guide explains the project, browser handoff, and final visitor check.
Finish the installation
- Check that the Site is enabled as well as the individual Stand-in and account-wide Stand-in switch. Approve any change to existing availability first. Changing the master switch can activate other enabled Stand-ins, so approve that shared effect first.
- Install the exact returned snippet once, using your framework’s supported mechanism and preserving consent and Content Security Policy. Keep CLI credentials out of website code and source control.
- Publish through the website’s authorized workflow. On the configured hostname, open the widget as a visitor, send a real question, and verify an answer grounded in the approved content.
- Report any remaining deployment or browser test explicitly. A saved configuration, script load, or queued crawl alone is not a working chat.
Create a Site only when needed
stand sites create --domain example.com --name Example
stand sites get SITE_ID
stand schema createStandinInteractive mutation commands ask for confirmation. These commands create real account resources after approval.
standin.json — a new, Site-specific Stand-in
{
"name": "Website help",
"displayName": "Alex",
"prompt": "Answer using our approved support material. Say when the answer is unknown.",
"siteId": "SITE_ID"
}Create it, then inspect the result
stand standins create --body-file standin.json
stand standins get STANDIN_ID
stand standins statusUse the ID returned by creation. Enable the intended Stand-in with stand standins set-enabled STANDIN_ID --enabled true only after reviewing its configuration and knowledge.
Keep answers current
Add approved sources and check the result.
Read knowledge list for effective capabilities, ingestion availability, remaining capacity, and graceReadOnly before a change. Check each base’s ownedByCurrentRep value: uploads, replacements, recrawls, cancellations, and deletions require that base’s owner, even if you own the organization. The Base plan can use approved instructions and supported public website crawling. Uploads require documentUploadAllowed, normally on Pro or Business; sitemap creation needs sitemapAllowed, and nightly refresh needs automaticRefreshAllowed.
Use a public crawl for approved website content. For local documents, upload the file directly when permitted. Approve sharing private content with Stand and using its facts in visitor answers; do not publish a private document just to make it crawlable.
Uploads accept nonempty PDF, DOCX, Markdown (.md or .markdown), and TXT files up to 10 MiB each. The separate 11 MiB CLI content budget and 12 MiB encoded API request limit do not increase that document limit.
knowledge.json — create a base if one is needed
{
"name": "Support material",
"description": "Approved visitor-facing facts"
}crawl.json — one approved public page
{
"domain": "example.com",
"urlPrefix": "https://example.com/docs/",
"maxDepth": 0
}Replace the example with the approved host and starting page. Depth zero fetches only that page; a deeper crawl stays in its host and path subtree and is subject to the returned page allowance.
Create a base, queue the crawl, and inspect ingestion
stand knowledge create --body-file knowledge.json
stand knowledge crawl KNOWLEDGE_BASE_ID --body-file crawl.json
stand knowledge tasks KNOWLEDGE_BASE_ID
stand knowledge documents KNOWLEDGE_BASE_IDUse the returned base ID. Skip creation when reusing an intended existing base. Queue acceptance is not completed ingestion; wait for the task and inspect its indexed documents.
Optional document upload, when permitted
stand knowledge upload KNOWLEDGE_BASE_ID \
--file /absolute/path/approved-document.md
stand knowledge tasks KNOWLEDGE_BASE_ID
stand knowledge documents KNOWLEDGE_BASE_IDUse this instead of a public crawl for an approved local document when documentUploadAllowed and ingestionAllowed permit it. Base-plan installation does not require an upload.
Inspect the content and test retrieval
stand knowledge documents get DOCUMENT_ID
stand knowledge documents chunks DOCUMENT_ID
stand knowledge search KNOWLEDGE_BASE_ID \
--query "What is our support policy?" --top-k 5Search scores are relevance scores, not confidence percentages; they can exceed 1. Preserve the returned order and do not compare scores across different queries or scopes.
attachments.json — the complete intended attachment list
{ "knowledgeBaseIds": ["KNOWLEDGE_BASE_ID"] }Read the existing attachments first and include any other bases that should remain connected.
Read, review, then attach
stand standins knowledge get STANDIN_ID
stand standins knowledge set STANDIN_ID --body-file attachments.jsonMaintain an existing website
Change one setting, preserve the rest.
A Site rename can use the name flag alone. Site instructions are a separate complete replacement: read the existing text, prepare all the intended content in a file, and review it before saving. Both changes require sites:write and the organization owner; reads also need sites:read.
Personal chat coverage is different from the Site’s enabled state. Use sites preferences get to inspect your selection and sites preferences update SITE_ID --enabled true to change just that Site while preserving the other selections. This does not make you available for incoming chats.
Inspect and rename an existing Site
stand sites get SITE_ID
stand sites update SITE_ID --name "Support website"
stand sites get SITE_IDThe setup permission preset already includes these scopes. Changing enabled state, deleting the Site, or replacing its behavior needs its own decision.
site-instructions.json — the complete intended instruction
{
"content": "Answer questions about our support service using the approved sources. Say when a fact is unknown."
}Read, review the file, then replace the instruction
stand sites prompt get SITE_ID
stand schema updateSitePrompt
stand sites prompt set SITE_ID --body-file site-instructions.json
stand sites prompt get SITE_IDVisual identity
Upload to the intended image target.
Image uploads use stand api with a local file. Read the target first and inspect the upload schema. The example changes an existing Stand-in avatar immediately; it does not need a later Stand-in settings save and keeps the same ID.
Avatars accept PNG, JPEG, GIF and WebP up to 5 MiB. Animated avatars have tighter dimensions, frame and size limits in the operation schema. Do not confuse these image limits with the 10 MiB knowledge-document limit.
Public API guide
Check the image route and replacement rules.
Use the target’s schema and read scopes; preserve profile and pin settings when applying a staged image.
Replace an existing Stand-in avatar
stand auth login --scopes "profile:read standins:read standins:write"
stand standins get STANDIN_ID
stand schema uploadStandinAvatar
stand api POST /v1/reps/me/standins/STANDIN_ID/avatar \
--form-file file=/absolute/path/approved-avatar.png
stand standins get STANDIN_IDAn explicit scope list replaces the previous selection: retain other permissions your task still needs. Review the image and target before confirming the upload.
Delegate a focused task
Give your coding agent a goal and boundaries.
Use an agent that can run terminal commands and edit the intended website project. For installation, it also needs a way to inspect the real website in a browser. A chat window without those tools can explain the steps but cannot complete the installation for you.
For first setup, ask “Add stand.chat”. The agent can discover the official instructions, install the CLI, inspect your project, and propose the configuration. You still complete browser signup and consent, approve the content and changes, and authorize publishing.
For ongoing work, name the account profile, target resources, approved sources, and intended outcome. Ask the agent to inspect first and show its proposed changes. CLI permissions and --yes do not expand the work you authorized.
Ask for a useful handoff
- Installed CLI version, selected profile, and the Site and Stand-in IDs used.
- What changed, which existing resources were reused, and what remains unfinished.
- Ingestion results and retrieval checks for knowledge changes.
- For installation, the deployed page and real visitor-answer result—or the precise step that still needs access.
Audit without changing settings
Using the staging profile, inspect the Site for example.com,
its Stand-ins, and their attached knowledge. Report missing setup
or stale sources. Do not change any settings.Refresh an approved knowledge source
Use the staging profile. I approve sharing support-policy.md
with Stand and using its facts in visitor answers. Find the existing
uploaded source for this document and propose its replacement.
Preserve all other sources and attachments. After approval, check
ingestion and test retrieval with three relevant questions.Learn from conversations
Using my authorized conversation access, summarize recurring
questions from last week. Keep transcripts out of the repository.
Propose changes to our approved knowledge; do not apply them yet.Review conversations
Search history or make a private export.
Conversation reads need sessions:read, which is not included in the setup preset. Request it explicitly for the approved task; add other scopes only if that task needs them. Organization-wide history remains subject to account roles.
Use a bounded search to inspect results before exporting. The --site filter matches text anywhere in the stored page URL, not an exact hostname; check returned URLs when you need an exact-site sample. Date filters use timestamps with a timezone; closed-to is an exclusive upper bound. If you request all search pages, inspect complete and nextPage rather than assuming every matching conversation was returned.
Read a selected conversation with sessions get SESSION_ID; it returns at most 500 messages. Use an export for complete retained transcripts. Export writes validated JSON to a new private file and refuses to overwrite an existing destination. Keep it outside the website repository and share it only with approved people or tools.
Search, then export your own history
stand auth login --scopes "profile:read sessions:read"
stand history search --scope myself --query pricing \
--page 0 --size 20
stand history export --scope myself \
--closed-from 2026-10-01T00:00:00Z \
--closed-to 2026-11-01T00:00:00Z \
--output /absolute/path/new-history.jsonReplace the example dates and destination. Export defaults to a 600-second timeout and 100 MiB limit; documented options can raise these to at most 3,600 seconds and 1 GiB.
An active conversation
Send an approved reply with a saved message ID.
Use sessions list and sessions get to inspect an active conversation you are allowed to handle. Polling with sessions get --watch does not make you available or subscribe you to background notifications. Organization-wide archived reads do not grant access to another rep’s live conversation.
Agree the exact reply before sending. A message to a Stand-in conversation can take over that conversation as you, so approve the handoff as well as the text. The named send command verifies your identity before writing and checks the returned message against that identity and the approved body.
Generate a UUID and save it as clientMessageId alongside body in message.json before sending. Keep that file for this one logical message. If the field is absent, the CLI generates an ID but does not write it back to your file, so a forced process exit could leave you without the key needed to reconcile the result.
Inspect the conversation and generate a message ID
stand auth login --scopes "profile:read sessions:read sessions:write"
stand whoami
stand sessions get SESSION_ID
node -p "crypto.randomUUID()"Copy the generated UUID into the file below. Use a new UUID for each new intended message.
message.json — replace both illustrative values
{
"body": "Your reviewed reply to this visitor",
"clientMessageId": "UUID_FROM_THE_PREVIOUS_COMMAND"
}Confirm the reply, then inspect the conversation
stand sessions send SESSION_ID --body-file message.json
stand sessions get SESSION_IDRepeatable work
Use structured output and explicit approval.
JSON is automatic when stdout is not a terminal; --json makes the choice explicit. Read results from stdout and diagnostics or login progress from stderr. Use commands --json for machine discovery, not --help --json, which remains readable help text.
Pass JSON requests with --body-file FILE, or --body-file - for standard input. Without an interactive terminal, mutations need --yes. Add it only after the specific changes have been authorized; keep read-only discovery separate from writes.
For unattended work, use an authorized credential in private user storage or inject STAND_ACCESS_TOKEN through your secret manager together with the matching STAND_TOKEN_API_URL. Do not put tokens in command arguments, URLs, source files, logs, or agent prompts. STAND_CONFIG_HOME can select an absolute private configuration directory.
GET requests retry a bounded number of transient failures. Writes do not automatically retry. After a timeout, lost response, cancellation after dispatch, or server error, read the affected resource and reconcile its ID and content before deciding what to do next. The original change may already have succeeded.
An explicitly approved, noninteractive rename
stand sites get SITE_ID --profile staging --json
stand sites update SITE_ID --profile staging \
--name "Approved site name" --yes --json
stand sites get SITE_ID --profile staging --jsonInspect before and after. There is no general multi-resource transaction or conditional revision guard, so coordinate concurrent changes and stop when the outcome is uncertain.
Get unstuck
Check the target, permission, and result.
Include the CLI version, command, selected profile, and sanitized error when asking for help. Check the installed command schema before trying a flag from a newer release. Keep credentials and private conversation content out of reports.
Permissions
Understand delegated access.
See what the agent can request and what remains under your control.
Reference
Look up an exact operation.
Use the API and CLI reference alongside the schema from your installed version.
Questions
Common reader notes
Do I need an AI agent to use the CLI?
No. You can run the same commands yourself or use them in scripts. An agent is useful when the task spans project files, account configuration, and browser verification.
Can an AI agent create my account and accept terms for me?
No. You complete signup, terms, consent, and any required profile or organization onboarding in your browser. The agent can continue with the work you authorize afterward.
Does installing a different npm tag switch environments?
No. npm tags select a package version. The saved CLI profile and its API and issuer endpoints select the environment.
Can I set up Stand on the free Base plan?
Yes. Use the plan’s supported public crawling and approved instructions. Document uploads, sitemaps, and scheduled refresh depend on effective account capabilities; they are not prerequisites for a Base-plan installation.