Loading...
Loading...
Compare original and translation side by side
feishu-cli auth status -o jsonlogged_in=falseaccess_token_valid=trueaccess_token_valid=falserefresh_token_valid=trueaccess_token_valid=falserefresh_token_valid=falsefeishu-cli auth status -o jsonlogged_in=falseaccess_token_valid=trueaccess_token_valid=falserefresh_token_valid=trueaccess_token_valid=falserefresh_token_valid=falseundefinedundefined
> **scope 命名说明**:飞书 OAuth scope 命名不完全统一,`search:docs:read` 带 `:read` 后缀,而 `search:message` 不带。这是飞书平台定义,非笔误。
将输出的 `auth_url` 展示给用户,请用户在浏览器中完成授权。授权后浏览器跳转到无法访问的页面,让用户复制地址栏完整 URL。
```bash
> **Scope Naming Note**: Feishu OAuth scope naming is not fully consistent. `search:docs:read` has the `:read` suffix, while `search:message` does not. This is defined by the Feishu platform and not a typo.
Show the output `auth_url` to the user and ask them to complete authorization in a browser. After authorization, the browser will redirect to an inaccessible page; ask the user to copy the full URL from the address bar.
```bashundefinedundefined~/.feishu-cli/token.json~/.feishu-cli/token.jsonsearch:docs:readfeishu-cli search docs "关键词" [选项]search:docs:readfeishu-cli search docs "keywords" [options]| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| string | 全部 | 文档类型过滤(逗号分隔,小写) |
| int | 20 | 返回数量(0-50) |
| int | 0 | 偏移量(offset + count < 200) |
| string | — | 文件所有者 Open ID(逗号分隔) |
| string | — | 文件所在群 ID(逗号分隔) |
| string | — | JSON 格式输出 |
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | All | Filter by document type (comma-separated, lowercase) |
| int | 20 | Number of results returned (0-50) |
| int | 0 | Offset (offset + count < 200) |
| string | — | Open ID of file owner (comma-separated) |
| string | — | Group ID where the file is located (comma-separated) |
| string | — | Output in JSON format |
| 类型 | 说明 | 类型 | 说明 |
|---|---|---|---|
| 旧版文档 | | 新版文档 |
| 电子表格 | | 幻灯片 |
| 多维表格 | | 思维笔记 |
| 文件 | | 知识库文档 |
| 快捷方式 |
| Type | Description | Type | Description |
|---|---|---|---|
| Legacy doc | | New version doc |
| Spreadsheet | | Slides |
| Base (multi-dimensional table) | | Mind note |
| File | | Wiki doc |
| Shortcut |
undefinedundefinedundefinedundefined{
"Total": 35367,
"HasMore": true,
"ResUnits": [
{
"DocsToken": "C29IdflghosjksxWKvNutR3UsXe",
"DocsType": "docx",
"Title": "产品需求文档 - Q2",
"OwnerID": "ou_46bb48e13f9ff5cfd4b60edae00678cd",
"URL": "https://feishu.cn/docx/C29IdflghosjksxWKvNutR3UsXe"
}
]
}DocsTokenfeishu-cli doc getdoc export{
"Total": 35367,
"HasMore": true,
"ResUnits": [
{
"DocsToken": "C29IdflghosjksxWKvNutR3UsXe",
"DocsType": "docx",
"Title": "Product Requirements Document - Q2",
"OwnerID": "ou_46bb48e13f9ff5cfd4b60edae00678cd",
"URL": "https://feishu.cn/docx/C29IdflghosjksxWKvNutR3UsXe"
}
]
}DocsTokenfeishu-cli doc getdoc exportsearch:messagefeishu-cli search messages "关键词" [选项]search:messagefeishu-cli search messages "keywords" [options]| 参数 | 类型 | 说明 |
|---|---|---|
| string | 限定群聊范围(逗号分隔) |
| string | 限定发送者 ID(逗号分隔) |
| string | 限定被@的用户 ID(逗号分隔) |
| string | 消息类型: |
| string | 会话类型: |
| string | 发送者类型: |
| string | 起始时间(Unix 秒级时间戳) |
| string | 结束时间(Unix 秒级时间戳) |
| int | 每页数量(默认 20) |
| string | 分页 token(上一页返回) |
| string | JSON 格式输出 |
| Parameter | Type | Description |
|---|---|---|
| string | Limit to specific group chats (comma-separated) |
| string | Limit to specific sender IDs (comma-separated) |
| string | Limit to specific mentioned user IDs (comma-separated) |
| string | Message type: |
| string | Chat type: |
| string | Sender type: |
| string | Start time (Unix timestamp in seconds) |
| string | End time (Unix timestamp in seconds) |
| int | Number of results per page (default 20) |
| string | Pagination token (returned from previous page) |
| string | Output in JSON format |
undefinedundefined
> **提示**:搜索群聊 API(`search-chats`)**无法搜到 p2p 私聊会话**。要查找私聊内容,使用 `search messages --chat-type p2p_chat`。
> **Note**: The group chat search API (`search-chats`) **cannot find p2p private sessions**. To find private chat content, use `search messages --chat-type p2p_chat`.{
"MessageIDs": ["om_xxx", "om_yyy"],
"PageToken": "ea9dcb2f...",
"HasMore": true
}MessageIDsfeishu-cli msg get <message_id>{
"MessageIDs": ["om_xxx", "om_yyy"],
"PageToken": "ea9dcb2f...",
"HasMore": true
}MessageIDsfeishu-cli msg get <message_id>feishu-cli search apps "关键词" [选项]feishu-cli search apps "keywords" [options]| 参数 | 类型 | 说明 |
|---|---|---|
| int | 每页数量(默认 20) |
| string | 分页 token |
| string | JSON 格式输出 |
| Parameter | Type | Description |
|---|---|---|
| int | Number of results per page (default 20) |
| string | Pagination token |
| string | Output in JSON format |
feishu-cli search apps "审批"
feishu-cli search apps "OKR" --page-size 50feishu-cli search apps "approval"
feishu-cli search apps "OKR" --page-size 50| 问题 | 原因 | 解决 |
|---|---|---|
| "缺少 User Access Token" | 从未登录 | 执行两步式登录流程 |
| "User Access Token 已过期" | access + refresh token 都过期 | 重新登录 |
| 99991679 权限错误提到搜索应用 | 应用未开通搜索应用权限,或该 scope 在开发者后台不可用 | 在飞书开发者后台确认是否已开通对应权限 |
99991679 权限错误提到 | 登录时未包含 | 重新登录,scope 加上 |
| 搜索结果为空 | 关键词不匹配或无权限文档 | 尝试更宽泛的关键词,或检查文档权限 |
| offset + count 超过 200 | 飞书 API 限制 | 最多翻到第 200 条结果 |
feishu-cli-auth| Issue | Cause | Solution |
|---|---|---|
| "Missing User Access Token" | Never logged in | Execute the two-step login process |
| "User Access Token has expired" | Both access and refresh tokens have expired | Log in again |
| Permission error 99991679 mentions app search | App search permission not enabled, or the scope is unavailable in the Developer Admin Console | Confirm if the corresponding permission is enabled in the Feishu Developer Admin Console |
Permission error 99991679 mentions | | Log in again and add the |
| No search results | Keywords do not match or no access to the docs | Try broader keywords, or check doc permissions |
| offset + count exceeds 200 | Feishu API limit | Maximum of 200 results can be retrieved via pagination |
feishu-cli-auth