Skip to main content

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 โดยไม่ต้องอธิบายซ้ำ
/keymapRemap keyboard shortcutsดูและบันทึก binding ที่กำหนดเอง
/vimToggle Vim modeสลับระหว่าง Vim และ default editing
/sandbox-add-read-dirให้สิทธิ์ sandbox อ่านไดเรกทอรีUnblock คำสั่งที่ต้องการ directory access (Windows)
/agentสลับ active agent threadดูหรือต่อ subagent ที่ทำงานอยู่
/appsBrowse และแทรก appsแนบ connector เป็น reference แบบ $app-slug
/pluginsจัดการ plugins ที่ติดตั้งติดตั้ง, ดู, หรือ toggle plugin
/hooksดู lifecycle hooksดู, trust, หรือปิด hooks ที่ตั้งค่าไว้
/clearReset การสนทนาเริ่มแชทใหม่ใน CLI session เดิม
/archiveArchive และออกลบ session จาก active list แต่เก็บ transcript
/compactสรุปการสนทนาประหยัด token หลังจากแชทยาว
/copyCopy response ล่าสุดคัดลอก output ที่เสร็จโดยไม่ต้อง select เอง
/diffแสดง Git changesดูการแก้ไขก่อน commit
/experimentalToggle optional featuresเปิดฟีเจอร์เช่น subagents
/approveRetry action ที่ถูกปฏิเสธส่ง command ที่ถูก deny ซ้ำอีกครั้ง
/memoriesตั้งค่าการใช้ memoryToggle memory injection หรือ generation
/skillsBrowse และใช้ skillsเลือก task-specific behavior improvement
/modelเลือก model ที่ใช้งานสลับระหว่าง general และ reasoning model
/fastToggle Fast service tierเปิด/ปิด Fast mode ใน thread ปัจจุบัน
/planเข้าสู่ plan modeขอ execution plan ก่อน implement
/goalกำหนดเป้าหมายงานติดตาม target ระหว่างทำงาน
/personalityเลือก communication styleปรับ tone โดยไม่ต้องเขียน prompt ใหม่
/psตรวจสอบ background terminalsMonitor คำสั่งที่ run นาน
/stopยกเลิก background workหยุด background terminal ทั้งหมด
/forkแตก conversationสำรวจทางเลือกโดยไม่เสียประวัติ
/side / /btwเริ่ม side conversationถามคำถามเฉพาะโดยไม่ขัด main thread
/rawToggle 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 layersDebug ลำดับความสำคัญและ 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
/logoutSign 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