#Dock
يتيح لك Dock إضافة عناصر تحكم طرفية ومتصفح إلى الشريط الجانبي الأيمن. تشغّل عناصر تحكم الطرفية الأوامر في أقسام مدعومة من Ghostty، بينما تضمّن عناصر تحكم المتصفح صفحات الويب. استخدمه للخلاصات أو السجلات أو الطوابير أو حالة git أو خوادم التطوير أو لوحات المعلومات أو الصفحات المرجعية التي يريد فريقك إبقاءها بجانب كل مساحة عمل.
#الإعداد
يبحث cmux عن إعداد Dock بهذا الترتيب:
.cmux/dock.jsonللمستودع الحالي وأقرب مشروع أب ومجلدات المشاريع المتداخلة.~/.config/cmux/dock.jsonلـ Dock الشخصي الافتراضي أو عندما لا يوجد مستودع.
#مثال dock.json
ملف Dock هو كائن JSON يحتوي على مصفوفة controls. ثبّت عناصر تحكم المشروع في .cmux/dock.json عندما تريد أن يشارك أعضاء الفريق Dock نفسه. استبدل أوامر المثال بأدوات موجودة فعليًا في المستودع.
{
"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
}
]
}#الحقول
| الحقل | الوصف |
|---|---|
id | معرف ثابت وفريد لعنصر التحكم. اجعله قصيرا ولا تعيد استخدامه لأمر آخر. |
title | التسمية المعروضة في رأس Dock. |
command | الأمر المطلوب تشغيله في طرفية Dock. مطلوب لعناصر تحكم الطرفية ويبدأ داخل صدفة تسجيل الدخول. |
type | نوع عنصر التحكم اختياري: terminal (الافتراضي) أو browser. |
url | الصفحة المطلوب فتحها. مطلوبة لعناصر تحكم المتصفح. |
chrome | إعداد اختياري لإظهار واجهة المتصفح. القيمة الافتراضية true؛ عند ضبطه على false يُخفي شريط العنوان وشريط الأدوات، ويجعل «التركيز على شريط العنوان» بلا تأثير في تلك اللوحة، مع بقاء cmux browser goto/reload متاحين. |
cwd | مجلد العمل الاختياري. المسارات النسبية تحل من جذر المشروع في إعدادات المشروع، أو من مجلد المنزل في الإعدادات العامة. |
height | ارتفاع اختياري لعنصر التحكم. تتشارك العناصر التي لا تحدد height المساحة المتبقية. |
env | متغيرات بيئة اختيارية تمرر إلى عنصر التحكم هذا فقط. |
#المشاركة مع الفريق
صمم Dock ليشارك عبر التحكم بالمصدر عندما تكون الأوامر تابعة للمستودع.
- ضع عناصر التحكم الخاصة بالمستودع في .cmux/dock.json واحفظ الملف في git.
- ضع عناصر التحكم الشخصية في ~/.config/cmux/dock.json، خصوصًا خارج المستودع، وأبق هذا الملف خارج إدارة المصدر المشتركة.
- لا تضع أسرارا في dock.json. اقرأ الأسرار من shell أو ملف env محلي أو أدوات التطوير الموجودة لديك.
#اطلب من وكيل إعداده
استخدم هذا الموجه عندما تريد من coding agent إنشاء عناصر تحكم 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 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.