> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rogeriq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# kb

Knowledge base — articles, search, ingest, crawl.

# `rogeriq kb`

**list / get**

```bash
    rogeriq kb list [--limit 50] [--cursor <cursor>]
    rogeriq kb get kba_xxx
    ```

  **create**

```bash
    rogeriq kb create --title "How to refund" \
      --content "Customers can request..."   # inline
    rogeriq kb create --title "Onboarding" --content-file ./onboarding.md
    ```

    Requires `write` (or `kb:write`) scope. Pass `--status published` to
    publish immediately and index for AI agent retrieval.

  **update**

```bash
    rogeriq kb update kba_xxx --title "New title"
    rogeriq kb update kba_xxx --content-file ./updated.md
    rogeriq kb update kba_xxx --status archived
    ```

  **publish**

```bash
    rogeriq kb publish kba_xxx
    ```

    Sets status to `published`, sets `published_at`, and re-vectorizes the
    article for the agent's retrieval system.

  **search**

```bash
    rogeriq kb search "refund policy"
    ```

    Hybrid semantic + keyword search. Top 10 most relevant articles.

  **ingest**

```bash
    rogeriq kb ingest https://example.com/help/refunds
    rogeriq kb ingest ./local-article.md
    ```

    URL → fetches the page and creates an article from the cleaned content.
    File path → creates an article with the file as the body.

  **crawl**

```bash
    rogeriq kb crawl https://docs.example.com
    rogeriq kb crawl list                 # all jobs
    rogeriq kb crawl status crawl_xxx     # one job
    ```

    Starts an async crawl job that ingests every reachable page on the
    same hostname. Monitor via `crawl status`. Cancel via the dashboard.

  **categories**

```bash
    rogeriq kb categories
    ```

  **delete**

```bash
    rogeriq kb delete kba_xxx
    ```

    Destructive. Removes the article and its vector entries.

## Common workflows

### Migrate docs from a static site

```bash
rogeriq kb crawl https://help.acme.com
# Wait for completion
while [ "$(rogeriq kb crawl status crawl_xxx --json | jq -r '.status')" = "running" ]; do
  sleep 10
done
```

### Bulk-import markdown files

```bash
for f in ./docs/*.md; do
  rogeriq kb ingest "$f"
done
```