#Dock
Dock អនុញ្ញាតឱ្យអ្នកបន្ថែមវត្ថុបញ្ជា terminal និង browser ទៅរបារចំហៀងស្តាំ។ វត្ថុបញ្ជា terminal ដំណើរការពាក្យបញ្ជាក្នុងផ្នែកដែលគាំទ្រដោយ Ghostty ខណៈដែលវត្ថុបញ្ជា browser បង្កប់ទំព័របណ្ដាញ។ ប្រើវាសម្រាប់ feed, logs, queues, git status, dev servers, dashboards ឬទំព័រយោងដែលក្រុមរបស់អ្នកចង់មាននៅជិត workspace នីមួយៗ។
#ការកំណត់
cmux ស្វែងរកការកំណត់ Dock តាមលំដាប់នេះ៖
.cmux/dock.jsonសម្រាប់ repo បច្ចុប្បន្ន project មេដែលនៅជិតបំផុត និងថត project ដែលនៅខាងក្នុង។~/.config/cmux/dock.jsonសម្រាប់ Dock លំនាំដើមផ្ទាល់ខ្លួនរបស់អ្នក ឬនៅពេលគ្មាន repo។
#ឧទាហរណ៍ dock.json
ឯកសារ Dock គឺជា object JSON ដែលមាន controls array។ Commit project controls ទៅ .cmux/dock.json នៅពេលអ្នកចង់ឱ្យ teammates ចែករំលែក Dock ដូចគ្នា។ ជំនួស command ឧទាហរណ៍ដោយ tools ដែល repo របស់អ្នកពិតជាមាន។
{
"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": "dashboard",
"title": "Dashboard",
"type": "browser",
"url": "http://127.0.0.1:8877/sidebar",
"chrome": false
}
]
}#Fields
| Field | ការពិពណ៌នា |
|---|---|
id | identifier តែមួយគត់និងមានស្ថេរភាពសម្រាប់ control។ រក្សាវាឱ្យខ្លី ហើយកុំប្រើវាឡើងវិញសម្រាប់ពាក្យបញ្ជាផ្សេង។ |
title | Label ដែលបង្ហាញក្នុង Dock header។ |
command | ពាក្យបញ្ជាដែលត្រូវដំណើរការក្នុង terminal របស់ Dock។ វាតម្រូវឱ្យមានសម្រាប់វត្ថុបញ្ជា terminal ហើយចាប់ផ្តើមក្នុង login shell។ |
type | ប្រភេទវត្ថុបញ្ជាជាជម្រើស៖ terminal (លំនាំដើម) ឬ browser។ |
url | ទំព័រដែលត្រូវបើក។ តម្រូវឱ្យមានសម្រាប់វត្ថុបញ្ជាកម្មវិធីរុករក។ |
chrome | ការបង្ហាញផ្ទាំងបញ្ជាកម្មវិធីរុករកជាជម្រើស។ លំនាំដើមគឺ true; false លាក់របារអាសយដ្ឋាន និងរបារឧបករណ៍ ធ្វើឱ្យ Focus Address Bar មិនមានប្រសិទ្ធភាពសម្រាប់ផ្ទាំងនោះ ខណៈដែល cmux browser goto/reload នៅតែអាចប្រើបាន។ |
cwd | ថតការងារជាជម្រើស។ Relative paths ត្រូវបានដោះស្រាយពី project root សម្រាប់ project configs ឬពី home directory សម្រាប់ global configs។ |
height | កម្ពស់វត្ថុបញ្ជាជាជម្រើស។ វត្ថុបញ្ជាដែលគ្មាន height ចែករំលែកទំហំដែលនៅសល់។ |
env | Environment variables ជាជម្រើសដែលបញ្ជូនទៅ control នោះប៉ុណ្ណោះ។ |
#ចែករំលែកជាមួយក្រុម
Dock ត្រូវបានរចនាឡើងសម្រាប់ចែករំលែកតាម source control នៅពេលពាក្យបញ្ជាជាកម្មសិទ្ធិរបស់ repo។
- ដាក់ repo-specific controls ក្នុង .cmux/dock.json ហើយ commit ឯកសារ។
- ដាក់ controls ផ្ទាល់ខ្លួនក្នុង ~/.config/cmux/dock.json ជាពិសេសនៅក្រៅ repo ហើយកុំដាក់ឯកសារនេះក្នុង source control ដែលចែករំលែក។
- កុំដាក់ secrets ក្នុង dock.json។ អាន secrets ពី shell, local env file ឬ dev tooling ដែលមានរួច។
#ស្នើឱ្យ agent កំណត់វា
ប្រើ prompt នេះនៅពេលអ្នកចង់ឱ្យ coding agent បង្កើត Dock controls។ វាប្រាប់ agent ឱ្យរត់ `cmux docs dock`, ពិនិត្យ project និងសួរមុននឹងទស្សន៍ទាយ។
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 and browser control area. A Dock config is JSON with a top-level `controls` array. Terminal controls run commands in Ghostty-backed sections using the user's login shell; browser controls embed URLs. Controls are useful for project dashboards, git/status views, dev server or build status, test watchers, log tails, queues, local services, or fixed web dashboards.
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" }
},
{
"id": "dashboard",
"title": "Dashboard",
"type": "browser",
"url": "http://127.0.0.1:3000",
"chrome": false
}
]
}
Rules:
- Keep ids stable, lowercase, and unique.
- `type` is optional: `terminal` is the default, or use `browser`.
- Terminal controls require `command`; browser controls require `url`.
- Browser controls default to `chrome: true`. Set `chrome: false` to hide browser chrome, including the address bar and toolbar; Focus Address Bar then does nothing for that pane, while `cmux browser goto` and `cmux browser reload` remain available.
- 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.