@monoedge/jdu-cli 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +9 -5
  2. package/dist/cli.js +1576 -82
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,24 +6,28 @@
6
6
 
7
7
  ```bash
8
8
  npm i -g @monoedge/jdu-cli
9
- jdu login --server https://docs.example.com
9
+ jdu init # 默认官方 https://docs.mszhou.com,浏览器里 passkey 点一次授权;自部署加 --server <url>
10
10
  jdu push notes/hello.md --visibility public
11
11
  jdu official add <docId> # 管理员:上架到官方知识库
12
12
  ```
13
13
 
14
14
  成功时 stdout 只有文档 URL。需要 Node.js ≥ 22。
15
15
 
16
- token 鉴权的站点要带 `--token`:
16
+ 登录方式听 server 的 `/healthz`:password 站点注册过 passkey 就打开浏览器授权签 token;没有浏览器的机器(CI、SSH 远端)带 `--token`:
17
17
 
18
18
  ```bash
19
- jdu login --server https://docs.example.com --token <token>
19
+ jdu init --server https://docs.example.com --token <token>
20
20
  ```
21
21
 
22
+ 签出去的 token 用 `jdu token list` / `jdu token rm <id>` 管理。
23
+
22
24
  forward-auth 的站点打开浏览器走 OIDC;issuer / client id 来自 `--issuer` / `--client-id`、server `/healthz` 的 `oidc` 字段,或环境变量 `JIANDU_OIDC_ISSUER` / `JIANDU_OIDC_CLIENT_ID`。
23
25
 
24
26
  ## 适用范围
25
27
 
26
- - 支持:把文档和 widget 推到已部署的简牍 server(anonymous / token / forward-auth)
27
- - 不支持:本包不含 server;不内置任何 IdP
28
+ - 支持:把文档和 widget 推到已部署的简牍 server(anonymous / token / password / forward-auth)
29
+ - 不支持:本包不含 server;不内置任何 IdP;password 模式不能省略 `--token`
30
+
31
+ 自建实例的事实在仓库根 [README.md](../README.md)「自建实例」;把 CLI 接到实例的步骤:[docs/agent/connect.md](../docs/agent/connect.md)。
28
32
 
29
33
  配置在 `~/.config/jiandu/`,可被 `JIANDU_SERVER` / `JIANDU_TOKEN` 覆盖。