Skillpedia
النشر والسحابة (DevOps)394k · #86

tmux

ما الذي تفعله

يرشد وكيل الذكاء الاصطناعي إلى قراءة مخرجات جلسات tmux وإرسال المدخلات إليها، خاصة الأدوات التفاعلية التي تعمل بالفعل. وهي موجهة للمطوّرين الذين يحتفظون بمهام طرفية طويلة الأمد في tmux.

متى تستخدمها

  • ✓عندما تريد أن ترى ما تطبعه أداة طرفية تعمل الآن.
  • ✓عندما تنتظر أداة في جلسة tmux مدخلًا وتحتاج إلى رد.
  • ✓عندما تحتاج إلى بدء جلسة tmux أو إعادة تسميتها أو إغلاقها.

رابط المهارة

https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/openclaw/openclaw/blob/main/skills/tmux/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“تحقّق من جلسة tmux باسم worker، وأخبرني بما تطبعه الآن.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تعرض المهارة الجلسات واللوحات، وتقرأ المخرجات الأخيرة، وترسل نصًا أو مفاتيح عندما تطلب ذلك. وتتأكد من فهم الطلب قبل الموافقة على أي شيء أو اختياره.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

tmux

Use for existing interactive tmux sessions. For one-shot commands, use normal shell. For new non-interactive background jobs, use background execution.

Basics

tmux ls
tmux list-windows -t shared
tmux list-panes -t shared:0
tmux capture-pane -t shared:0.0 -p
tmux capture-pane -t shared:0.0 -p -S -

Target format: session:window.pane, e.g. shared:0.0.

Send input

Literal text, then Enter:

tmux send-keys -t shared:0.0 -l -- "Please continue"
tmux send-keys -t shared:0.0 Enter

Special keys:

tmux send-keys -t shared:0.0 C-c
tmux send-keys -t shared:0.0 C-d
tmux send-keys -t shared:0.0 Escape

Use -l -- for arbitrary text. Split text and Enter to avoid paste/newline surprises.

Sessions

tmux new-session -d -s worker
tmux rename-session -t old new
tmux kill-session -t worker

Prompt checks

tmux capture-pane -t worker-3 -p | tail -20
tmux capture-pane -t worker-3 -p | rg "proceed|permission|Yes|No|❯"

Approve/select only when the prompt is understood:

tmux send-keys -t worker-3 -l -- "y"
tmux send-keys -t worker-3 Enter

Helpers

  • scripts/find-sessions.sh: discover sessions.
  • scripts/wait-for-text.sh: wait until captured pane contents contain text.

wait-for-text.sh searches echoed input and scrollback as well as process output. For command completion, use a unique marker whose full text is split across arguments in the command sent to tmux:

nonce="$(od -An -N8 -tx1 /dev/urandom | tr -d ' \n')"
marker="OPENCLAW_DONE_${nonce}"
tmux send-keys -t shared:0.0 -l -- "sleep 4; printf '%s%s\n' 'OPENCLAW_DONE_' '$nonce'"
tmux send-keys -t shared:0.0 Enter
scripts/wait-for-text.sh -t shared:0.0 -p "$marker" -F -T 30

The echoed command never contains the complete marker, and the nonce prevents an older completion line from matching.

Notes

  • capture-pane -p prints to stdout for scripts.
  • -S - captures full scrollback.
  • tmux sessions persist across SSH disconnects.
الأسئلة الشائعة

هل سترسل أوامر دون سؤال؟

لا توافق على طلب إلا عندما يكون مفهومًا والإجراء واضحًا.

هل tmux مخصص للأوامر المفردة؟

لا. للأوامر المفردة تكون الصدفة العادية أبسط، أما tmux فهو للجلسات التفاعلية القائمة.

هل يمكنها انتظار انتهاء مهمة؟

نعم. يمكن لسكربت مساعد أن ينتظر حتى تُظهر اللوحة نصًا معينًا، مع أن علامة فريدة تعمل بشكل أفضل.

التفاصيل

الوصف الأصلي من المؤلف

Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.

repo: openclaw/openclaw

الشعبية

نجوم GitHub
394k
الترتيب
#86
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة