Agents で Tier0 を操作する
Tier0 は、AI agents がプラットフォームを操作するための Skills と CLI コマンドを提供します。
Skills と CLI のインストール
Section titled “Skills と CLI のインストール”環境に合うインストーラーを選択します。
Node.js がある場合
Section titled “Node.js がある場合”Node.js 16 以降が利用できる場合は、npx で CLI と skills をインストールします。
npx -y @tier0/cli@latest installこのコマンドは完全なインストーラーを実行し、次の 2 つを行います。
tier0CLI binary を~/.tier0/bin/にインストールします。- 組み込みの Tier0 Skill baseline をインストールし、Codex、Claude Code など検出された agents に同期します。
Node.js がない場合
Section titled “Node.js がない場合”-
tier0CLI binary をインストールします。Terminal window curl -fsSL https://raw.githubusercontent.com/FREEZONEX/Tier0-cli/main/install.sh | bashTerminal window iwr https://raw.githubusercontent.com/FREEZONEX/Tier0-cli/main/install.ps1 | iex -
最新の Tier0 Skills をダウンロードし、検出された agents に同期します。
Terminal window tier0 skills update -
インストール済み Skill のバージョンと health を確認します。
Terminal window tier0 skills status
Skills の管理
Section titled “Skills の管理”- インストール済み Skill のバージョンと health を確認します。
Terminal window tier0 skills status - 欠落または破損した組み込み Skill baseline を修復します。
Terminal window tier0 skills install - 最新の Tier0 Skill に更新します。
Terminal window tier0 skills update
Skills と CLI の連携
Section titled “Skills と CLI の連携”Tier0 CLI は実行可能なコマンドを提供し、Skills は agents がそれらのコマンドを選択して安全に使うためのガイドを提供します。
- Prompt:
Plant/Line1/Metric/Temperatureの現在温度を確認します。 - Skill
tier0-uns- 現在値は完全な topic path から読み取る必要があることを agent に伝え、適切な UNS read 操作を選択します。
- CLI:
tier0 uns read Plant/Line1/Metric/Temperature --json
Skills
Section titled “Skills”| Skill | 目的 |
|---|---|
tier0 |
Tier0 タスクを適切な skill にルーティングし、共通のセットアップ、認証、安全ルールを提供します。 |
tier0-uns |
Browse、read、write、history、search、create、update、delete、restore などの UNS 操作を agents に案内します。 |
tier0-flow |
SourceFlow と EventFlow の管理を agents に案内します。これには確認、エクスポート、作成、更新、デプロイ、削除が含まれます。 |
tier0-mqtt |
MQTT 認証情報の管理、publish、範囲を限定したリアルタイム subscribe を agents に案内します。 |
tier0-files |
Upload、download、アクセス URL 生成、delete などの Tier0 ファイル操作を agents に案内します。 |
CLI 操作
Section titled “CLI 操作”操作対象インスタンスの設定
Section titled “操作対象インスタンスの設定”プライベートデプロイでは、ログイン前に base URL を設定する必要があります。設定後、以降のすべてのコマンドはそのインスタンスで実行されます。
tier0 config --base-url https://your-tier0.example.comtier0 login # interactive browser login-
操作対象の Tier0 インスタンスから取得した API key を設定します。
Terminal window tier0 config --api-key <api-key> -
API key の identity と permissions を確認します。
Terminal window tier0 auth whoami --json -
tier0CLI で他の操作を実行します。
-
ブラウザー認証リンクを取得します。
Terminal window tier0 login --no-wait --json -
返された
verification_urlにアクセスし、ブラウザーで認証を完了します。 -
返された
setup_codeでログイン結果を確認します。Terminal window tier0 login --setup-code <setup_code>
操作のプレビュー
Section titled “操作のプレビュー”--dry-run を使用すると、対応する書き込み操作を Tier0 に送信せずに検証およびプレビューできます。
- UNS:
write/create/update/delete/restore - Flow:
create/update/delete/deploy - API:
tier0 api - MQTT:
auth create/auth delete/publish - Files:
delete
tier0 uns write --topic demo --value '{"value":1}' --dry-runtier0 flow deploy --id 1 --flows-file flows.json --dry-run --jsontier0 api /openapi/v1/uns/write --body-file body.json --dry-run --jsontier0 mqtt auth create --name my-client --save my-client --dry-run --jsontier0 assets delete --file-path workspace/path/to/file.csv --dry-run --json返されるプレビュー
Section titled “返されるプレビュー”{ "ok": true, "dry_run": true, "data": { "api": [ {"method": "POST", "url": "https://tier0.dev/openapi/v1/uns/write", "body": {}} ] }}--json を使用すると、コマンド失敗時にエラーメッセージとコードを含む JSON object が返されます。
{"ok":false,"error":{"type":"validation","subtype":"invalid_argument","param":"--qos","message":"--qos must be 0, 1, or 2"}}Skills と CLI のアンインストール
Section titled “Skills と CLI のアンインストール”- アンインストールコマンド
# Tier0 CLI を削除し、local configuration と skills は保持します。npx @tier0/cli@latest uninstall
# Tier0 CLI を削除し、local configuration、credentials、cache を削除しますが、skills は保持します。npx @tier0/cli@latest uninstall --purge
# skills を削除しますnpx @tier0/cli@latest uninstall --remove-skills
# 上記すべてを削除しますnpx @tier0/cli@latest uninstall --purge --remove-skills- Global NPM アンインストール
npm uninstall -g @tier0/cli- 手動クリーンアップ
rm -rf ~/.tier0/bin/tier0 ~/.tier0/skillsnpx -y --package=skills -- skills remove tier0 -y -gCLI Reference
Section titled “CLI Reference”Tier0 CLI Reference には、すべての CLI コマンドが一覧化されています。
- 工場データを操作する — MQTT と API で工場データモデルを操作する方法。