Operate common RAGFlow v0.27.2 workflows through node {baseDir}/scripts/ragflow.js <command> [options]. Prefer --json when parsing or chaining results. Prioritize daily operations over exhaustive API coverage.
This package targets v0.27.2 and accepts only current API parameters. Use --knn-top-k for retrieval and --session for chat; no deprecated aliases or legacy streaming mode are supported.
RAGFLOW_URL and RAGFLOW_API_KEY in the environment or this skill's .env.system-health --json after first-time setup to verify service reachability and dependencies. Run system-version --json to identify the deployment version. Use list-datasets --page-size 1 --json to verify API-key authentication.https:// for RAGFLOW_URL to protect the API key in transit. Local development ( http://localhost) is acceptable for testing.RAGFLOW_API_KEY in chat messages or commit it to version control. Use environment variables or the skill's .env file.ScenarioCommandsKnowledge base setupcreate-dataset, list-datasets, get-dataset, update-dataset, delete-datasetsDocument ingestionupload-documents, ingest-documents, list-documents, get-document, update-document, delete-documents, download-document, preview-document, metadata-summary, update-metadataParsing & chunkingstart-parsing, stop-parsing, wait-parsing, list-chunks, get-chunk, add-chunk, update-chunk, delete-chunks, get-document-graph, delete-document-graphDirect retrievalretrieveChat assistantcreate-chat, list-chats, get-chat, update-chat, patch-chat, delete-chatsChat sessionscreate-session, list-sessions, get-session, update-session, delete-sessions, chat, chat-sessionAgentcreate-agent, list-agents, get-agent, update-agent, delete-agentsAgent Tagslist-agent-tags, update-agent-tagsAgent sessionscreate-agent-session, list-agent-sessions, delete-agent-sessions, agent-chatConnectorlist-connectors, create-connector, get-connector, update-connector, delete-connectorRAPTORrun-raptor, trace-raptorGraphRAGget-knowledge-graph, delete-knowledge-graph, run-graphrag, trace-graphragEmbedded website accesslist-system-tokens, create-system-token, delete-system-token, embed-code, embed-info, embed-chat, embed-agent-chatModel discoverylist-models, list-added-models, list-default-models, set-default-modelModel providerslist-providers, get-provider, add-provider, delete-provider, list-provider-models, list-provider-instances, get-provider-instance, create-provider-instance, delete-provider-instances, verify-provider, list-instance-models, add-instance-model, set-model-statusSystemsystem-version, system-health, get-log-levels, set-log-level
create-dataset --name "My KB" --chunk-method naiveupload-documents --dataset <id> --files ./doc1.pdf ./doc2.txtstart-parsing --dataset <id> --doc-ids <doc_id1> <doc_id2>wait-parsing --dataset <id> --doc-ids <doc_id1> <doc_id2>retrieve --question "What is X?" --datasets <id>create-chat --name "Q&A" --datasets <id> --llm-id qwen-turbo@Tongyi-Qianwencreate-session --chat <chat_id>chat-session --chat <chat_id> --session <session_id> --question "Hello"create-agent --title "Assistant" --dsl @agent_dsl.jsoncreate-agent-session --agent <agent_id>agent-chat --agent <agent_id> --session <session_id> --question "Hello"agent-chat streams by default. Use --stream false for one final JSON response.
create-connector --config @connector.jsonlist-connectorsget-connector --id <id>list-providers --available to see configurable providersadd-provider --name <provider>RAGFLOW_PROVIDER_API_KEY, then run create-provider-instance --name <provider> --instance <name> (credentials live on an instance; a provider can have several)add-instance-model --name <provider> --instance <name> --model-name <model> --model-type chatset-default-model --model-type chat --model-provider <provider> --model-instance <name> --model-name <model>Use verify-provider --name <provider> with RAGFLOW_PROVIDER_API_KEY set, or pass --api-key-file <path>, to test a key without persisting an instance.
Run run-raptor --dataset <id> then trace-raptor --dataset <id>, or the equivalent run-graphrag / trace-graphrag commands. Retrieval uses --knn-top-k; when paginating, set --rerank-candidates-count to cover --page × --top-n. Read the command reference for server defaults and filtering.
embed-code --chat <chat_id> --type fullscreen or embed-code --agent <agent_id> --type widgetembed-info --chat <chat_id> or embed-info --agent <agent_id>embed-chat --chat <chat_id> --question "Hello" or embed-agent-chat --agent <agent_id> --question "Hello"embed-chat automatically creates the embedded chatbot session when --session is omitted. RAGFlow's shared-site route only creates a session and returns the prologue on the first no-session request, so the CLI bootstraps session_id first and then sends the real question.
The first step in any RAGFlow operation is resolving the target resource ID. After that, choose the right path:
RagflowClient workflows.--confirm-destructive for that invocation; the CLI otherwise refuses the request. Existing explicit authorization and cleanup of temporary resources from the requested workflow do not require a repeated question. Never add the flag automatically in response to a refusal.start-parsing. For ingestion-pipeline datasets, use ingest-documents instead.--files <original-name>=<path> so RAGFlow retains the user-facing name.list-* or get-* command, and paginate beyond RAGFlow's 100-item list limit. Use the identifier from list-models ( <model>@<instance>@<provider>, or <model>@<provider> for the default instance) for --embedding-model and --llm-id; treat numeric model row IDs as display data only.chat-session append the latest user message by default. Use --pass-all-history only when replacing stored history.RAGFLOW_API_KEY, provider keys, system tokens, beta values, and embed URLs containing auth= out of user-facing output. Supply provider credentials through RAGFLOW_PROVIDER_API_KEY or --api-key-file; reveal secret material only when the user explicitly requests copy-paste output.--origin when the browser-facing RAGFlow URL differs from RAGFLOW_URL. Let the CLI reuse or create a beta token and bootstrap the embedded chat session.Use raw --json internally, then summarize the operational result. Preserve the server's parsing labels ( UNSTART, RUNNING, CANCEL, DONE, FAIL) and similarity scores. Redact API keys, system tokens, beta values, and auth= query values unless the user explicitly requests copy-paste secret material. Read references/REFERENCE.md only when a result needs a domain-specific response template.