Skip to main content
Everything you can do in the Web UI, you can do directly from your terminal. Whether you prefer clicking through a visual interface or automating workflows with bash scripts, LarkupRAG has you covered.
Prefer a visual interface? Most users should start with the Web UI Quickstart instead.

Installation

Install the CLI globally using your preferred package manager:
npm install -g @larkup-rag/cli
Alternatively, you can use it without installation via npx:
npx @larkup-rag/cli <command>

Running a Full RAG Server from Local Files

If you have a local directory of markdown files or PDFs, you can ingest them, index them, and run a complete standalone RAG server using only the CLI. Here is the complete end-to-end workflow:
# 1. Initialize a new workspace
larkup-rag init "my-local-knowledgebase"

# 2. Ingest local files (repeat as needed, or script a loop)
larkup-rag add-doc --file ./docs/manual.md --title "User Manual"
larkup-rag add-doc --file ./docs/api.md --title "API Reference"

# 3. Execute the chunking and embedding pipeline (streams progress)
larkup-rag index

# 4. Generate the deployable RAG server to disk
larkup-rag generate --out ./my-rag-server

# 5. Serve the generated backend in the foreground
larkup-rag serve
In another terminal window, you can instantly test queries against your new server:
larkup-rag query "How do I authenticate with the API?" --topK 3

Core Commands Reference

Once installed, you can use the larkup-rag (or rag) command.
CommandDescription
larkup-rag init [name]Create a new RAG server workspace and make it active.
larkup-rag serversList all servers ( marks the active one).
larkup-rag use <id|name>Switch the active server workspace.
larkup-rag configShow the active server’s configuration and status.
larkup-rag add-doc --file <path>Add a document from a local file.
larkup-rag add-doc --text "<text>"Add a document from inline text (optional --title, --url).
larkup-rag indexExecute the chunking and embedding pipeline.
larkup-rag generate [--out <dir>]Emit the deployable RAG server to disk.
larkup-rag serveRun the generated server locally in the foreground.
larkup-rag query "<question>"Retrieve the top-k chunks (--topK <n> optional).
larkup-rag chatChat with your knowledge base in the terminal (--model <id> optional).
larkup-rag settingsConfigure CLI settings (e.g., chat models).