AIDP(自己完結型プラグイン)の初回セットアップ OCI CLI(Oracleクラウド操作ツール)と DEFAULT という名前の API キープロファイルを検証し、組み込まれた Python の依存パッケージをインストールします。その後、リージョン・データレイク ID・ワークスペースを自動発見し、両方のエンジンに対して動作確認テスト(制御層への GET /catalogs リクエストと、簡単な SELECT 1 クエリ実行)を行います。 **次のような場合に使用:** - 初回実行時 - ユーザーが「セットアップ/設定/インストール/開始」を指示したとき - 制御層または SQL の呼び出しが認証・設定エラーで失敗したとき 注:MCP のインストールは不要です。
First-run setup for the self-contained AIDP plugin. Verifies the oci CLI + a DEFAULT api_key profile, installs the bundled Python deps, discovers region + DataLake OCID + workspace, then smoke-tests both engines (a control-plane GET /catalogs via oci raw-request and a trivial SELECT 1 cell via scripts/aidp_sql.py). Use on first run, when the user asks to "set up / configure / install / bootstrap AIDP", or when control-plane or SQL calls fail with auth/config errors. No MCP install required.
aidp-engineer-bootstrap — 新しいターミナルを動作するAgentに設定する新規ターミナルを動作状態のAIDP Agentへとセットアップします。このPluginは完全に自己完結型です — プライベートリポジトリ ai-data-engineer-agent やMCPサーバーへの依存は一切ありません。
エンジンの優先順位(詳細は references/aidp-cli-map.md を参照):
aidp CLI(公開・Oracle公式サポート:
github.com/oracle-samples/aidataplatform-sdk)。各Skillと1対1でマッピングされるため、可能であればインストールしてください(Step 2b)。oci raw-request を同一のREST APIに対して使用(oci CLIのみで動作;
references/oci-raw-request.md、references/no-mcp-rest-map.md 参照)。CLIと同じエンドポイント・認証方式を使用。python "$PLUGIN_DIR/scripts/aidp_sql.py"(api_key DEFAULTプロファイルからUPSTを生成し、スクラッチノートブックを自動作成してセルを実行 — CLI/SDKではセルの実行ができないため)。oci --version # CLIは存在するか?
oci setup repair-file-permissions --file ~/.oci/config 2>/dev/null
oci iam region list --profile DEFAULT >/dev/null && echo "DEFAULT profile OK" || echo "fix DEFAULT profile"
oci が存在しない場合 → OCI CLIをインストール(pip install oci-cli またはプラットフォームインストーラーを使用)。DEFAULT プロファイルは、api_keyプロファイル(tenancy, user, fingerprint, key_file, region)
または oci session authenticate によるセッショントークンプロファイルのどちらでも可 — どちらのエンジンも完全に同等の機能を持ちます(references/oci-raw-request.md の「Session-token auth」を参照)。
api_keyの場合はWebSocketがUPSTを生成し、sessionプロファイルの場合はセッショントークンが直接再利用されます(api_keyは不要)。oci session authenticate --profile <P> --region <r> を実行し、
コントロールプレーンには --auth security_token --profile <P>、セルには scripts/aidp_sql.py --profile <P>(セッショントークンを自動検出)を使用してください。
--session-profile は明示的なWebSocket専用のオーバーライドとして残してあります。
セッショントークンの有効期限は約1時間です → 更新: oci session refresh --profile <P>。このPluginに含まれるコードは scripts/aidp_sql.py のみです。必要なパッケージ:
oci、requests、websocket-client、cryptography。
まず
$PLUGIN_DIRを解決してください —claude plugin install実行後、Pluginはプロジェクトの作業ディレクトリではなく、Claudeのpluginディレクトリ配下に配置されます。そのためヘルパーは絶対パスで呼び出す必要があります。 以下のいずれかで一度設定してください:export PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT}"(このPluginに対してClaudeがCLAUDE_PLUGIN_ROOTを設定します)、 またはclaude plugin listを実行してインストールパスをコピーし、export PLUGIN_DIR=<そのパス>を設定する。 各SkillのすべてのAidp_sql.pyの使用例では"$PLUGIN_DIR/scripts/aidp_sql.py"を使用しています。 (初回セッション開始時、SessionStartフックにより依存パッケージは自動インストールされます。以下の手動手順はフォールバック用です。)
python -m pip install -r "$PLUGIN_DIR/scripts/requirements.txt"
aidp CLIのインストールサポートされているコントロールプレーンエンジンです。PyPI/npmに公開された後はワンコマンドでインストールできます。それまではGitHubリリースからインストールしてください:
# 公開後(近日予定): python -m pip install aidp-cli # `aidp` コマンドを提供
# 現在はv1.0.0リリースZIPから:
# https://github.com/oracle-samples/aidataplatform-sdk/releases/tag/v1.0.0 から
# aidp-py-cli-1.0.0.zip をダウンロードし、以下を実行:
# python -m pip install ./aidp-py-cli-1.0.0.zip
aidp version && aidp command-groups # CLIがPATHに存在するか確認
venvへのインストールを推奨 — SDKとCLIを oci-cli と同じ環境にインストールすると、pipの依存関係の競合が発生します(cryptography のダウングレードや、click・oci のバージョン固定との衝突が起きます。CLIは動作しますが、venvを使うことで oci-cli と同梱ヘルパーの依存関係をクリーンに保てます)。
動作確認済み: aidp catalog list --instance-id <OCID> --auth api_key で tpcds のカタログが返ることを確認。
aidp がインストールされていない場合でも問題ありません — 各Skillは oci raw-request にフォールバックします(Step 4フォールバック)。
Pluginはどちらでも動作します。CLIはあくまで公式サポートされたバージョン管理済みの方法です。
以下の値を確認し、CLIで使用できるようにします。公式デモの**「Check my AIDP CLI setup」**とは、インスタンスとエンドポイントがシェルコンテキストに設定されていることを確認する作業です:
export AIDP_INSTANCE_ID="<DATALAKE_OCID>"
export AIDP_ENDPOINT="https://aidp.<region>.oci.oraclecloud.com" # または: aidp configure (デフォルトプロファイル+インスタンスを設定)
AIDP_ENDPOINTは必ずaidp.<region>ゲートウェイに設定してください(動作確認済み)。 そうしないとPython SDKのデフォルトであるdatahub-dp.<region>…/20260430/aiDataPlatforms/が使用され、 そのGAホストに対応していないテナンシーでは404エラーが発生します(aidpCLIはすでに動作するゲートウェイをデフォルトとしています)。
AIDP_INSTANCE_ID が設定されていない場合、セットアップ確認はそこで止まります — 設定(とエンドポイント)を行い、再確認してください。
これらの値をコミット済みファイルにハードコードしないでください。
us-ashburn-1(ユーザーに確認してください)。data[].id / data[].key を使用):oci raw-request --http-method GET --profile DEFAULT \
--target-uri "https://aidp.<region>.oci.oraclecloud.com/20240831/dataLakes/<DATALAKE_OCID>/workspaces"
ユーザーがすでにワークスペースのOCIDを知っている場合はそれを直接使用します。
GETが401/403を返した場合は、references/oci-raw-request.md の認証ラダーを実行してください
(oci session refresh --profile AIDP_SESSION の後、--auth security_token --profile AIDP_SESSION でリトライ)。コントロールプレーン — 認証とOCIDの解決を確認します。 推奨(公式CLI):
aidp catalog list --instance-id <DATALAKE_OCID> --auth api_key --profile DEFAULT --region <region>
フォールバック(CLIなし)— oci raw-request:
oci raw-request --http-method GET --profile DEFAULT \
--target-uri "https://aidp.<region>.oci.oraclecloud.com/20240831/dataLakes/<DATALAKE_OCID>/catalogs"
カタログ一覧 / "status": 200 が返れば成功。
(404 → バージョン・プレフィックスが誤り;401/403 → 認証ラダーを実行)
インタラクティブSQL (scripts/aidp_sql.py) — ACTIVEなクラスターを選択
(GET /workspaces/<ws>/clusters)し、簡単なセルを実行:
python "$PLUGIN_DIR/scripts/aidp_sql.py" \
--region <region> --datalake <DATALAKE_OCID> --workspace <ws> --cluster <cluster-key> \
--code "spark.sql('SELECT 1').show()"
"status": "ok" と SELECT 1 の出力を含むJSONが返れば成功。
(ヘルパーはDEFAULTプロファイルからUPSTを生成し、Shared/_aidp_sql_scratch.ipynb を自動作成します。
api_keyパスでトークンを生成できない場合のみ --session-profile AIDP_SESSION を追加してください。)
両エンジンが正常に動作したら → aidp-catalog-init に進んで .aidp/catalog.md を構築します。
その後、ユーザーは作業を開始できます
(ツアーは aidp-engineer-overview、データ分析の質問は aidp-analyzing-data)。
<!-- オプションのアクセラレーター: aidp スタイルのMCPサーバーがたまたま設定されている場合(claude mcp list でConnectedと表示)、
利便性のためにそのツールを使用してもかまいません — ただし必須ではなく、このPluginはその存在を前提としません。
上記のすべては oci CLI と DEFAULT api_keyプロファイルのみで動作します。 -->
aidp-engineer-bootstrap — get a new terminal to a working agentTake a brand-new terminal to a working AIDP agent. The plugin is fully self-contained — no dependency on
the private ai-data-engineer-agent repo or any MCP server. Engine precedence (see references/aidp-cli-map.md):
aidp CLI (public, Oracle-supported:
github.com/oracle-samples/aidataplatform-sdk). Maps 1:1 to the skills; install it if you can (Step 2b).oci raw-request against the same REST API (works with only the oci CLI;
references/oci-raw-request.md, references/no-mcp-rest-map.md). Same endpoint + auth as the CLI.python "$PLUGIN_DIR/scripts/aidp_sql.py" (mints a UPST
from the api_key DEFAULT profile, auto-creates a scratch notebook, runs the cell — the CLI/SDK can't exec cells).oci --version # CLI present?
oci setup repair-file-permissions --file ~/.oci/config 2>/dev/null
oci iam region list --profile DEFAULT >/dev/null && echo "DEFAULT profile OK" || echo "fix DEFAULT profile"
oci is missing → install the OCI CLI (pip install oci-cli or the platform installer).DEFAULT profile can be either an api_key profile (tenancy, user, fingerprint, key_file, region)
or an oci session authenticate session-token profile — both engines have full parity (see
"Session-token auth" in references/oci-raw-request.md). For api_key the WebSocket mints a UPST; for a
session profile the session token is reused directly (no api_key needed anywhere).oci session authenticate --profile <P> --region <r>, then
control-plane via --auth security_token --profile <P>, and scripts/aidp_sql.py --profile <P> for cells
(it auto-detects the session token). --session-profile stays as an explicit WebSocket-only override.
Session tokens expire ~1h → oci session refresh --profile <P>.The only code in this plugin is scripts/aidp_sql.py; it needs oci, requests, websocket-client,
cryptography.
Resolve
$PLUGIN_DIRfirst — afterclaude plugin installthe plugin lives under Claude's plugins dir, not your project cwd, so the helper must be called by absolute path. Set it once:export PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT}"(Claude setsCLAUDE_PLUGIN_ROOTfor this plugin), or runclaude plugin list, copy the install path, andexport PLUGIN_DIR=<that path>. Everyaidp_sql.pyexample in these skills uses"$PLUGIN_DIR/scripts/aidp_sql.py". (On a clean first session the SessionStart hook already auto-installs the deps; the manual step below is only a fallback.)
python -m pip install -r "$PLUGIN_DIR/scripts/requirements.txt"
aidp CLIThe supported control-plane engine. Once it's on PyPI/npm this is one command; until then install from the GitHub release:
# When published (coming soon): python -m pip install aidp-cli # provides the `aidp` command
# Today, from the v1.0.0 release zip:
# download aidp-py-cli-1.0.0.zip from
# https://github.com/oracle-samples/aidataplatform-sdk/releases/tag/v1.0.0 then:
# python -m pip install ./aidp-py-cli-1.0.0.zip
aidp version && aidp command-groups # verify the CLI is on PATH
Install in a venv — installing the SDK/CLI alongside oci-cli triggers pip dependency conflicts
(it downgrades cryptography and clashes click/oci pins; the CLI still runs, but a venv keeps oci-cli
and the bundled helper's deps clean). Verified live: aidp catalog list --instance-id <OCID> --auth api_key
returns the catalogs on tpcds.
If aidp isn't installed, that's fine — every skill falls back to oci raw-request (Step 4 fallback). The
plugin works either way; the CLI is just the supported, versioned path.
Resolve these values and make them available to the CLI. The official demo's "Check my AIDP CLI setup" = confirming the instance + endpoint are set in the shell context:
export AIDP_INSTANCE_ID="<DATALAKE_OCID>"
export AIDP_ENDPOINT="https://aidp.<region>.oci.oraclecloud.com" # or: aidp configure (sets default profile + instance)
Always set
AIDP_ENDPOINTto theaidp.<region>gateway (LIVE-VERIFIED). The Python SDK otherwise defaults todatahub-dp.<region>…/20260430/aiDataPlatforms/, which 404s on tenancies not on that GA host (theaidpCLI already defaults to the working gateway). IfAIDP_INSTANCE_IDis missing, the setup check stops there — set it (and the endpoint), then re-check. Never hardcode these into committed files.
us-ashburn-1 (confirm with the user).data[].id / data[].key of the desired workspace):oci raw-request --http-method GET --profile DEFAULT \
--target-uri "https://aidp.<region>.oci.oraclecloud.com/20240831/dataLakes/<DATALAKE_OCID>/workspaces"
If the user already knows the workspace OCID, use it directly. If the GET returns 401/403, run the auth
ladder in references/oci-raw-request.md (oci session refresh --profile AIDP_SESSION, then retry with
--auth security_token --profile AIDP_SESSION).aidp catalog list --instance-id <DATALAKE_OCID> --auth api_key --profile DEFAULT --region <region>
Fallback (no CLI installed) — oci raw-request:oci raw-request --http-method GET --profile DEFAULT \
--target-uri "https://aidp.<region>.oci.oraclecloud.com/20240831/dataLakes/<DATALAKE_OCID>/catalogs"
Expect the catalog list / "status": 200. (404 → wrong version/prefix; 401/403 → auth ladder.)scripts/aidp_sql.py) — pick an ACTIVE cluster
(GET /workspaces/<ws>/clusters), then run a trivial cell:python "$PLUGIN_DIR/scripts/aidp_sql.py" \
--region <region> --datalake <DATALAKE_OCID> --workspace <ws> --cluster <cluster-key> \
--code "spark.sql('SELECT 1').show()"
Expect JSON with "status": "ok" and the SELECT 1 output. (The helper mints a UPST from the DEFAULT
profile and auto-creates Shared/_aidp_sql_scratch.ipynb; add --session-profile AIDP_SESSION only if
the api_key path can't mint a token.)Both engines green → hand off to aidp-catalog-init to build .aidp/catalog.md, then the user is ready
(aidp-engineer-overview for the tour, aidp-analyzing-data to ask questions).
<!-- Optional accelerator: if an aidp-style MCP server happens to be configured (claude mcp list shows
it Connected), you MAY use its tools as a convenience — but it is NOT required and the plugin never assumes
it. Everything above works with only the oci CLI + a DEFAULT api_key profile. -->
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。