CLI for interacting with the Plain API.
Specifically for indexing content as Knowledge Sources in your Plain workspaces, to be used by Plain Agents.
Requires Node.js 22.12 or later.
npm install -g @team-plain/cli
plain --helpTo authenticate with your Plain workspace, the CLI uses a
Plain API Key, read from the
PLAIN_API_KEY environment variable.
export PLAIN_API_KEY=plainApiKey_xxxCommands for indexing content as Knowledge Sources in your Plain workspace, so that Plain Agents, such as Ari, can use it to answer customer questions and as context.
Each command fetches and indexes the content of the provided URL or sitemap. Running a command again for a URL or sitemap that's already a knowledge source reindexes it.
Index a single page by URL.
Required permissions: knowledgeSource:create
PLAIN_API_KEY=plainApiKey_xxx plain index-url <url>Options:
-l, --labelTypeIds <labelTypeIds...>: Array of label type IDs to associate with the indexed url
Index all the urls in a given sitemap you provide.
Required permissions: knowledgeSource:create
PLAIN_API_KEY=plainApiKey_xxx plain index-sitemap <sitemap url>Options:
-l, --labelTypeIds <labelTypeIds...>: Array of label type IDs to associate with the indexed urls from the sitemap
Use the CLI in your CI pipeline to index your content as Knowledge Sources, for example when you publish new documentation to a Mintlify site.
- uses: actions/setup-node@v7
with:
node-version: 24
- name: Index docs
run: npx --yes @team-plain/cli@1 index-sitemap https://docs.example.com/sitemap.xml
env:
PLAIN_API_KEY: ${{ secrets.PLAIN_API_KEY }}