Aller au contenu
Skillpedia
Recherche36k · #7586

weknora-shared

Ce qu’il fait

Cette compétence configure l'accès à un serveur de base de connaissances WeKnora via son outil en ligne de commande. Elle s'adresse aux personnes qui doivent se connecter à WeKnora avant de gérer ou de rechercher son contenu.

Quand l’utiliser

  • ✓Quand vous devez connecter l'outil en ligne de commande WeKnora à un serveur pour la première fois.
  • ✓Quand vous voulez gérer des bases de connaissances, des documents, des sessions ou des agents dans WeKnora.
  • ✓Quand vous devez comprendre la sortie JSON de l'outil ou ses codes de sortie.

Lien du skill

https://github.com/Tencent/WeKnora/blob/main/cli/skills/weknora-shared/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/Tencent/WeKnora/blob/main/cli/skills/weknora-shared/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Aide-moi à me connecter à notre serveur WeKnora depuis la ligne de commande et à vérifier que cela fonctionne.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Elle explique comment définir l'adresse du serveur et une clé d'API, ou enregistrer un profil nommé, puis vérifier qui est connecté. Elle décrit aussi comment lire la sortie structurée de l'outil et ses codes d'erreur.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

WeKnora CLI — shared base

weknora is the agent-first CLI for a WeKnora RAG server. Every command prints a JSON envelope and uses a typed exit code, so you branch on machine-readable output, not prose. Read this skill before any task-specific weknora-* skill.

1. Authenticate (do this first — order matters)

Agents usually skip profiles entirely: set WEKNORA_API_KEY (or WEKNORA_TOKEN) + WEKNORA_HOST and every command authenticates statelessly and zero-disk — no profile add / auth login needed. auth token echoes that env credential; auth status / doctor confirm it. The steps below set up a persistent named profile instead (interactive / multi-environment use).

Authentication is a two-step sequence. weknora auth login operates on the active profile, so the profile must exist first:

# 1. register a connection target and make it active
weknora profile add prod --host https://kb.example.com --use
# 2a. API key (agent default — pipe the key on stdin, non-interactive):
echo "$WEKNORA_API_KEY" | weknora auth login --with-token
# 2b. OR email+password (interactive prompt only — no flags; not for agents)
weknora auth login

weknora auth status          # verify: who am I, which tenant
  • Target a non-active profile for one command with the global --profile NAME (e.g. weknora --profile staging auth refresh). There is no per-command --name/--host on auth commands.
  • Get the raw token for scripting with WEKNORA_TOKEN=$(weknora auth token) (raw token by default; works with an env credential too; --format json gives the {token, mode, profile} envelope).
  • weknora auth logout clears a profile's stored credentials but keeps the profile registered (re-auth later with auth login); use profile remove to delete the profile entirely.
  • weknora doctor runs 4 health checks (reachability, credential, version, storage).

2. Selecting a knowledge base (--kb)

--kb accepts a name or a UUID (resolved server-side). Resolution order: --kb flag → WEKNORA_KB_ID env → directory link (weknora link --kb X binds the cwd) → error. Read/create commands that operate "inside a project" inherit the link; search * and destructive --all operations always require an explicit --kb (so an agent never silently hits the wrong corpus).

A KB must have an embedding model bound to be searchable. A freshly created KB is retrieval_ready:false — uploaded docs stay unindexed and search/chat return nothing until you bind models. Create it ready in one step (kb create --embedding-model <m> --chat-model <m>, discover ids with weknora model list) or bind after the fact (kb config set <kb> --embedding-model <m> --chat-model <m>). kb status / kb check report retrieval_ready, and kb create hints the fix when it is false — so an unconfigured KB is never silently "healthy".

3. Output contract — every command

Default output is --format json: a single envelope.

Field Meaning
ok true/false — branch on this first (see batch/wait caveat below)
data success payload (object or array; absent on mutation-only success)
meta count / has_more / dry_run / plan …
error on failure: {type, message, hint?, retry_argv?, retryable?, risk?}
profile active profile name
  • error.type is a stable typed code (e.g. local.kb_not_found, input.invalid_argument, input.confirmation_required, server.error). Branch on it; error.hint usually tells you the next action.
  • --format text = a live human-readable projection. chat and session ask buffer a bounded answer-event projection into one JSON envelope by default; pass --reference for indexed citations, --verbose for execution detail, or --format ndjson for raw event lines. session resume remains an NDJSON streaming command.
  • --jq '<expr>' filters the envelope (e.g. weknora kb list --jq '.data[].id').
  • Exception: weknora auth token emits the raw token by default (it's a scripting helper); pass --format json for the {token, mode, profile} envelope.
  • Batch / wait caveat: multi-item commands come in two shapes, but for both you branch on the exit code, not ok:
    • doc/chunk/session delete with several ids → a batch envelope: status is success/partial/error, ok is true only when every item succeeded (ok:false on any failure), data is a per-
Questions fréquentes

Faut-il un profil pour commencer ?

Non. Définir la clé d'API et l'hôte dans des variables d'environnement fonctionne sans créer de profil.

Pourquoi l'ordre des étapes compte-t-il ?

La commande de connexion agit sur le profil actif, donc ce profil doit exister d'abord.

Quel format la sortie utilise-t-elle ?

Chaque commande affiche un résultat JSON, que l'agent lit directement.

Détails

Description originale de l’auteur

Use when driving a WeKnora RAG server through the `weknora` CLI as an agent — authenticating, managing knowledge bases / documents / sessions / agents, running search or chat, or interpreting the CLI's JSON envelopes and exit codes. Read this before any other weknora-* skill.

repo: Tencent/WeKnora

Popularité

Étoiles GitHub
36k
Position au classement
#7586
Licence
—
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires