@usedocent/cli
v0.2.1
Published
Upload your app's routes and Markdown knowledge to Docent, or crawl a docs site into it.
Readme
@usedocent/cli
Uploads your app's routes and your Markdown documentation to Docent, so the guide can navigate your app and answer from your own docs.
npx @usedocent/cli sync ./src/app --docs ./docs --key dk_sec_..../src/appis your Next.js App Router directory. A project root works too; the tool looks inappandsrc/app. Other routers are not read yet.--docsis a directory of Markdown files (.md,.mdx,.markdown). Markdown only: pages written as React components are not read; export them to Markdown first. Without--docsonly routes are uploaded.--keyis the secret key of one environment, from Settings, Environments in the Console. It can also come fromDOCENT_SECRET_KEY. It is never read from a file.
The tool prints every route before it sends anything; --dry-run stops there. After an upload,
indexing starts on its own and the Console's Knowledge page shows progress as the retrievable
count catches up with the chunk count. The project map at https://app.usedocent.com/map draws
the routes.
crawl
For a docs site with no Markdown export, crawl asks Docent's own servers to read it into
knowledge.
npx @usedocent/cli crawl https://docs.example.com --key dk_sec_...The crawl runs on Docent's servers, not on your machine: same origin as the URL you pass, over
https, honouring robots.txt, up to --max-pages pages (default 200, max 200). Pages that need
JavaScript to render are not read; the job reports that rather than uploading nothing silently.
--max-pages <n>caps how many pages the job reads, 1 to 200.--dry-runreadsrobots.txtandsitemap.xmlitself and prints the pages it would send and the pagesrobots.txtblocks, then stops. Nothing is crawled.--keyand--endpointwork the same as forsync.
Without --dry-run, the command prints the crawl id and a link to the Console's Knowledge page,
where pages and retrievable chunks appear as the job runs.
