> ## Documentation Index
> Fetch the complete documentation index at: https://docs2.openclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TUI

# `openclaw tui`

Gateway に接続されたターミナル UI を開くか、ローカル組み込み
モードで実行します。

関連ガイド: [TUI](/ja-JP/web/tui)

## オプション

| フラグ                   | デフォルト                            | 説明                                                     |
| --------------------- | -------------------------------- | ------------------------------------------------------ |
| `--local`             | `false`                          | Gateway の代わりにローカル組み込みエージェントランタイムに対して実行します。             |
| `--url <url>`         | 設定の `gateway.remote.url`         | Gateway WebSocket URL。                                 |
| `--token <token>`     | (なし)                             | 必要な場合の Gateway トークン。                                   |
| `--password <pass>`   | (なし)                             | 必要な場合の Gateway パスワード。                                  |
| `--session <key>`     | `main` (スコープがグローバルの場合は `global`) | セッションキー。エージェントワークスペース内では、プレフィックスがない限りそのエージェントを自動選択します。 |
| `--deliver`           | `false`                          | 設定済みチャンネル経由でアシスタントの返信を配信します。                           |
| `--thinking <level>`  | (モデルのデフォルト)                      | Thinking レベルの上書き。                                      |
| `--message <text>`    | (なし)                             | 接続後に初期メッセージを送信します。                                     |
| `--timeout-ms <ms>`   | `agents.defaults.timeoutSeconds` | エージェントのタイムアウト。無効な値は警告をログに記録して無視されます。                   |
| `--history-limit <n>` | `200`                            | アタッチ時に読み込む履歴エントリ数。                                     |

エイリアス: `openclaw chat` と `openclaw terminal` は、このコマンドを
`--local` が暗黙指定された状態で呼び出します。

## 注意事項

* `--local` は `--url`、`--token`、`--password` と組み合わせられません。
* `tui` は、可能な場合にトークン/パスワード認証用の設定済み Gateway 認証 SecretRefs を解決します
  (`env`/`file`/`exec` プロバイダー)。
* 明示的な URL またはポートがない場合、`tui` は実行中の Gateway によって記録されたアクティブなローカル Gateway ポートに従います。
  明示的な `--url`、`OPENCLAW_GATEWAY_URL`、
  `OPENCLAW_GATEWAY_PORT`、リモート Gateway 設定が優先されます。
* 設定済みエージェントワークスペースディレクトリ内から起動すると、TUI はセッションキーのデフォルトとして
  そのエージェントを自動選択します (`--session` が明示的に
  `agent:<id>:...` でない限り)。
* 非ローカル URL ベースの接続でフッターに Gateway ホスト名を表示するには、
  `openclaw config set tui.footer.showRemoteHost true` を実行します。デフォルトではオフです。
  ループバックまたは組み込みローカル接続では表示されません。
* ローカルモードは組み込みエージェントランタイムを直接使用します。ほとんどのローカルツールは動作しますが、
  Gateway 専用機能は利用できません。
* ローカルモードでは、TUI コマンドサーフェスに `/auth [provider]` が追加されます。
* Plugin 承認ゲートはローカルモードでも適用されます。承認が必要なツールは
  ターミナルで判断を求め、暗黙に自動承認されることはありません。
* セッションの [目標](/ja-JP/tools/goal) はフッターに表示され、
  `/goal` で管理できます。

## 例

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw chat
openclaw tui --local
openclaw tui
openclaw tui --url ws://127.0.0.1:18789 --token <token>
openclaw tui --session main --deliver
openclaw chat --message "Compare my config to the docs and tell me what to fix"
# when run inside an agent workspace, infers that agent automatically
openclaw tui --session bugfix
```

## 設定修復ループ

ローカルモードを使用すると、組み込みエージェントに現在の設定を検査させ、
ドキュメントと比較し、同じターミナルから修復を支援させることができます。

`openclaw config validate` がすでに失敗している場合は、まず `openclaw configure` または
`openclaw doctor --fix` を実行してください。`openclaw chat` は
無効な設定のガードを回避しません。

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw chat
```

その後、TUI 内で次を実行します。

```text theme={"theme":{"light":"min-light","dark":"min-dark"}}
!openclaw config file
!openclaw docs gateway auth token secretref
!openclaw config validate
!openclaw doctor
```

`openclaw config set` または `openclaw configure` で対象を絞った修正を適用し、
その後 `openclaw config validate` を再実行します。[TUI](/ja-JP/web/tui) と
[設定](/ja-JP/cli/config) を参照してください。

## 関連

* [CLI リファレンス](/ja-JP/cli)
* [TUI](/ja-JP/web/tui)
* [目標](/ja-JP/tools/goal)
