feishu-doc-cli 0.1.1 → 0.1.3

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 -1
  2. package/dist/cli.js +12 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,14 @@ npm install -g feishu-doc-cli
12
12
 
13
13
  Requires Node.js >= 18.
14
14
 
15
+ ### As an AI agent skill
16
+
17
+ ```bash
18
+ npx skills add m1heng/feishu-doc-cli
19
+ ```
20
+
21
+ Once installed, agents like Claude Code will automatically use `feishu-doc` when you ask about Feishu/Lark APIs.
22
+
15
23
  ## Usage
16
24
 
17
25
  ### Read a document
@@ -95,7 +103,7 @@ feishu-doc read "/document/client-docs/intro"
95
103
  feishu-doc read "/home/intro"
96
104
  ```
97
105
 
98
- The CLI normalizes all formats internally. No need to manually convert.
106
+ The CLI normalizes all formats internally, including anchors (`#section`) and query strings. No need to manually convert.
99
107
 
100
108
  ## How it works
101
109
 
package/dist/cli.js CHANGED
@@ -56,13 +56,22 @@ async function cmdRead(path, lang) {
56
56
  }
57
57
  async function cmdTree(lang, depth, path) {
58
58
  const tree = await fetchTree(lang);
59
- const nodes = path ? filterSubtree(tree, normalizePath(path)) : tree;
60
- if (!nodes) {
59
+ const match = path ? filterSubtree(tree, normalizePath(path)) : null;
60
+ if (path && !match) {
61
61
  console.error(`Path not found in tree: ${path}`);
62
62
  process.exit(1);
63
63
  return;
64
64
  }
65
- console.log(renderTree(nodes, depth));
65
+ // When filtering by path, render children of the matched node directly
66
+ // so --depth 1 shows its immediate children (not the node itself).
67
+ const nodes = match ? match[0].items : tree;
68
+ if (match && nodes.length === 0) {
69
+ // Leaf node — show the node itself
70
+ console.log(renderTree(match, depth));
71
+ }
72
+ else {
73
+ console.log(renderTree(nodes, depth));
74
+ }
66
75
  }
67
76
  async function cmdSearch(keyword, lang) {
68
77
  const tree = await fetchTree(lang);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feishu-doc-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI tool to read Feishu Open Platform documentation as Markdown, designed for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",