Slash Commands ใน Codex CLI
Slash commands ให้การควบคุมด้วยแป้นพิมพ์ระหว่าง interactive session พิมพ์ / ใน composer เพื่อเปิด slash popup แล้วเลือกคำสั่งเพื่อทำงานต่างๆ เช่น เปลี่ยน model, ปรับ permissions, หรือสรุปการสนทนา
Built-in Slash Commands
| คำสั่ง | จุดประสงค์ | Use Case |
|---|---|---|
/permissions | กำหนด approval requirements | ปรับ approval policy กลาง session |
/ide | รวม IDE context | ดึง editor context โดยไม่ต้องอธิบายซ้ำ |
/keymap | Remap keyboard shortcuts | ดูและบันทึก binding ที่กำหนดเอง |
/vim | Toggle Vim mode | สลับระหว่าง Vim และ default editing |
/sandbox-add-read-dir | ให้สิทธิ์ sandbox อ่านไดเรกทอรี | Unblock คำสั่งที่ต้องการ directory access (Windows) |
/agent | สลับ active agent thread | ดูหรือต่อ subagent ที่ทำงานอยู่ |
/apps | Browse และแทรก apps | แนบ connector เป็น reference แบบ $app-slug |
/plugins | จัดการ plugins ที่ติดตั้ง | ติดตั้ง, ดู, หรือ toggle plugin |
/hooks | ดู lifecycle hooks | ดู, trust, หรือปิด hooks ที่ตั้งค่าไว้ |
/clear | Reset การสนทนา | เริ่มแชทใหม่ใน CLI session เดิม |
/archive | Archive และออก | ลบ session จาก active list แต่เก็บ transcript |
/compact | สรุปการสนทนา | ประหยัด token หลังจากแชทยาว |
/copy | Copy response ล่าสุด | คัดลอก output ที่เสร็จโดยไม่ต้อง select เอง |
/diff | แสดง Git changes | ดูการแก้ไขก่อน commit |
/experimental | Toggle optional features | เปิดฟีเจอร์เช่น subagents |
/approve | Retry action ที่ถูกปฏิเสธ | ส่ง command ที่ถูก deny ซ้ำอีกครั้ง |
/memories | ตั้งค่าการใช้ memory | Toggle memory injection หรือ generation |
/skills | Browse และใช้ skills | เลือก task-specific behavior improvement |
/model | เลือก model ที่ใช้งาน | สลับระหว่าง general และ reasoning model |
/fast | Toggle Fast service tier | เปิด/ปิด Fast mode ใน thread ปัจจุบัน |
/plan | เข้าสู่ plan mode | ขอ execution plan ก่อน implement |
/goal | กำหนดเป้าหมายงาน | ติดตาม target ระหว่างทำงาน |
/personality | เลือก communication style | ปรับ tone โดยไม่ต้องเขียน prompt ใหม่ |
/ps | ตรวจสอบ background terminals | Monitor คำสั่งที่ run นาน |
/stop | ยกเลิก background work | หยุด background terminal ทั้งหมด |
/fork | แตก conversation | สำรวจทางเลือกโดยไม่เสียประวัติ |
/side / /btw | เริ่ม side conversation | ถามคำถามเฉพาะโดยไม่ขัด main thread |
/raw | Toggle raw scrollback | ทำให้ select และ copy บน terminal ง่ายขึ้น |
/resume | ต่อการสนทนาที่บันทึกไว้ | ทำงานต่อจากที่ค้างไว้ |
/new | เริ่มการสนทนาใหม่ | Reset chat context ใน session เดิม |
/quit / /exit | ออกจาก CLI | ปิดทันที |
/review | วิเคราะห์ working tree | รับความเห็นที่สองเกี่ยวกับการเปลี่ยนแปลงในเครื่อง |
/status | แสดงข้อมูล session | ยืนยัน model, policy, และ context capacity |
/debug-config | ดู configuration layers | Debug ลำดับความสำคัญและ policy ของ settings |
/statusline | ตั้งค่า footer items | เลือกและเรียงลำดับ footer display |
/title | ตั้งค่า window title | กำหนด terminal title |
/theme | เลือก syntax theme | ดูตัวอย่างและบันทึก highlighting theme |
/mcp | แสดง MCP tools | ยืนยัน external tools ที่พร้อมใช้งาน |
/mention | แนบไฟล์ | โฟกัสไปยังไฟล์หรือโฟลเดอร์เฉพาะ |
/init | สร้าง AGENTS.md | บันทึกคำสั่งของ repository |
/feedback | ส่ง diagnostics | รายงานปัญหาให้ทีม maintainers |
/logout | Sign out | ล้าง credentials บนเครื่องที่แชร์ |
Workflow ที่ใช้บ่อย
การเลือก Model
พิมพ์ /model แล้วเลือกจาก options ที่มี เช่น gpt-4.1-mini หรือ gpt-4.1
การจัดการ Permissions
ใช้ /permissions เพื่อสลับระหว่าง approval mode เช่น Auto หรือ Read Only โดยไม่ต้องเริ่ม session ใหม่
Communication Style
ใช้ /personality เพื่อเปลี่ยน tone ของ response (friendly, pragmatic, หรือ none) กลางการสนทนา
Task Tracking
กำหนดเป้าหมายด้วย /goal <objective> เพื่อรักษา focus ระหว่างทำงานยาว
Context Management
รัน /compact หลังจากแชทยาวเพื่อสรุปการสนทนาและประหยัด token
File Focus
ใช้ /mention <path> เพื่อให้ response ต่อไปอ้างอิงไฟล์เฉพาะโดยตรง
Branching
/fork สร้าง thread คู่ขนานเพื่อสำรวจทางเลือก ส่วน /side เปิด detour สั้นๆ โดยไม่ออกจาก main task