Skip to content

Commit eead9e0

Browse files
authored
docs: add tab completion to getting started guides (#658)
* docs: add tab completion to getting started guide * docs: add tab completion to zh getting started guide
1 parent a21cc5e commit eead9e0

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

docs/guide/getting-started.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,27 @@ opencli bilibili hot -f csv # CSV
4848
opencli bilibili hot -v # Verbose: show pipeline debug
4949
```
5050

51+
### Tab Completion
52+
53+
OpenCLI supports intelligent tab completion to speed up command input:
54+
55+
```bash
56+
# Add shell completion to your startup config
57+
echo 'eval "$(opencli completion zsh)"' >> ~/.zshrc # Zsh
58+
echo 'eval "$(opencli completion bash)"' >> ~/.bashrc # Bash
59+
echo 'opencli completion fish | source' >> ~/.config/fish/config.fish # Fish
60+
61+
# Restart your shell, then press Tab to complete:
62+
opencli [Tab] # Complete site names (bilibili, zhihu, twitter...)
63+
opencli bilibili [Tab] # Complete commands (hot, search, me, download...)
64+
```
65+
66+
The completion includes:
67+
- All available sites and adapters
68+
- Built-in commands (list, explore, validate...)
69+
- Command aliases
70+
- Real-time updates as you add new adapters
71+
5172
## Next Steps
5273

5374
- [Installation details](/guide/installation)

docs/zh/guide/getting-started.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@ opencli bilibili hot -f md # Markdown
3232
opencli bilibili hot -f csv # CSV
3333
```
3434

35+
## 终端自动补全
36+
37+
OpenCLI 支持智能的 Tab 自动补全,加快命令输入:
38+
39+
```bash
40+
# 把自动补全加入 shell 启动配置
41+
echo 'eval "$(opencli completion zsh)"' >> ~/.zshrc # Zsh
42+
echo 'eval "$(opencli completion bash)"' >> ~/.bashrc # Bash
43+
echo 'opencli completion fish | source' >> ~/.config/fish/config.fish # Fish
44+
45+
# 重启 shell 后,按 Tab 键补全:
46+
opencli [Tab] # 补全站点名称(bilibili、zhihu、twitter...)
47+
opencli bilibili [Tab] # 补全命令(hot、search、me、download...)
48+
```
49+
50+
补全功能包含:
51+
- 所有可用的站点和适配器
52+
- 内置命令(list、explore、validate...)
53+
- 命令别名
54+
- 新增适配器时的实时更新
55+
3556
## 下一步
3657

3758
- [安装详情](/zh/guide/installation)

0 commit comments

Comments
 (0)