/setup-x-api
Lesson command
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/setup-x-api
Context preview
What this command does when you run it.
Lesson command
Command definition
setup-x-api.mddescription: "Lesson command"
duration: "約15分"
prerequisites: ["Xアカウントを持っている", "ブラウザが使える"]
level: "beginner"
tags: ["setup", "x", "twitter", "api"]
nonInteractiveMode: incompatible
X (Twitter) API セットアップ
Step 0: セットアップ進捗の確認
**AIが自動実行する内容:** 1. `uv run python tools/setup_progress.py show --current setup-x-api` を実行して進捗を表示 2. 既存のAPIキーを自動検出:
- `uv run python tools/credential_manager.py status` を実行
- X_BEARER_TOKEN が設定済みの場合、Step 4(APIテスト)のみ実行して完了にできる
- `.env` に平文で存在する場合、credential store への移行を提案
**重要な警告をユーザーに表示:**
⚠️ X (Twitter) API は有料プランが必要です
- Free tier: Recent Search API は利用できません
- Basic plan: $100/月 が必要です
- このセットアップは任意です。x-research スキルを使わない場合はスキップできます
研修の他のレッスン(バナー生成、図表作成、データ分析など)は
X API がなくても問題なく受講できます。
このセッションでやること
| 項目 | 内容 | |------|------| | ゴール | X Developer Portal で Bearer Token を取得し、Credential Store に保存して X のリアルタイム検索・トレンド分析機能を使えるようにする | | 所要時間 | 約15分 | | 前提条件 | Xアカウントを持っていること、ブラウザが使えること | | 操作レベル | CLIコマンド入力なし(すべてAIが自動実行 + GUI操作のみ) | | 料金 | **Basic plan ($100/月) 以上が必要**。Free tier では Recent Search API が使えません | | 用途 | X (Twitter) のリアルタイム検索・トレンド分析。x-research スキルで使用 |
**このセッションの流れ:** 1. ブラウザで X Developer Portal を開く(AIが自動でブラウザを起動) 2. Developer アカウントを申請し、プロジェクト・Appを作成する 3. Bearer Token を取得する 4. 別ターミナルで credential_manager.py を使って安全に保存する 5. 動作テスト(AIが自動実行)
> **ヒント**: AIの応答が途中で止まった場合は「続きを表示して」「止まってるよ」と入力すると再開します。
---
準備チェック
**AskQuestionの設定:**
{
"title": "セッション開始前の確認",
"questions": [{
"id": "readiness",
"prompt": "X API のセットアップには Basic plan ($100/月) が必要です。準備はできていますか?",
"options": [
{"id": "ready", "label": "有料プランに加入済み / 加入する予定です。始めましょう"},
{"id": "chrome", "label": "/chrome でブラウザ操作を自動化する"},
{"id": "check_cost", "label": "料金について詳しく知りたい"},
{"id": "skip", "label": "スキップする(X APIは使わない)"},
{"id": "different_lesson", "label": "別のレッスンに移動したい"}
]
}]
}(ready -> Step 1へ) (chrome → Step 1 でブラウザを開いた後、「Chrome 統合で自動化する場合」セクションの手順で自動実行する) (check_cost -> 「X API の料金体系: Free tier は投稿のみ(検索API不可)。Basic plan ($100/月) で Recent Search API が使えます。Pro plan ($5,000/月) は Full-Archive Search が使えますが、研修では Basic で十分です。コストに見合わない場合はスキップを推奨します」と案内) (skip -> 「X APIセットアップをスキップしました。他のレッスンに影響はありません。後から /setup-x-api で再開できます」と案内して完了処理へ) (different_lesson -> モジュール一覧を表示)
---
Step 1: ブラウザで X Developer Portal を開く
**AIが実行すること:** 1. OSを自動判定する(Mac / Windows / Linux) 2. 以下のコマンドを実行してブラウザを自動起動する:
# Mac:
open https://developer.x.com/en/portal/dashboard
# Windows:
start https://developer.x.com/en/portal/dashboard
# Linux:
xdg-open https://developer.x.com/en/portal/dashboard
**ブラウザが開いたら、以下のAskQuestionを表示:**
{
"title": "Step 1: X Developer Portal にアクセス",
"questions": [{
"id": "portal_status",
"prompt": "ブラウザが開きましたか?以下の手順で Developer アカウントを申請してください:\n\n1. Xアカウントでログインする\n2. 「Sign up for Free Account」または「Subscribe to Basic」を選択\n (Recent Search API を使うには Basic plan が必要です)\n3. 利用目的を記入する(例: 'Academic research and AI agent training')\n4. 開発者契約に同意する\n\nDeveloper Portal のダッシュボードが表示されましたか?",
"options": [
{"id": "dashboard_ready", "label": "ダッシュボードが表示されました!"},
{"id": "browser_not_open", "label": "ブラウザが開かない"},
{"id": "signup_issue", "label": "Developer アカウントの申請がうまくいかない"},
{"id": "already_have_account", "label": "すでに Developer アカウントを持っている"}
]
}]
}(dashboard_ready -> Step 2へ) (browser_not_open -> 「ブラウザで直接このURLを開いてください: https://developer.x.com/en/portal/dashboard」と案内) (signup_issue -> 「Developer Portal の申請には審査が必要な場合があります。利用目的は具体的に記入してください(例: 'Building an AI-powered social media research tool for corporate training')。審査に数日かかる場合があります。承認メールが届いてから再度このセットアップを実行してください」と案内) (already_have_account -> Step 2へ)
---
Chrome 統合で自動化する場合(`/chrome` モード)
**前提条件:** Chrome に「Claude in Chrome」拡張機能(v1.0.36+)がインストール済みで、`claude --chrome` で起動しているか、セッション内で `/chrome` を実行済みであること。
**AIが Chrome 統合で自動実行する内容:** 1. ブラウザで https://developer.x.com/en/portal/dashboard を開く 2. Chrome 統合を使って以下の操作を順番に実行する:
- 「Subscribe to Basic」を選択(Recent Search API を使うには Basic plan が必要。Free Account では検索APIが使えません)
- 支払い情報の入力はユーザーに任せる(ユーザーの操作を待つ)
- Use case に「AI agent training and educational purposes」と入力
- Developer Agreement に同意して Submit(ユーザーの操作を待つ)
- Dashboard で「Projects & Apps」に移動
- 「+ Add Project」をクリック → Project name に「AIAgent Bootcamp」、Use case で「Exploring the API」を選択
- 「+ Add App」をクリック → App name に「AIAgent Bootcamp」、Environment で「Development」を選択
- 「Keys and tokens」タブを開く
- Bearer Token の横にある「Regenerate」をクリック
- 確認ダイアログで「Yes, regenerate」をクリック
3. Bearer Token が表示されたことを確認したら、ユーザーに「トークンをコピーしてください。ページを離れると再表示できません」と案内する 4. Step 3 に進む
**注意:** Bearer Token の値はブラウザ画面から読み取らないこと。ユーザーが手動でコピーする。
Chrome 統合が利用できない場合は、以下の手順を手動で実行してください。
---
Step 2: プロジェクト作成と Bearer Token の取得
**AskQuestionの設定:**
{
"title": "Step 2: Bearer Token を取得",
"questions": [{
"id": "token_status",
"prompt": "以下の手順で Bearer Token を取得してください:\n\n1. Dashboard > 「Projects & Apps」セクションを確認\n2. プロジェクトがない場合は「+ Add Project」をクリック\n - プロジェクト名を入力(例: 'AIAgent Bootcamp')\n - Use case を選択(例: 'Exploring the API')\n3. プロジェクト内の「+ Add App」をクリック\n - App名を入力(例: 'AIAgent Bootcamp')\n - App environment は「Development」を選択\n4. 「Keys and tokens」タブを開く\n5. 「Bearer Token」セクションの「Regenerate」をクリック\n6. 表示された Bearer Token をコピーする\n\nBearer Token をコピーできましたか?",
"options": [
{"id": "copied", "label": "Bearer Token をコピーしました!"},
{"id": "no_project", "label": "プロジェクトの作成方法がわからない"},
{"id": "no_bearer", "label": "Bearer Token が見つからない"},
{"id": "plan_issue", "label": "Free tier なので Basic にアップグレードしたい"}
]
}]
}(copied -> Step 3へ) (no_project -> 「Dashboard の左メニューから 'Projects & Apps' を選択してください。'+ Add Project' ボタンが表示されます。プロジェクト名は自由に設定できます(例: 'AIAgent Bootcamp')。作成後、プロジェクト内で '+ Add App' をクリックしてアプリを追加してください」と案内) (no_bearer -> 「App を選択 > 'Keys and tokens' タブを開いてください。ページ中段に 'Bearer Token' セクションがあります。'Regenerate' ボタンをクリックすると新しいトークンが生成されます。表示されたトークンをすぐにコピーしてください(ページを離れると再表示できません)」と案内) (plan_issue -> 「Dashboa
Read more
description: "Lesson command" duration: "約15分" prerequisites: ["Xアカウントを持っている", "ブラウザが使える"] level: "beginner" tags: ["setup", "x", "twitter", "api"] nonInteractiveMode: incompatible
X (Twitter) API セットアップ
Step 0: セットアップ進捗の確認
**AIが自動実行する内容:** 1. `uv run python tools/setup_progress.py show --current setup-x-api` を実行して進捗を表示 2. 既存のAPIキーを自動検出:
- `uv run python tools/credential_manager.py status` を実行
- X_BEARER_TOKEN が設定済みの場合、Step 4(APIテスト)のみ実行して完了にできる
- `.env` に平文で存在する場合、credential store への移行を提案
**重要な警告をユーザーに表示:**
⚠️ X (Twitter) API は有料プランが必要です - Free tier: Recent Search API は利用できません - Basic plan: $100/月 が必要です - このセットアップは任意です。x-research スキルを使わない場合はスキップできます 研修の他のレッスン(バナー生成、図表作成、データ分析など)は X API がなくても問題なく受講できます。
このセッションでやること
| 項目 | 内容 | |------|------| | ゴール | X Developer Portal で Bearer Token を取得し、Credential Store に保存して X のリアルタイム検索・トレンド分析機能を使えるようにする | | 所要時間 | 約15分 | | 前提条件 | Xアカウントを持っていること、ブラウザが使えること | | 操作レベル | CLIコマンド入力なし(すべてAIが自動実行 + GUI操作のみ) | | 料金 | **Basic plan ($100/月) 以上が必要**。Free tier では Recent Search API が使えません | | 用途 | X (Twitter) のリアルタイム検索・トレンド分析。x-research スキルで使用 |
**このセッションの流れ:** 1. ブラウザで X Developer Portal を開く(AIが自動でブラウザを起動) 2. Developer アカウントを申請し、プロジェクト・Appを作成する 3. Bearer Token を取得する 4. 別ターミナルで credential_manager.py を使って安全に保存する 5. 動作テスト(AIが自動実行)
> **ヒント**: AIの応答が途中で止まった場合は「続きを表示して」「止まってるよ」と入力すると再開します。
---
準備チェック
**AskQuestionの設定:**
{
"title": "セッション開始前の確認",
"questions": [{
"id": "readiness",
"prompt": "X API のセットアップには Basic plan ($100/月) が必要です。準備はできていますか?",
"options": [
{"id": "ready", "label": "有料プランに加入済み / 加入する予定です。始めましょう"},
{"id": "chrome", "label": "/chrome でブラウザ操作を自動化する"},
{"id": "check_cost", "label": "料金について詳しく知りたい"},
{"id": "skip", "label": "スキップする(X APIは使わない)"},
{"id": "different_lesson", "label": "別のレッスンに移動したい"}
]
}]
}(ready -> Step 1へ) (chrome → Step 1 でブラウザを開いた後、「Chrome 統合で自動化する場合」セクションの手順で自動実行する) (check_cost -> 「X API の料金体系: Free tier は投稿のみ(検索API不可)。Basic plan ($100/月) で Recent Search API が使えます。Pro plan ($5,000/月) は Full-Archive Search が使えますが、研修では Basic で十分です。コストに見合わない場合はスキップを推奨します」と案内) (skip -> 「X APIセットアップをスキップしました。他のレッスンに影響はありません。後から /setup-x-api で再開できます」と案内して完了処理へ) (different_lesson -> モジュール一覧を表示)
---
Step 1: ブラウザで X Developer Portal を開く
**AIが実行すること:** 1. OSを自動判定する(Mac / Windows / Linux) 2. 以下のコマンドを実行してブラウザを自動起動する:
# Mac: open https://developer.x.com/en/portal/dashboard # Windows: start https://developer.x.com/en/portal/dashboard # Linux: xdg-open https://developer.x.com/en/portal/dashboard
**ブラウザが開いたら、以下のAskQuestionを表示:**
{
"title": "Step 1: X Developer Portal にアクセス",
"questions": [{
"id": "portal_status",
"prompt": "ブラウザが開きましたか?以下の手順で Developer アカウントを申請してください:\n\n1. Xアカウントでログインする\n2. 「Sign up for Free Account」または「Subscribe to Basic」を選択\n (Recent Search API を使うには Basic plan が必要です)\n3. 利用目的を記入する(例: 'Academic research and AI agent training')\n4. 開発者契約に同意する\n\nDeveloper Portal のダッシュボードが表示されましたか?",
"options": [
{"id": "dashboard_ready", "label": "ダッシュボードが表示されました!"},
{"id": "browser_not_open", "label": "ブラウザが開かない"},
{"id": "signup_issue", "label": "Developer アカウントの申請がうまくいかない"},
{"id": "already_have_account", "label": "すでに Developer アカウントを持っている"}
]
}]
}(dashboard_ready -> Step 2へ) (browser_not_open -> 「ブラウザで直接このURLを開いてください: https://developer.x.com/en/portal/dashboard」と案内) (signup_issue -> 「Developer Portal の申請には審査が必要な場合があります。利用目的は具体的に記入してください(例: 'Building an AI-powered social media research tool for corporate training')。審査に数日かかる場合があります。承認メールが届いてから再度このセットアップを実行してください」と案内) (already_have_account -> Step 2へ)
---
Chrome 統合で自動化する場合(`/chrome` モード)
**前提条件:** Chrome に「Claude in Chrome」拡張機能(v1.0.36+)がインストール済みで、`claude --chrome` で起動しているか、セッション内で `/chrome` を実行済みであること。
**AIが Chrome 統合で自動実行する内容:** 1. ブラウザで https://developer.x.com/en/portal/dashboard を開く 2. Chrome 統合を使って以下の操作を順番に実行する:
- 「Subscribe to Basic」を選択(Recent Search API を使うには Basic plan が必要。Free Account では検索APIが使えません)
- 支払い情報の入力はユーザーに任せる(ユーザーの操作を待つ)
- Use case に「AI agent training and educational purposes」と入力
- Developer Agreement に同意して Submit(ユーザーの操作を待つ)
- Dashboard で「Projects & Apps」に移動
- 「+ Add Project」をクリック → Project name に「AIAgent Bootcamp」、Use case で「Exploring the API」を選択
- 「+ Add App」をクリック → App name に「AIAgent Bootcamp」、Environment で「Development」を選択
- 「Keys and tokens」タブを開く
- Bearer Token の横にある「Regenerate」をクリック
- 確認ダイアログで「Yes, regenerate」をクリック
3. Bearer Token が表示されたことを確認したら、ユーザーに「トークンをコピーしてください。ページを離れると再表示できません」と案内する 4. Step 3 に進む
**注意:** Bearer Token の値はブラウザ画面から読み取らないこと。ユーザーが手動でコピーする。
Chrome 統合が利用できない場合は、以下の手順を手動で実行してください。
---
Step 2: プロジェクト作成と Bearer Token の取得
**AskQuestionの設定:**
{
"title": "Step 2: Bearer Token を取得",
"questions": [{
"id": "token_status",
"prompt": "以下の手順で Bearer Token を取得してください:\n\n1. Dashboard > 「Projects & Apps」セクションを確認\n2. プロジェクトがない場合は「+ Add Project」をクリック\n - プロジェクト名を入力(例: 'AIAgent Bootcamp')\n - Use case を選択(例: 'Exploring the API')\n3. プロジェクト内の「+ Add App」をクリック\n - App名を入力(例: 'AIAgent Bootcamp')\n - App environment は「Development」を選択\n4. 「Keys and tokens」タブを開く\n5. 「Bearer Token」セクションの「Regenerate」をクリック\n6. 表示された Bearer Token をコピーする\n\nBearer Token をコピーできましたか?",
"options": [
{"id": "copied", "label": "Bearer Token をコピーしました!"},
{"id": "no_project", "label": "プロジェクトの作成方法がわからない"},
{"id": "no_bearer", "label": "Bearer Token が見つからない"},
{"id": "plan_issue", "label": "Free tier なので Basic にアップグレードしたい"}
]
}]
}(copied -> Step 3へ) (no_project -> 「Dashboard の左メニューから 'Projects & Apps' を選択してください。'+ Add Project' ボタンが表示されます。プロジェクト名は自由に設定できます(例: 'AIAgent Bootcamp')。作成後、プロジェクト内で '+ Add App' をクリックしてアプリを追加してください」と案内) (no_bearer -> 「App を選択 > 'Keys and tokens' タブを開いてください。ページ中段に 'Bearer Token' セクションがあります。'Regenerate' ボタンをクリックすると新しいトークンが生成されます。表示されたトークンをすぐにコピーしてください(ページを離れると再表示できません)」と案内) (plan_issue -> 「Dashboa
AI Agent Training for Non-Engineers - Complete Guide to Claude Code / Cursor / Codex ### ⚠️ Before you clone Official repository (maintained by the authors): Running AI agents from this repo grants them shell, file-write, and external-API permissions on your
Other commands on ai-agent-camp.
- /check-setup.en
Top-level alias — see lesson/check-setup.en.md for the full body.
Open command - /check-setup.es
Alias de nivel superior — el cuerpo completo está en lesson/check-setup.es.md.
Open command - /check-setup
Top-level alias — see lesson/check-setup.md for the full body.
Open command - /check-security.en
Lesson command
Open command - /check-security.es
Lesson command
Open command - /check-security
Lesson command
Open command

