cc-haha/docs/guide/global-usage.md
程序员阿江(Relakkes) 8bb3c0e116 docs: restructure README and organize docs into subdirectories
- Slim down README from ~400 lines to ~140 lines, keeping only essential content
- Reorganize docs/ into guide/, features/, reference/, images/ subdirectories
- Add GitHub badges (stars, forks, issues, PRs, license, language switch)
- Extract env vars, FAQ, fixes, project structure, global usage into separate docs
- Add LICENSE file (educational and research use only)
- Update all cross-references and issue template links
2026-04-04 18:18:01 +08:00

42 lines
984 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 全局使用(任意目录启动)
<p align="right"><a href="./global-usage.en.md">English</a> | <a href="../../README.md">返回 README</a></p>
如果你希望在任意项目目录直接运行 `claude-haha`,可以通过以下方式配置。配置完成后,`claude-haha` 会自动识别你当前所在的工作目录。
## macOS / Linux
`~/.bashrc``~/.zshrc` 中添加:
```bash
# 方式一:添加 PATH推荐
export PATH="$HOME/path/to/claude-code-haha/bin:$PATH"
# 方式二alias
alias claude-haha="$HOME/path/to/claude-code-haha/bin/claude-haha"
```
然后重新加载配置:
```bash
source ~/.bashrc # 或 source ~/.zshrc
```
## Windows (Git Bash)
`~/.bashrc` 中添加:
```bash
export PATH="$HOME/path/to/claude-code-haha/bin:$PATH"
```
## 验证
配置完成后,进入任意项目目录测试:
```bash
cd ~/your-other-project
claude-haha
# 启动后询问「当前目录是什么?」,应显示 ~/your-other-project
```