openpencil/apps/cli/README.th.md
Kayshen-X c4e5359596 docs: drop op export from CLI docs and clarify pen-mcp usage
The `op export` command was removed in 0.7.x but the README still
advertised it (#116). The pen-mcp README also documented an
`npx @zseven-w/pen-mcp` quick-start that never worked because the
package ships TypeScript source against workspace-only deps with no
`bin` entry (#117).

- Strip `op export` references from all 15 root and 15 cli READMEs
- Sync AGENTS.md, CLAUDE.md, apps/cli/CLAUDE.md to match the codegen-
  pipeline reality (no standalone export command anymore)
- Rewrite pen-mcp README's quick-start: explain the package ships as
  part of the OpenPencil app and external clients connect over HTTP

Closes #116
Closes #117
2026-04-26 19:20:14 +08:00

5.5 KiB

@zseven-w/openpencil

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Français · Español · Deutsch · Português · Русский · हिन्दी · Türkçe · ไทย · Tiếng Việt · Bahasa Indonesia

CLI สำหรับ OpenPencil — ควบคุมเครื่องมือออกแบบจากเทอร์มินัลของคุณ

การติดตั้ง

npm install -g @zseven-w/openpencil

การรองรับแพลตฟอร์ม

CLI จะตรวจจับและเปิดแอปเดสก์ท็อป OpenPencil โดยอัตโนมัติบนทุกแพลตฟอร์ม:

แพลตฟอร์ม เส้นทางการติดตั้งที่ตรวจพบ
macOS /Applications/OpenPencil.app, ~/Applications/OpenPencil.app
Windows NSIS ต่อผู้ใช้ (%LOCALAPPDATA%), ต่อเครื่อง (%PROGRAMFILES%), แบบพกพา
Linux /usr/bin, /usr/local/bin, ~/.local/bin, AppImage (~/Applications, ~/Downloads), Snap, Flatpak

การใช้งาน

op <คำสั่ง> [ตัวเลือก]

วิธีการป้อนข้อมูล

อาร์กิวเมนต์ที่รับ JSON หรือ DSL สามารถส่งได้สามวิธี:

op design '...'              # ข้อความแบบอินไลน์ (ข้อมูลขนาดเล็ก)
op design @design.txt        # อ่านจากไฟล์ (แนะนำสำหรับการออกแบบขนาดใหญ่)
cat design.txt | op design - # อ่านจาก stdin (การไพพ์)

การควบคุมแอป

op start [--desktop|--web]   # เปิด OpenPencil (เดสก์ท็อปเป็นค่าเริ่มต้น)
op stop                      # หยุดอินสแตนซ์ที่กำลังทำงาน
op status                    # ตรวจสอบว่ากำลังทำงานอยู่หรือไม่

การออกแบบ (Batch DSL)

op design <dsl|@file|-> [--post-process] [--canvas-width N]
op design:skeleton <json|@file|->
op design:content <section-id> <json|@file|->
op design:refine --root-id <id>

การดำเนินการเอกสาร

op open [file.op]            # เปิดไฟล์หรือเชื่อมต่อกับแคนวาสสด
op save <file.op>            # บันทึกเอกสารปัจจุบัน
op get [--type X] [--name Y] [--id Z] [--depth N]
op selection                 # รับการเลือกแคนวาสปัจจุบัน

การจัดการโหนด

op insert <json> [--parent P] [--index N] [--post-process]
op update <id> <json> [--post-process]
op delete <id>
op move <id> --parent <P> [--index N]
op copy <id> [--parent P]
op replace <id> <json> [--post-process]

ตัวแปรและธีม

op vars                      # รับตัวแปร
op vars:set <json>           # ตั้งค่าตัวแปร
op themes                    # รับธีม
op themes:set <json>         # ตั้งค่าธีม
op theme:save <file.optheme> # บันทึกพรีเซ็ตธีม
op theme:load <file.optheme> # โหลดพรีเซ็ตธีม
op theme:list [dir]          # แสดงรายการพรีเซ็ตธีม

หน้า

op page list                 # แสดงรายการหน้า
op page add [--name N]       # เพิ่มหน้า
op page remove <id>          # ลบหน้า
op page rename <id> <name>   # เปลี่ยนชื่อหน้า
op page reorder <id> <index> # จัดลำดับหน้าใหม่
op page duplicate <id>       # ทำสำเนาหน้า

การนำเข้า

op import:svg <file.svg>     # นำเข้าไฟล์ SVG
op import:figma <file.fig>   # นำเข้าไฟล์ Figma .fig

เลย์เอาต์

op layout [--parent P] [--depth N]
op find-space [--direction right|bottom|left|top]

แฟล็กทั่วไป

--file <path>     ไฟล์ .op เป้าหมาย (ค่าเริ่มต้น: แคนวาสสด)
--page <id>       ID หน้าเป้าหมาย
--pretty          แสดงผล JSON แบบอ่านง่าย
--help            แสดงความช่วยเหลือ
--version         แสดงเวอร์ชัน

สัญญาอนุญาต

MIT