add
This commit is contained in:
156
docs/guides/custom-help-setup.md
Normal file
156
docs/guides/custom-help-setup.md
Normal file
@ -0,0 +1,156 @@
|
||||
# Claude Code カスタムヘルプ機能のセットアップ
|
||||
|
||||
## 概要
|
||||
|
||||
Claude Codeの標準ヘルプを拡張し、ショートカットキー、公式ドキュメントへのリンク、便利なTipsを統合したカスタムヘルプシステムです。
|
||||
|
||||
## インストール
|
||||
|
||||
### 1. zshrcへの追加
|
||||
|
||||
`.zshrc`に以下を追加:
|
||||
|
||||
```bash
|
||||
# Claude Code ヘルパー関数の読み込み
|
||||
source "$HOME/git/claude/scripts/claude-zsh-functions.sh"
|
||||
```
|
||||
|
||||
または、直接関数を.zshrcに追加:
|
||||
|
||||
```bash
|
||||
# Claude Code拡張ヘルプ
|
||||
function claude-help() {
|
||||
bash "$HOME/git/claude/scripts/claude-help.sh" "$@"
|
||||
}
|
||||
|
||||
# エイリアス
|
||||
alias ch='claude-help'
|
||||
alias cr='claude-readme'
|
||||
```
|
||||
|
||||
### 2. スクリプトの配置
|
||||
|
||||
```bash
|
||||
# スクリプトディレクトリの作成
|
||||
mkdir -p ~/git/claude/scripts
|
||||
|
||||
# 実行権限の付与
|
||||
chmod +x ~/git/claude/scripts/claude-help.sh
|
||||
chmod +x ~/git/claude/scripts/claude-zsh-functions.sh
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 基本コマンド
|
||||
|
||||
```bash
|
||||
# 全体のヘルプを表示
|
||||
claude-help
|
||||
|
||||
# カテゴリ別ヘルプ
|
||||
claude-help shortcuts # ショートカットキー詳細
|
||||
claude-help options # 起動オプション詳細
|
||||
claude-help docs # 公式ドキュメントリンク
|
||||
|
||||
# エイリアス使用
|
||||
ch # claude-helpの短縮形
|
||||
cr # クイックリファレンス表示
|
||||
cs # 安全モードでClaude Code起動
|
||||
```
|
||||
|
||||
### 利用可能な関数
|
||||
|
||||
| 関数名 | 説明 | 使用例 |
|
||||
|--------|------|--------|
|
||||
| `claude-help` | 拡張ヘルプを表示 | `claude-help [カテゴリ]` |
|
||||
| `claude-readme` | クイックリファレンス | `claude-readme` |
|
||||
| `claude-safe` | 安全チェック付き起動 | `claude-safe` |
|
||||
| `claude-session` | セッション管理 | `claude-session list` |
|
||||
| `claude-edit-config` | CLAUDE.md編集 | `claude-edit-config` |
|
||||
| `claude-docs` | 公式ドキュメントを開く | `claude-docs settings` |
|
||||
|
||||
## Claude Code内でのカスタムコマンド化
|
||||
|
||||
### 方法1: エイリアスとして設定
|
||||
|
||||
`~/.claude/settings.json`に追加:
|
||||
|
||||
```json
|
||||
{
|
||||
"aliases": {
|
||||
"help+": "!bash ~/git/claude/scripts/claude-help.sh",
|
||||
"shortcuts": "!bash ~/git/claude/scripts/claude-help.sh shortcuts"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 方法2: スラッシュコマンドとして実装
|
||||
|
||||
Claude Code内で以下のように使用:
|
||||
|
||||
```
|
||||
/help+
|
||||
```
|
||||
|
||||
※ 現在のClaude Codeではカスタムスラッシュコマンドの追加は制限されている可能性があります。
|
||||
|
||||
## カスタマイズ
|
||||
|
||||
### ヘルプ内容の編集
|
||||
|
||||
`scripts/claude-help.sh`を編集して、独自の内容を追加:
|
||||
|
||||
```bash
|
||||
show_category "🔧 カスタムセクション"
|
||||
cat << 'EOF'
|
||||
独自の内容をここに追加
|
||||
EOF
|
||||
```
|
||||
|
||||
### 新しいカテゴリの追加
|
||||
|
||||
```bash
|
||||
case "$1" in
|
||||
"custom"|"c")
|
||||
show_category "カスタムカテゴリ"
|
||||
# 内容を追加
|
||||
;;
|
||||
esac
|
||||
```
|
||||
|
||||
## トラブルシューティング
|
||||
|
||||
### スクリプトが見つからない
|
||||
|
||||
パスを確認:
|
||||
```bash
|
||||
which claude-help
|
||||
echo $HOME/git/claude/scripts/claude-help.sh
|
||||
```
|
||||
|
||||
### 実行権限エラー
|
||||
|
||||
```bash
|
||||
chmod +x ~/git/claude/scripts/*.sh
|
||||
```
|
||||
|
||||
### zsh関数が読み込まれない
|
||||
|
||||
```bash
|
||||
# .zshrcを再読み込み
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
## 今後の拡張案
|
||||
|
||||
1. **インタラクティブメニュー**
|
||||
- fzfを使った選択式ヘルプ
|
||||
- カテゴリの動的選択
|
||||
|
||||
2. **オンラインヘルプの統合**
|
||||
- 最新のドキュメントを自動取得
|
||||
- コミュニティTipsの表示
|
||||
|
||||
3. **パーソナライズ**
|
||||
- 使用頻度に基づくヘルプの最適化
|
||||
- ユーザー独自のTips追加機能
|
Reference in New Issue
Block a user