From 71f46f85a9ca6b019ae18ca569a88b544f543794 Mon Sep 17 00:00:00 2001 From: Cheney Date: Tue, 20 Oct 2026 15:51:51 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=87=AD=E8=AF=81=E5=A4=96=E7=BD=AE?= =?UTF-8?q?=E5=88=B0=20~/.docsys/config.json=EF=BC=8C=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E9=85=8D=E7=BD=AE=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docsys/README.md | 7 +++++++ docsys/SKILL.md | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docsys/README.md b/docsys/README.md index 809ca1b..7765c93 100644 --- a/docsys/README.md +++ b/docsys/README.md @@ -10,6 +10,13 @@ ## 通用约定 +- 凭证配置(`scripts/docsys.py` 读取顺序:命令行参数 > `~/.docsys/config.json` > 环境变量 > 内置默认地址): + ```json + // ~/.docsys/config.json + {"baseUrl": "http://172.1.4.31:8100/DocSystem", "user": "x@y.com", "password": "xxx"} + ``` + 环境变量:`DOCSYS_BASE_URL` / `DOCSYS_USER` / `DOCSYS_PASSWORD`。 + 仓库默认库可用 `DOCSYS_DEFAULT_REPO` 覆盖。**凭证不要提交进代码库。** - 全部接口为 `POST`,表单编码 `application/x-www-form-urlencoded; charset=UTF-8` (仅 `uploadDoc.do` 为 `multipart/form-data`)。 - 必须带请求头 `X-Requested-With: XMLHttpRequest`。 diff --git a/docsys/SKILL.md b/docsys/SKILL.md index c508518..8320fad 100644 --- a/docsys/SKILL.md +++ b/docsys/SKILL.md @@ -11,6 +11,21 @@ agent_created: true 底层是一个零依赖的 Python CLI:只用标准库,不需要 pip 安装任何东西。 +## 首次配置(凭证) + +凭证不写在代码里,从 `~/.docsys/config.json` 或环境变量读取。首次使用先建这个文件: + +```json +{ + "baseUrl": "http://172.1.4.31:8100/DocSystem", + "user": "your.name@company.com", + "password": "your-password" +} +``` + +也可用环境变量 `DOCSYS_BASE_URL` / `DOCSYS_USER` / `DOCSYS_PASSWORD`,或命令行 `--base-url` / `--user` / `--password` 临时覆盖。 +未配置时 CLI 会直接提示配置文件路径,不会用空账号去撞登录接口。 + ## 快速开始 ```bash