mcpField
N
nlm-cli-skill

nlm-cli-skill

github.com/jacob-bd生産性25761 回インストール20 週間前に更新
リポジトリ

nlm-cli-skill について

nlm-cli-skillは、`nlm`コマンドラインでGoogle NotebookLMのワークフローを自動化するためのガイドです。ノートブックやソース、調査、生成コンテンツを扱うユーザー向けに、コマンド手順と注意点をまとめています。

主な機能

  1. 01NotebookLMコマンドの操作ガイド
  2. 02ノートブックとソースの管理手順
  3. 03調査とコンテンツ生成の手順
  4. 04認証とセッションの注意点
  5. 05エイリアス、出力形式、エラー復旧

活用シーン

  1. 01ノートブックを作成してWebや文書を追加
  2. 02調査ソースを探してインポート
  3. 03ポッドキャスト、レポート、クイズ、カードを生成
  4. 04セッション切れやコマンドエラーから復旧

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/jacob-bd/notebooklm-cli --skill nlm-cli-skill

インストール後、Claude Code で/nlm-cli-skillを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
command_reference.md
troubleshooting.md
workflows.md

詳細

NotebookLM CLI エキスパート

このスキルでは、nlm CLI を使用して Google NotebookLM のワークフローを自動化するための包括的なガイダンスを提供します。

クイックリファレンス

nlm --help              # List all commands
nlm <command> --help    # Help for specific command
nlm --ai                # Full AI-optimized documentation
nlm --version           # Check installed version

重要なルール(最初にお読みください!)

  1. 必ず最初に認証する:操作の前に nlm login を実行してください
  2. セッションの有効期限は約20分です:コマンドが失敗し始めたら、nlm login を再実行してください
  3. --confirm は必須です:すべての生成コマンドと削除コマンドには --confirm または -y が必要です
  4. リサーチには --notebook-id が必要です:このフラグは必須であり、位置引数ではありません
  5. 出力から ID を取得する:作成/開始コマンドは、後続の操作に必要な ID を返します
  6. エイリアスを使用する:nlm alias set <name> <uuid> で長い UUID を簡略化できます
  7. ⚠️ 削除する前に必ずユーザーに確認する:削除コマンドを実行する前に、必ずユーザーに明示的な確認を求めてください。削除は取り消せません。削除対象を示し、データが永久に失われることを警告してください。
  8. 作成前にエイリアスを確認する:既存の名前との競合を避けるため、新しいエイリアスを作成する前に nlm alias list を実行してください。
  9. REPL を起動しない:nlm chat start は使用しないでください。AI ツールでは操作できない対話型 REPL が開きます。1回限りの Q&A には nlm notebook query を使用してください。
  10. 出力形式を適切に選ぶ:デフォルトの出力(フラグなし)は簡潔でトークン効率に優れているため、ステータス確認に使用してください。パイプで渡す ID を取得するには --quiet を使用してください。--json は、プログラムで特定のフィールドを解析する必要がある場合にのみ使用してください。

ワークフロー決定ツリー

適切なコマンドの順序を判断するには、以下を使用してください。

User wants to...
│
├─► Work with NotebookLM for the first time
│   └─► nlm login → nlm notebook create "Title"
│
├─► Add content to a notebook
│   ├─► From a URL/webpage → nlm source add <nb-id> --url "https://..."
│   ├─► From YouTube → nlm source add <nb-id> --url "https://youtube.com/..."
│   ├─► From pasted text → nlm source add <nb-id> --text "content" --title "Title"
│   ├─► From Google Drive → nlm source add <nb-id> --drive <doc-id> --type doc
│   └─► Discover new sources → nlm research start "query" --notebook-id <nb-id>
│
├─► Generate content from sources
│   ├─► Podcast/Audio → nlm audio create <nb-id> --confirm
│   ├─► Written summary → nlm report create <nb-id> --confirm
│   ├─► Study materials → nlm quiz/flashcards create <nb-id> --confirm
│   ├─► Visual content → nlm mindmap/slides/infographic create <nb-id> --confirm
│   ├─► Video → nlm video create <nb-id> --confirm
│   └─► Extract data → nlm data-table create <nb-id> "description" --confirm
│
├─► Ask questions about sources
│   └─► nlm notebook query <nb-id> "question"
│       (Use --conversation-id for follow-ups)
│       ⚠️ Do NOT use `nlm chat start` - it's a REPL for humans only
│
├─► Check generation status
│   └─► nlm studio status <nb-id>
│
└─► Manage/cleanup
    ├─► List notebooks → nlm notebook list
    ├─► List sources → nlm source list <nb-id>
    ├─► Delete source → nlm source delete <source-id> --confirm
    └─► Delete notebook → nlm notebook delete <nb-id> --confirm

コマンドのカテゴリ

1. 認証
nlm login                    # Launch Chrome, extract cookies (primary method)
nlm login --check            # Validate current session
nlm login --profile work     # Use named profile for multiple accounts
nlm auth status              # Check if authenticated
nlm auth list                # List all profiles

セッションの有効期間:約20分です。認証エラーでコマンドが失敗した場合は、再認証してください。

2. ノートブック管理
nlm notebook list                      # List all notebooks
nlm notebook list --json               # JSON output for parsing
nlm notebook list --quiet              # IDs only (for scripting)
nlm notebook create "Title"            # Create notebook, returns ID
nlm notebook get <id>                  # Get notebook details
nlm notebook describe <id>             # AI-generated summary + suggested topics
nlm notebook query <id> "question"     # One-shot Q&A with sources
nlm notebook rename <id> "New Title"   # Rename notebook
nlm notebook delete <id> --confirm     # PERMANENT deletion
3. ソース管理
# Adding sources
nlm source add <nb-id> --url "https://..."           # Web page
nlm source add <nb-id> --url "https://youtube.com/..." # YouTube video
nlm source add <nb-id> --text "content" --title "X"  # Pasted text
nlm source add <nb-id> --drive <doc-id>              # Drive doc (auto-detect type)
nlm source add <nb-id> --drive <doc-id> --type slides # Explicit type

# Listing and viewing
nlm source list <nb-id>                # Table of sources
nlm source list <nb-id> --drive        # Show Drive sources with freshness
nlm source list <nb-id> --drive -S     # Skip freshness checks (faster)
nlm source get <source-id>             # Source metadata
nlm source describe <source-id>        # AI summary + keywords
nlm source content <source-id>         # Raw text content
nlm source content <source-id> -o file.txt  # Export to file

# Drive sync (for stale sources)
nlm source stale <nb-id>               # List outdated Drive sources
nlm source sync <nb-id> --confirm      # Sync all stale sources
nlm source sync <nb-id> --source-ids <ids> --confirm  # Sync specific

# Deletion
nlm source delete <source-id> --confirm

Drive の種類:doc、slides、sheets、pdf

4. リサーチ(ソースの検出)

リサーチでは、ウェブまたは Google Drive から新しいソースを見つけます。

# Start research (--notebook-id is REQUIRED)
nlm research start "query" --notebook-id <id>              # Fast web (~30s)
nlm research start "query" --notebook-id <id> --mode deep  # Deep web (~5min)
nlm research start "query" --notebook-id <id> --source drive  # Drive search

# Check progress
nlm research status <nb-id>                   # Poll until done (5min max)
nlm research status <nb-id> --max-wait 0      # Single check, no waiting
nlm research status <nb-id> --task-id <tid>   # Check specific task
nlm research status <nb-id> --full            # Full details

# Import discovered sources
nlm research import <nb-id> <task-id>            # Import all
nlm research import <nb-id> <task-id> --indices 0,2,5  # Import specific

モード:fast(約30秒、約10件のソース) | deep(約5分、40件以上のソース、ウェブのみ)

5. コンテンツ生成(Studio)

すべての生成コマンドで、以下のフラグを使用できます。

  • --confirm または -y:実行に必須
  • --source-ids <id1,id2>:特定のソースに限定
  • --language <code>:BCP-47 コード(en、es、fr、de、ja)
# Audio (Podcast)
nlm audio create <id> --confirm
nlm audio create <id> --format deep_dive --length default --confirm
nlm audio create <id> --format brief --focus "key topic" --confirm
# Formats: deep_dive, brief, critique, debate
# Lengths: short, default, long

# Report
nlm report create <id> --confirm
nlm report create <id> --format "Study Guide" --confirm
nlm report create <id> --format "Create Your Own" --prompt "Custom..." --confirm
# Formats: "Briefing Doc", "Study Guide", "Blog Post", "Create Your Own"

# Quiz
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
# Count: number of questions (default: 2)
# Difficulty: 1-5 (1=easy, 5=hard)

# Flashcards
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
# Difficulty: easy, medium, hard

# Mind Map
nlm mindmap create <id> --confirm
nlm mindmap create <id> --title "Topic Overview" --confirm
nlm mindmap list <id>  # List existing mind maps

# Slides
nlm slides create <id> --confirm
nlm slides create <id> --format presenter --length short --confirm
# Formats: detailed, presenter | Lengths: short, default

# Infographic
nlm infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --confirm
# Orientations: landscape, portrait, square
# Detail: concise, standard, detailed

# Video
nlm video create <id> --confirm
nlm video create <id> --format brief --style whiteboard --confirm
# Formats: explainer, brief
# Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft

# Data Table
nlm data-table create <id> "Extract all dates and events" --confirm
# DESCRIPTION is required as second argument
6. Studio(成果物の管理)

生成されたコンテンツを確認、管理します。

nlm studio status <nb-id>                          # List all artifacts
nlm studio status <nb-id> --json                   # JSON output
nlm studio delete <nb-id> <artifact-id> --confirm  # Delete artifact

ステータス値:completed(✓)、in_progress(●)、failed(✗)

7. 対話型チャット(人間のユーザー専用)

⚠️ AI ツール:nlm chat start は使用しないでください - プログラムでは操作できない対話型 REPL が起動します。1回限りの Q&A には nlm notebook query を使用してください。

ターミナルを使用する人間のユーザー向け:

nlm chat start <nb-id>  # Launch interactive REPL

REPL コマンド:

  • /sources - 使用可能なソースを一覧表示
  • /clear - 会話のコンテキストをリセット
  • /help - コマンドを表示
  • /exit - REPL を終了

チャットの動作を設定する(REPL と query の両方で有効):

nlm chat configure <id> --goal default
nlm chat configure <id> --goal learning_guide
nlm chat configure <id> --goal custom --prompt "Act as a tutor..."
nlm chat configure <id> --response-length longer  # longer, default, shorter
8. エイリアス(UUID のショートカット)

長い UUID を簡略化します。

nlm alias set myproject abc123-def456...  # Create alias (auto-detects type)
nlm alias get myproject                    # Resolve to UUID
nlm alias list                             # List all aliases
nlm alias delete myproject                 # Remove alias

# Use aliases anywhere
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
9. 設定
nlm config show              # Show current config
nlm config get <key>         # Get specific setting
nlm config set <key> <value> # Update setting

出力形式

ほとんどの一覧表示コマンドでは、複数の形式を使用できます。

フラグ説明
(なし)リッチテーブル(人間が読みやすい形式)
--jsonJSON 出力(解析用)
--quietID のみ(パイプで渡す場合)
--title「ID: タイトル」形式
--url「ID: URL」形式(ソースのみ)
--fullすべての列/詳細

よくあるパターン

パターン 1:リサーチ → ポッドキャストのパイプライン
nlm notebook create "AI Research 2026"   # Capture ID
nlm alias set ai <notebook-id>
nlm research start "agentic AI trends" --notebook-id ai --mode deep
nlm research status ai --max-wait 300    # Wait up to 5 min
nlm research import ai <task-id>         # Import all sources
nlm audio create ai --format deep_dive --confirm
nlm studio status ai                     # Check generation progress
パターン 2:コンテンツのすばやい取り込み
nlm source add <id> --url "https://example1.com"
nlm source add <id> --url "https://example2.com"
nlm source add <id> --text "My notes..." --title "Notes"
nlm source list <id>
パターン 3:学習教材の生成
nlm report create <id> --format "Study Guide" --confirm
nlm quiz create <id> --count 10 --difficulty 3 --confirm
nlm flashcards create <id> --difficulty medium --confirm
パターン 4:Drive ドキュメントのワークフロー
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slides
# ... time passes, document is edited ...
nlm source stale <id>                    # Check freshness
nlm source sync <id> --confirm           # Sync if stale

エラーからの復旧

エラー原因解決策
"Cookies have expired"セッションのタイムアウトnlm login
"authentication may have expired"セッションのタイムアウトnlm login
"Notebook not found"無効な IDnlm notebook list
"Source not found"無効な IDnlm source list <nb-id>
"Rate limit exceeded"呼び出し回数が多すぎます30 秒待ってから再試行してください
"Research already in progress"リサーチが保留中です--force を使用するか、先にインポートしてください
Chrome doesn't launchポートの競合Chrome を閉じてから再試行してください

レート制限

レート制限を避けるため、操作の間隔を空けてください:

  • ソース操作:2 秒
  • コンテンツ生成:5 秒
  • リサーチ操作:2 秒
  • クエリ操作:2 秒

詳細なリファレンス

詳細については、以下を参照してください:

コメント