@team-plain/cli
v1.0.2
Published
CLI for interacting with the Plain API
Maintainers
Keywords
Readme
@team-plain/cli
CLI for interacting with the Plain API.
Specifically for indexing content as Knowledge Sources in your Plain workspaces, to be used by Plain Agents.
Installation
Requires Node.js 22.12 or later.
npm install -g @team-plain/cli
plain --helpAuthentication
To 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
Knowledge Sources
Commands 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-url
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-sitemap
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
Running in CI
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 }}