English | 中文
CLI for KWeaver platform administrators: authentication, org/departments, users, roles, models, audit, arbitrary HTTP (call), and local config. See ARCHITECTURE.md for the command tree and docs/SECURITY.md for tokens.
- Node.js 18+
Install the published package so the kweaver-admin command is on your PATH:
npm install -g @kweaver-ai/kweaver-adminVerify:
kweaver-admin --version
kweaver-admin --helpNote: The package ships the compiled dist/ entry from npm; you do not need to clone the repo for normal use.
pnpm add -g @kweaver-ai/kweaver-admin
# or
yarn global add @kweaver-ai/kweaver-adminTo install this repository's kweaver-admin skill into your local skills
runtime:
npx skills add https://github.com/kweaver-ai/kweaver-admin --skill kweaver-adminAfter installation, use the skill from your agent workflow where skill loading is supported.
git clone https://github.com/kweaver-ai/kweaver-admin.git
cd kweaver-admin
npm install
npm run build
node dist/index.js --help
# optional: npm link → kweaver-admin on PATHWindows note: Windows does not honor the Node shebang, so running
.\dist\index.jsdirectly will not work. Usenode .\dist\index.js ..., or install/link the package (npm install -g .ornpm link) and callkweaver-admin— npm generates the proper.cmd/.ps1shims for you.
-
Interactive (recommended): point at your platform base URL and sign in (browser or paste-code flow):
kweaver-admin auth login https://your-platform.example/
-
Headless / CI: set environment variables (names align with common KWeaver tooling):
KWEAVER_BASE_URL— platform API base URLKWEAVER_TOKENorKWEAVER_ADMIN_TOKEN— bearer access token
-
Persisted config:
kweaver-admin config set baseUrl <url>stores defaults under~/.kweaver-admin/. Tokens fromauth loginare stored per platform there as well.
Check session:
kweaver-admin auth status
kweaver-admin auth whoamiauth whoami precedence:
- explicit
auth whoami <url> - env pair
KWEAVER_BASE_URL+KWEAVER_TOKEN/KWEAVER_ADMIN_TOKEN - saved local
currentPlatform
These apply before the subcommand (and work with call / curl where documented):
| Option | Purpose |
|---|---|
--json |
Machine-readable JSON output for supported commands |
--base-url <url> |
Override API base URL for this run |
-k, --insecure |
Skip TLS verification (dev only; unsafe) |
Examples:
kweaver-admin --json org list
kweaver-admin --base-url https://other.example/ user listRun kweaver-admin <group> --help for full flags and examples.
auth login [url]— Log in to platform (browser OAuth2 by default;--tokenand headless/password flows are available).auth logout— Remove stored token for the current platform.auth status— Show base URL, token source, TLS mode, and session status.auth whoami [url]— Decode current identity from savedid_token.auth list(aliasauth ls) — List every platform with a saved session under~/.kweaver-admin/platforms, marking the active one with*and showing token status (valid / expired / refreshable / no-expiry).auth change-password [url]— Change password through EACP endpoint. With an active session,-u/--accountdefaults to the logged-in admin (self-change); old/new passwords are prompted on TTY if omitted. The forgot-password / vcode flow is intentionally not supported — use the web console for password recovery.auth token— Print current token to stdout (sensitive output).
org list— List departments in pages (--name,--offset,--limit).org tree— Print department hierarchy as a text tree.org get <id>— Show full JSON for one department.org create— Create a department via ISFWebUsrm_AddDepartmentthrift path.org update <id>— Update a department via ISFWebUsrm_EditDepartmentthrift path.org delete <id>— Remove a department via management API.org members <id>— List members under a department (--fields=users/departments/users,departments).
org commands usually require --role (for example super_admin, org_manager, normal_user) matching your real account permissions.
user list— Search/list users (--org,--keyword,--offset,--limit).user get <id>— Get user detail by id.user create— Create user via ISFWebUsrm_AddUserthrift path.user update <id>— Update mutable user fields (REST patch when available; fallback to ISFWeb edit thrift).user delete <id>— Delete user.user roles <id>— List roles assigned to user.user assign-role <userId> <roleId>— Assign existing role to user.user reset-password— Admin reset password (supports prompt/default/confirmation options).user revoke-role <userId> <roleId>— Revoke role from user.
role list— List roles (filter by source/keyword/pagination).role get <id>— Show role details (resource scopes and operations).role members <roleId>— List members of role.role add-member <roleId>— Add one or more members to role.role remove-member <roleId>— Remove one or more members from role.
llm list— List LLM model configs.llm get <modelId>— Get one LLM model config.llm add— Add LLM model config.llm edit <modelId>— Edit LLM model config.llm delete <modelId...>— Delete one or multiple LLM models.llm test <modelId>— Test LLM model connectivity.
small-model list— List small model configs.small-model get <modelId>— Get one small model config.small-model add— Add small model config.small-model edit <modelId>— Edit small model config.small-model delete <modelId...>— Delete one or multiple small models.small-model test <modelId>— Test small model connectivity.
audit list— List login audit events (--user,--start,--end, pagination).
config show— Show current~/.kweaver-admin/config.json.config set <key> <value>— Set config value (currently supportsbaseUrl).
call <url> ...flags— Send authenticated raw HTTP request with curl-style flags (-X,-H,-d,-F,-v,-bd,--pretty).curl <url> ...flags— Alias ofcall.- Also supports global-style form:
kweaver-admin --json call ....
- ARCHITECTURE.md — modules and command tree
- AGENTS.md — contributor / agent workflow
- docs/ — product specs and security
Apache-2.0 — see LICENSE.