Kawe Agent CLI

AI coding agent ที่ทำงานใน terminal — binary เดียว ไม่ต้องติดตั้งอะไรเพิ่ม เริ่มใช้ได้ทันที AI coding agent in your terminal — single binary, zero dependencies, instant startup

ติดตั้งInstallation

Windows

วิธีที่ 1: PowerShell (แนะนำ)Method 1: PowerShell (recommended)

irm https://get.kaweai.com/install.ps1 | iex

วิธีที่ 2: ผ่าน WSL (ใช้ bash tool ได้เต็ม)Method 2: WSL (full bash support)

wsl --install

จากนั้นเปิด WSL (Ubuntu):Then open WSL (Ubuntu):

curl -fsSL https://get.kaweai.com/install.sh | sh
💡 ทั้ง Native และ WSL สามารถอ่าน/เขียนไฟล์ใน Windows drives ได้ เช่น E:\Project\MyApp 💡 Both Native and WSL can read/write files on Windows drives, e.g. E:\Project\MyApp
⚠️ Native Windows: การรันคำสั่ง shell (bash tool) ต้องมี Git Bash หรือ sh.exe ใน PATH — แนะนำใช้ WSL สำหรับ full functionality ⚠️ Native Windows: shell commands (bash tool) require Git Bash or sh.exe in PATH — WSL recommended for full functionality
macOS
curl -fsSL https://get.kaweai.com/install.sh | sh
Linux
curl -fsSL https://get.kaweai.com/install.sh | sh

ตรวจสอบว่าติดตั้งสำเร็จ:Verify installation:

kawe --version

เริ่มต้นใช้งานGetting Started

1. Login
kawe auth login
  • Browser จะเปิดอัตโนมัติ → login ด้วยบัญชีของคุณBrowser opens automatically → login with your account
  • ถ้า browser ไม่เปิด (เช่น SSH): copy URL จาก terminal ไปเปิดเองIf browser doesn't open (e.g. SSH): copy URL from terminal
  • รอจน terminal แสดง "Login successful"Wait for "Login successful" in terminal
2. เริ่ม Chat2. Start Chat
cd your-project
kawe chat

เข้า directory ของโปรเจคก่อน → Kawe จะรู้จัก project ของคุณอัตโนมัติ (อ่าน package.json, go.mod, etc.)Enter your project directory first → Kawe auto-detects your project (reads package.json, go.mod, etc.)

3. สั่งงาน3. Give Commands
พิมพ์TypeAI จะทำAI Will
อ่าน codebase นี้แล้วสรุปให้หน่อยสแกนโปรเจค → อ่านไฟล์สำคัญ → สรุปโครงสร้างScan project → read key files → summarize
สร้าง README.md ให้วิเคราะห์ project → เขียน README → สร้างไฟล์Analyze → write → create file
หา bug ใน main.go แล้วแก้อ่านไฟล์ → วิเคราะห์ → แก้ → verify ด้วย testRead → analyze → fix → verify
เขียน unit test ให้ function Loginอ่าน function → เขียน test → run testRead → write test → run
สร้าง presentation สรุปโปรเจค 5 slidesสแกนโปรเจค → สร้าง .pptxScan → create .pptx
4. Slash Commands ที่ใช้บ่อย4. Common Slash Commands
/helpแสดงคำสั่งทั้งหมดShow all commands
/modelเปลี่ยน AI modelChange AI model
/usageดู credits ที่ใช้ไปCheck credits used
/compactบีบอัด context (ลด cost)Compress context (reduce cost)
/undoย้อนไฟล์กลับก่อนแก้Revert file to before edit
/diffดูไฟล์ที่ AI แก้ไขไปView files AI changed

วิธีใช้งานUsage Modes

แบบสนทนา (Interactive)Interactive
kawe chat

พิมพ์ข้อความ → AI ตอบ → พิมพ์ต่อ → วนไปจนกว่าจะพิมพ์ /quit หรือ Ctrl+CType → AI responds → continue until /quit or Ctrl+C

แบบสั่งครั้งเดียว (One-shot)One-shot
kawe chat -p "แก้ typo ใน README.md" --auto-approve

สั่งงานทีเดียว ไม่ต้องโต้ตอบ — เหมาะสำหรับ CI/CD หรือ automationRun once, no interaction — great for CI/CD

kawe chat -p "สวัสดี" --json

ผลลัพธ์เป็น JSON — เหมาะกับ scriptingJSON output — great for scripting

CLI Flags
-p, --prompt "..."สั่งงานครั้งเดียว (non-interactive) เช่น kawe chat -p "fix the bug"One-shot mode (non-interactive) e.g. kawe chat -p "fix the bug"
--model <name>ระบุ model ที่จะใช้ (override default)Specify model to use (override default)
--auto-approveไม่ถาม confirm ทุก operationSkip all confirmations
--resumeต่อจาก session ล่าสุดContinue last session
--path <dir>ระบุ project directorySpecify project directory
--jsonผลลัพธ์เป็น JSONJSON output
--output <file>เขียน output ลงไฟล์Write output to file
Pipe
cat error.log | kawe chat -p "อธิบาย error นี้"
เปลี่ยน RoleChange Role

ใช้คำสั่ง /agent ระหว่าง chat:Use /agent command during chat:

/agent qa         → ให้ AI เป็น QA — หา bugs, เขียน tests
/agent architect  → ให้ AI เป็น Architect — ออกแบบระบบ
/agent writer     → ให้ AI เป็น Technical Writer — เขียน docs
/agent dev        → ให้ AI เป็น Developer — เขียนโค้ด

ตัวอย่างการใช้งานUsage Examples

สถานการณ์ScenarioPromptAI ทำอะไรAI Does
แก้ BugFix Bugมี bug ใน login — user login ไม่ได้ ช่วยหาให้อ่านโค้ด → หาสาเหตุ → แก้ → testRead → find cause → fix → test
สร้าง FeatureAdd Featureเพิ่ม dark mode ใน settings pageอ่านโค้ดเดิม → เขียนเพิ่ม → testRead existing → implement → test
Review/agent reviewer แล้ว review โค้ดนี้ให้ตรวจ quality, security, performanceCheck quality, security, perf
สร้างเอกสารDocsสร้าง API documentation จาก source codeอ่าน endpoints → เขียน docsRead endpoints → write docs
Researchหาข้อมูลเรื่อง OAuth 2.0 แล้วสรุปให้ค้นหา web → สรุป → แสดงผลSearch → summarize → display

Auto-approve

ให้ AI ทำงานโดยไม่ต้องถาม confirm ทุกขั้นตอน:Let AI work without asking for confirmation:

# ผ่าน flag
kawe chat -p "run tests and fix failures" --auto-approve

# หรือพิมพ์ระหว่าง chat
/trust-all
⚠️ auto-approve ให้ AI ทำทุกอย่างโดยไม่ถาม — ใช้เมื่อมั่นใจเท่านั้น ⚠️ auto-approve lets AI do everything without asking — use only when confident

File Lock — ป้องกันไฟล์สำคัญFile Lock — Protect Important Files

กำหนดไฟล์ที่ AI จะไม่แตะ ใน .kawerc:Define files AI won't touch in .kawerc:

{
  "lockedFiles": ["config.prod.yml", ".env*", "*.key", "docker-compose.prod.yml"]
}

AI จะปฏิเสธการแก้ไขไฟล์ที่ตรง pattern เหล่านี้AI will refuse to edit files matching these patterns

Session & Undo

  • Auto-saveทุก turn บันทึกอัตโนมัติEvery turn saved automatically
  • Resumeใช้ kawe chat --resume เพื่อต่อจาก session ล่าสุดของ project นั้นUse kawe chat --resume to continue last session for that project
  • Undo/undo ย้อนไฟล์กลับก่อนที่ AI แก้revert file to before AI edit
  • Rewind/rewind ย้อนกลับทั้ง session ไปจุดก่อนหน้าrewind entire session to earlier point

Keyboard Shortcuts

Enterส่งข้อความSend message
Ctrl+Cระหว่าง stream: หยุด response / มีข้อความ: ล้างบรรทัด / ว่าง: ถามก่อนออกDuring stream: stop / has text: clear line / empty: ask to quit
Ctrl+Dออก (เมื่อบรรทัดว่าง)Exit (when line empty)
Ctrl+J / Alt+Enterขึ้นบรรทัดใหม่ (multi-line input)New line (multi-line input)
Ctrl+Wลบคำก่อนหน้าDelete previous word
Ctrl+Uล้างทั้งบรรทัดClear entire line
Ctrl+LClear screen
/ เลื่อนดู history / เลือก autocompleteNavigate history / autocomplete
Tabเลือก autocomplete suggestionSelect autocomplete
Escปิด autocompleteClose autocomplete
Esc×2เปิดเมนู RewindOpen Rewind menu

ตั้งค่าConfiguration

Kawe ใช้ 2 อย่างที่ชื่อคล้ายกัน:Kawe uses 2 similar-named things:

  • .kawercตั้งค่า ตัวโปรแกรม (timeout, theme, sandbox, ไฟล์ที่ห้ามแก้)Configure the program (timeout, theme, sandbox, locked files)
  • .kawe/ตั้งค่า ตัว AI (กฎ, บทบาท, คำสั่งพิเศษ, skills)Configure the AI (rules, roles, commands, skills)
.kawercตั้งค่าตัวโปรแกรมProgram Settings

ไฟล์ JSON ที่บอกโปรแกรม Kawe ว่าทำงานยังไง (AI ไม่ได้อ่านไฟล์นี้)JSON file that tells the Kawe program how to behave (AI doesn't read this)

💡 ไม่จำเป็นต้องสร้าง — ถ้าไม่มีไฟล์นี้ โปรแกรมใช้ค่า default ทั้งหมด ทำงานได้ปกติ 💡 Optional — if this file doesn't exist, the program uses all defaults and works fine

ชื่อไฟล์: เลือกอย่างใดอย่างหนึ่ง (เนื้อหาเหมือนกัน):File name: pick either (same content):

  • .kawercไม่มีนามสกุล (เหมือน .eslintrc)no extension (like .eslintrc)
  • .kawerc.jsonมีนามสกุล (editor จะ highlight syntax ให้)with extension (editor syntax highlighting)
ที่Locationใช้เมื่อUse Forตัวอย่างExample
~/.kawerc (home)ตั้งค่าส่วนตัว ใช้ทุกโปรเจคPersonal, all projectstheme, timeout
<project>/.kawerc (project root)ตั้งค่าเฉพาะโปรเจคนี้Per-projectlockedFiles, sandbox, autoSnapshot

ลำดับการอ่าน: default → ~/.kawerc<project>/.kawerc (ค่าหลังทับค่าก่อน)Load order: default → ~/.kawerc<project>/.kawerc (later overrides earlier)

ตัวอย่าง Global (~/.kawerc):Global example (~/.kawerc):

{
  "theme": "dark",
  "timeout": 180000
}

ตัวอย่าง Project (my-project/.kawerc):Project example:

{
  "sandbox": { "enabled": true },
  "lockedFiles": ["*.env", "config.prod.*", "docker-compose.prod.yml"]
}
OptionDefault (ไม่ตั้งก็ใช้ค่านี้)Defaultควรอยู่LevelคำอธิบายDescription
timeout120000 (2 นาทีmin)GlobalTimeout สำหรับ API (มิลลิวินาที)API timeout (ms)
theme"auto"Globalธีมสี: "dark", "light", "auto" (ตรวจจาก terminal) — หมายเหตุ: auto ใช้ COLORFGBG env var ซึ่งไม่ทุก terminal ส่งมา ถ้าสีผิดให้ตั้งเป็น dark/light ตรงๆColor theme: "dark", "light", "auto" (detects from terminal) — Note: auto uses COLORFGBG env var which not all terminals provide; set dark/light explicitly if colors look wrong
autoSnapshottrueProjectบันทึก checkpoint อัตโนมัติทุก turn (ใช้กับ /rewind)Auto-save checkpoint every turn (for /rewind)
lockedFiles[] (ไม่ล็อค)ProjectGlob patterns ของไฟล์ที่ AI ห้ามแตะFiles AI won't touch
sandbox.enabledfalseProjectรัน bash tool ใน Docker sandboxRun bash in Docker sandbox
sandbox.imagedefault imageProjectDocker image ที่ใช้รัน sandboxDocker image for sandbox
sandbox.allowNetworkfalseProjectเปิด network ใน sandbox (ปิดโดย default)Enable network in sandbox (off by default)

💡 Project config จะ override global (ยกเว้น API URL ที่ project เปลี่ยนไม่ได้)💡 Project overrides global (except API URL)

.kawe/ตั้งค่าตัว AIAI Settings

โฟลเดอร์ที่บอก AI ว่าควรทำตัวยังไง (โปรแกรมอ่านแล้ว inject เข้าไปให้ AI)Folder that tells AI how to behave (program reads and injects for AI)

my-project/.kawe/
├── steering/    ← กฎที่ AI ต้องปฏิบัติตามเสมอRules AI must always follow
├── commands/    ← คำสั่ง slash ที่คุณสร้างเองCustom slash commands
├── roles/       ← บทบาท AI ที่คุณสร้างเองCustom AI roles
├── skills/      ← skills ที่ติดตั้งInstalled skills
└── hooks.json   ← script ที่รันก่อน/หลัง AI ใช้ toolScripts run before/after tool use
Steering — กฎสำหรับ AIRules for AI
# .kawe/steering/rules.md
- ตอบภาษาไทยเสมอ
- ใช้ Go idioms ห้ามใช้ panic
- เขียน test ทุกครั้งที่สร้าง function ใหม่
Custom Commands
# .kawe/commands/deploy.md
Deploy โปรเจคนี้:
1. รัน tests ก่อน
2. Build production
3. Push ไป registry

ใช้งาน: พิมพ์ /deploy ระหว่าง chatUsage: type /deploy during chat

Skills
# ติดตั้ง skill จาก GitHub
/skill add github.com/user/my-skill --skill my-skill

# เปิดใช้ / ดูรายการ / ลบ
/skill enable <name>
/skill                 # list skills ที่ติดตั้ง
/skill remove <name>

# หรือวางเอง
mkdir -p .kawe/skills
echo "..." > .kawe/skills/my-skill.md

AI จะใช้ skill อัตโนมัติเมื่อบริบทตรงกันAI uses skills automatically when context matches

# .kawe/roles/devops.md
## Role: DevOps Engineer
คุณคือ DevOps engineer เชี่ยวชาญ Docker, Kubernetes, CI/CD

ใช้งาน: /agent devopsUsage: /agent devops

Hooks
// .kawe/hooks.json
[{"event": "PostToolUse", "matcher": "fs_write", "command": "npm run lint --fix"}]

ทุกครั้งที่ AI แก้ไขไฟล์ (fs_write) → lint จะรันอัตโนมัติEvery time AI edits a file (fs_write) → lint runs automatically

  • matcherชื่อ tool ที่จะ trigger (คั่นด้วย comma ได้ เช่น "fs_write,bash" หรือ "*" = ทุก tool)Tool name to trigger (comma-separated, or "*" for all)
  • Event ที่ใช้บ่อยที่สุด: PreToolUse, PostToolUseMost common events: PreToolUse, PostToolUse
ดู event ทั้งหมด (advanced)See all events (advanced)

Events: SessionStart, SessionEnd, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, SubagentStart, SubagentEnd, Stop, Notification

อัพเดทUpdate
kawe update

Reference: Tools (20 tools)

AI ใช้ tools เหล่านี้ทำงานให้อัตโนมัติAI uses these tools automatically

ToolทำอะไรDescription
fs_readอ่านไฟล์Read file
fs_writeสร้าง/แก้ไขไฟล์ (พร้อม backup)Create/edit files (with backup)
globค้นหาไฟล์ด้วย patternFind files by pattern
grepค้นหา text ด้วย regexSearch text with regex
bashรันคำสั่ง shellRun shell commands
delegateมอบงานให้ sub-agentDelegate to sub-agent
web_searchค้นหาข้อมูลจาก webSearch the web
web_fetchดึงเนื้อหาจาก URLFetch URL content
doc_createสร้างเอกสาร (PDF, DOCX, XLSX, PPTX, CSV, MD, TXT)Create docs (PDF, DOCX, XLSX, PPTX, CSV, MD, TXT)
doc_readอ่านเอกสาร (DOCX, XLSX, PPTX, CSV, JSON, MD, TXT — ไม่รองรับ PDF)Read docs (DOCX, XLSX, PPTX, CSV, JSON, MD, TXT — no PDF)
doc_convertแปลงรูปแบบเอกสารConvert document formats
image_readอ่าน/วิเคราะห์รูปภาพRead/analyze images
memoryจดจำข้อเท็จจริงRemember facts
todoจัดการ task listManage task list
lspตรวจ errors/warnings ในโค้ดCheck code errors/warnings
monitorเฝ้าดูการเปลี่ยนแปลงWatch for changes
cronรันงานตาม scheduleRun scheduled tasks
skillเปิด/ปิด skill ที่ติดตั้งไว้Enable/disable an installed skill
mcp_resource_readอ่าน resource จาก MCP server ที่เชื่อมต่อRead a resource from a connected MCP server
request_secretขอ secret จาก user แบบปลอดภัย (ไม่เก็บ ไม่ log)Securely prompt the user for a secret (never stored or logged)

Reference: Slash Commands (39+ คำสั่ง)

รายการนี้ไม่รวม skill/custom commands ที่ติดตั้งเพิ่มได้ — พิมพ์ /help เพื่อดูรายการที่ active อยู่จริงExcludes installed skill/custom commands — type /help to see what's actually active

CommandคำอธิบายDescription
/helpแสดงคำสั่งทั้งหมดShow all commands
/quitออกQuit
/clearล้าง conversationClear conversation
/modelเปลี่ยน modelChange model
/usageดู creditsCheck credits
/contextดู token usage / /context add <file> เพิ่มไฟล์ / /context remove <file>View tokens / /context add <file> / /context remove <file>
/compactบีบอัด contextCompress context
/forget Nลบ N turns ล่าสุดRemove last N turns
/retryส่งข้อความล่าสุดอีกครั้งResend last message
/diffดูไฟล์ที่เปลี่ยนView changed files
/undoย้อนไฟล์กลับRevert file
/rewindย้อน session กลับRewind session
/recapสรุป sessionSummarize session
/reviewส่งไฟล์ให้ AI reviewAI review files
/scanสแกน projectScan project
/agentเปลี่ยน roleChange role
/agentsดู agent definitions สำหรับ delegateView agent definitions for delegation
/planโหมด read-only — วิเคราะห์ก่อนลงมือแก้ไขRead-only mode — investigate before making changes
/meetingเริ่ม meeting mode (เพิ่ม --deep สำหรับ 5-perspective analysis)Start meeting mode (add --deep for 5-perspective analysis)
/spawnสร้าง sub-agentSpawn sub-agent
/trust-allAuto-approve ทุก tool
/trust-hooksเปิดใช้งาน hooks และ skill shell สำหรับ project นี้Enable hooks and skill shell for this project
/rulesตั้งกฎ auto-mode แบบ deterministic (deny/confirm ต่อ tool)Set deterministic auto-mode rules (deny/confirm per tool)
/steeringดู steering rules ที่ active อยู่View active steering rules
/marketplaceติดตั้ง skills/commands/hooks/agents จาก GitHubInstall skills/commands/hooks/agents from GitHub
/autoToggle auto mode
/effortตั้งระดับ effort (low/medium/high/xhigh)Set effort level (low/medium/high/xhigh)
/memoryดู memoriesView memories
/rememberบันทึก factSave fact
/todoดู task listView tasks
/skillดู skillsView skills
/mcpMCP status
/hooksดู hooksView hooks
/monitorsดู monitorsView monitors
/cronดู cron tasksView cron
/copyCopy response ล่าสุดCopy last response
/sidebarดูภาพรวมOverview panel
/statsดู request statsRequest stats
/logoutล้าง credentialsClear credentials

Reference: Agent Roles (11 roles)

RoleคำอธิบายDescription
defaultCoding assistant ทั่วไปGeneral coding assistant
devFull-stack developer
writerTechnical writer
qaQA — หา bugs, เขียน testsQA — find bugs, write tests
architectSystem architect
reviewerCode reviewer
novelistนักเขียนนิยายFiction writer
copywriterMarketing copy
researcherนักวิจัย/วิเคราะห์Research analyst
pmProduct manager
analystBusiness analyst

สร้าง custom role: วาง .md ใน .kawe/roles/Custom roles: place .md in .kawe/roles/

Reference: Meeting Mode (4 templates × 2 โหมด)

2 โหมดการใช้งาน2 Usage Modes
โหมดModeSyntaxการทำงานHow it worksต้นทุนCost
ปกติStandard/meeting <template> <topic>AI จำลองหลายมุมมองเองใน 1 คำตอบเดียว (ไม่เรียก sub-agent)AI simulates multiple perspectives in a single response (no sub-agents)1 API call1 API call
Deep/meeting --deep <template> <topic>เรียก sub-agent จริงหลายตัว: 3 perspective roles (ตามหัวข้อ) + Red-Team (หาจุดอ่อน) + Synthesis (สรุป+ตัดสินใจ) = 5 API calls จริงRuns real sub-agents: 3 perspective roles (varies by template) + Red-Team (challenge) + Synthesis (summarize+decide) = 5 real API calls~5 API calls ⚠️~5 API calls ⚠️

⚠️ --deep จะถามยืนยันก่อนรัน ("will make ~5 API calls") เพราะใช้เครดิตมากกว่าปกติ⚠️ --deep prompts for confirmation ("will make ~5 API calls") as it costs significantly more

Deep Mode — 3 Perspectives ตามหัวข้อDeep Mode — 3 Perspectives per Template
Template3 มุมมอง3 Perspectives
designProponent · Skeptic · Pragmatist
reviewAuthor · Security Reviewer · Maintainability Advocate
sprintProduct Owner · Tech Lead · QA Engineer
brainstormVisionary · Critic · Synthesizer
Templates (4 หัวข้อtypes)
TemplateคำอธิบายDescription
designDesign Review — นำเสนอ → หาจุดอ่อน → หาทางเลือก → สรุปDesign Review — present → weaknesses → alternatives → consensus
reviewCode Review — walk through → หาปัญหา → แนะนำ → อนุมัติ/ไม่อนุมัติCode Review — walk through → issues → suggest → approve/reject
sprintSprint Planning — ดู backlog → ประเมิน → assign → set goalSprint Planning — backlog → estimate → assign → goal
brainstormBrainstorm — ระบุปัญหา → หาไอเดีย → ประเมิน → เลือก top 3Brainstorm — problem → ideas → evaluate → top 3
ตัวอย่างExamples
# โหมดปกติ (1 API call)
/meeting design ระบบ auth ใหม่
/meeting brainstorm ไอเดีย team building Q4

# Deep mode (5 API calls — ถามยืนยันก่อนรัน)
/meeting --deep review internal/auth/login.go
/meeting --deep sprint สรุปงาน sprint 14

# ไม่ใส่ template → เปิดเมนูเลือก
/meeting

# ไม่ใส่ topic → ใช้ "general discussion"
/meeting design

📄 ผลลัพธ์ทุกครั้งถูกบันทึกอัตโนมัติที่ .kawe/docs/meeting-<template>[-deep]-<timestamp>.md — เปิดอ่านย้อนหลังได้เสมอ📄 Every result is auto-saved to .kawe/docs/meeting-<template>[-deep]-<timestamp>.md — always accessible later

Kawe AI
สวัสดีครับ! มีอะไรให้ช่วยเกี่ยวกับ Kawe AI ไหมครับ? 👋