Dock
Dockでは右サイドバーにTUIコントロールを追加できます。各コントロールはJSONで定義したコマンドで、Ghosttyベースの専用ターミナルセクションとして表示されます。フィード、ログ、キュー、gitステータス、開発サーバーなど、チームが各ワークスペースの横に置きたいTUIに使えます。
設定
cmuxはDock設定を次の順に探します:
.cmux/dock.json現在のリポジトリ、最も近い親プロジェクト、ネストされたプロジェクトディレクトリ用です。~/.config/cmux/dock.json個人用のデフォルトDock、またはリポジトリがない場合用です。
プロジェクト設定とグローバル設定の両方がある場合は、プロジェクト設定が優先されます。ネストされたプロジェクト設定はそのディレクトリツリーに適用されます。プロジェクト設定がない場合、Dockはグローバル設定を使います。どちらのファイルもない場合、Dockは空の状態で開きます。
プロジェクトのDock設定はコマンドを起動できます。cmuxはコントロールを起動する前に、プロジェクト設定を信頼するか確認します。
dock.jsonの例
Dockファイルはcontrols配列を持つJSONオブジェクトです。チームメイトと同じDockを共有したい場合は、プロジェクトのコントロールを.cmux/dock.jsonに入れてコミットしてください。例のコマンドは、実際にそのリポジトリにあるツールに置き換えてください。
.cmux/dock.json
{
"controls": [
{
"id": "git",
"title": "Git",
"command": "lazygit",
"height": 300
},
{
"id": "logs",
"title": "Logs",
"command": "tail -f ./logs/development.log",
"cwd": "."
},
{
"id": "feed",
"title": "Feed",
"command": "cmux feed tui --opentui",
"height": 320
}
]
}フィールド
| フィールド | 説明 |
|---|---|
id | コントロールの安定した一意IDです。短く保ち、別のコマンドに再利用しないでください。 |
title | Dockヘッダーに表示されるラベルです。 |
command | Dockターミナルで実行するコマンドです。ログインシェル内で起動します。 |
cwd | 任意の作業ディレクトリです。相対パスはプロジェクト設定ではプロジェクトルートから、グローバル設定ではホームディレクトリから解決されます。 |
height | 任意のターミナル高さです。heightがないコントロールは残りのスペースを共有します。 |
env | そのコントロールだけに渡す任意の環境変数です。 |
チームで共有する
Dockは、コマンドがリポジトリに属する場合にソース管理で共有できるように設計されています。
- リポジトリ固有のコントロールは.cmux/dock.jsonに入れてコミットします。
- 個人用コントロールは、特にリポジトリ外では ~/.config/cmux/dock.json に置き、このファイルは共有ソース管理に含めないでください。
- dock.jsonにシークレットを入れないでください。シェル、ローカルenvファイル、既存の開発ツールから読み込んでください。
エージェントに設定を依頼する
コーディングエージェントにDockコントロールを作成させたいときは、このプロンプトを使ってください。エージェントに `cmux docs dock` を実行し、プロジェクトを調べ、推測する前に質問するよう指示します。
エージェント用プロンプト
Set up cmux Dock controls for the current context.
First, learn the feature before editing:
1. Run `cmux docs dock` if the cmux CLI is available. If it is not, read https://cmux.com/docs/dock.
2. Inspect the repository or current directory to understand the project type, scripts, package manager, dev servers, logs, task runners, test commands, and any existing TUI tools.
3. If the desired Dock is ambiguous, ask the user what they want monitored or controlled before writing files.
Dock is cmux's right-sidebar terminal control area. A Dock config is JSON with a top-level `controls` array. Each control runs a command in its own Ghostty-backed terminal section using the user's login shell. Controls are useful for project dashboards, git/status views, dev server or build status, test watchers, log tails, queues, local services, or a custom TUI such as `cmux feed tui --opentui` when that feed is useful.
Choose where to write the config:
- In a repository or project directory, create or edit `.cmux/dock.json` so teammates can share it.
- For a personal default outside a repo, create or edit `~/.config/cmux/dock.json`.
- If both exist, project `.cmux/dock.json` is more specific for that project. Nested project configs apply to that directory tree; use the nearest relevant project config instead of writing unrelated controls globally.
- If there is no repo and no clear project root, use the global config only after confirming the user wants a personal Dock.
Schema:
{
"controls": [
{
"id": "short-stable-id",
"title": "Human label",
"command": "safe command to run",
"cwd": "optional/path",
"height": 220,
"env": { "NAME": "value" }
}
]
}
Rules:
- Keep ids stable, lowercase, and unique.
- Use `cwd` for subdirectories; relative paths resolve from the config base.
- Use `height` only when a control needs a fixed amount of vertical space.
- Use `env` only for non-secret values needed by one control.
- Do not put secrets, tokens, or machine-specific private paths in a shared project config.
- Prefer commands that are safe to start repeatedly and make sense in a terminal.
- Do not invent unavailable scripts. Read package files, Makefiles, Procfiles, README docs, config files, and existing tooling first.
- Keep shared project Docks portable for teammates. Put personal or machine-specific controls in the global Dock.
Deliverable:
- Create or update the appropriate dock.json.
- Preserve existing useful controls unless the user asked to replace them.
- Validate that the JSON parses.
- Summarize what each control does and any commands the user should review before trusting the Dock config.