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.

UI vs. CLI: Choose Your Workflow

The Web UI is great for visual learners and teams who want to point-and-click to configure embedding models, visually track ETL scraping jobs, and manually test queries before deploying.
The CLI shines for developers who want to script their ingestion, quickly index local directories of markdown files, and spin up RAG servers in headless environments without ever opening a browser.

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"

# 3. 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"

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

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

# 6. 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).