ข้อมูลอ้างอิงคำสั่ง CLI

คำสั่ง postkub ทุกตัวพร้อม REST operation, scope ที่ต้องใช้, flag และ exit code

อัปเดตล่าสุด

เปิดใน Claudeเปิดใน ChatGPT
เนื้อหาในหน้านี้

ข้อมูลอ้างอิงแบบสแกนได้ครบถ้วนของคำสั่ง postkub: ทุก operation ที่ยอมรับ พร้อม REST call ที่เรียก, scope ที่ key ต้องมี และ flag ที่แต่ละกลุ่มคำสั่งรับ โดย CLI ยังอยู่ในช่วง preview เท่านั้น — ดู คู่มือ CLI สำหรับการตั้งค่า ตัวอย่าง และการตั้งค่าคอนฟิก

ข้อควรระวัง

Postkub CLI ยังอยู่ในช่วง preview และยังไม่เปิดติดตั้งจาก npm ข้อมูลอ้างอิงนี้อธิบาย public interface ที่วางแผนไว้ ซึ่งคำสั่งและ flag อาจยังเปลี่ยนแปลงได้ก่อนเปิดตัวจริง

Operations ของ REST

คำสั่งทุกตัวด้านล่างเรียก REST ที่ได้รับอนุญาตเพียงหนึ่งครั้ง mutation ทุกตัวต้องมี UUID Idempotency-Key (สร้างให้เมื่อไม่ได้ส่ง --idempotency-key) และ resource ที่มีอยู่แล้วมี revision guard ด้วย --expected-revision โดย response 202 หมายถึงได้รับการยอมรับ ไม่ใช่ผู้ให้บริการทำเสร็จแล้ว

CommandREST callRequired scopeความหมาย
brands listGET /v1/brandsbrand:readแสดงรายการ Brand ที่ principal ที่ยืนยันตัวตนแล้วมองเห็น
accounts listGET /v1/accountsaccount:readแสดงรายการโซเชียลบัญชีที่เชื่อมต่อ กรองตาม Brand ได้
accounts schedule getGET /v1/accounts/{id}/schedule-settingsaccount:readอ่าน timezone และ weekly queue slot ของบัญชี
accounts schedule updatePATCH /v1/accounts/{id}/schedule-settingsaccount:scheduleแก้ timezone และ/หรือ weekly queue slot ของบัญชี
capabilities getGET /v1/accounts/{id}/capabilitiesaccount:readอ่าน action ที่บัญชีนั้นทำได้พร้อมเหตุผล
posts listGET /v1/postspost:readแสดงรายการโพสต์พร้อม filter Brand, บัญชี, สถานะ และช่วงเวลา UTC
posts getGET /v1/posts/{id}post:readอ่านโพสต์หนึ่งรายการ
posts createPOST /v1/postspost:createสร้าง draft
posts updatePATCH /v1/posts/{id}post:updateแก้ draft (มี revision guard)
posts deleteDELETE /v1/posts/{id}post:deleteลบ draft ในเครื่องที่ยังไม่ถูกยอมรับ (มี revision guard)
posts publishPOST /v1/posts/{id}/publishpost:publishยอมรับ publish-now สำหรับบัญชีที่เลือก (202 = ยอมรับแล้ว)
posts schedulePOST /v1/posts/{id}/schedulepost:scheduleยอมรับตารางที่ระบุ หรือจอง queue slot ถัดไปของแต่ละบัญชี (202 = ยอมรับแล้ว)
posts cancelPOST /v1/posts/{id}/cancelpost:cancelยกเลิกงานที่ยังไม่เริ่มของบัญชีที่เลือก หรือขอ reconciliation
posts retryPOST /v1/posts/{id}/retrypost:publishลองใหม่เฉพาะความล้มเหลวแบบ proven-no-effect ของบัญชีที่เลือก
posts cover-retryPOST /v1/posts/{id}/cover-retrypost:publishลอง video cover ใหม่โดยไม่อัปโหลดวิดีโอซ้ำ
threads listGET /v1/threadscomment:readแสดงรายการ inbox thread (filter: บัญชี, handled, โพสต์ที่ผูกไว้)
threads getGET /v1/threads/{id}comment:readอ่าน thread หนึ่งรายการพร้อมคอมเมนต์
threads updatePATCH /v1/threads/{id}thread:update / thread:resolveแก้สถานะ unread (thread:update) และ/หรือ handled (thread:resolve)
comments listGET /v1/commentscomment:readแสดงรายการคอมเมนต์ (filter: บัญชี, thread, unread)
comments replyPOST /v1/comments/{id}/repliescomment:replyยอมรับ reply แบบ durable (202 = ยอมรับแล้ว)
insights accountGET /v1/accounts/{id}/insightsinsight:readอ่านเมตริกบัญชีที่บันทึกไว้และความสดของข้อมูล
insights postGET /v1/posts/{id}/insightsinsight:readอ่านเมตริกโพสต์ที่บันทึกไว้ตามบัญชีเป้าหมายที่ได้รับอนุญาต
activity listGET /v1/activityactivity:readอ่านกิจกรรมโซเชียลใน scope พร้อมความล้มเหลวที่ทำความสะอาดแล้ว
replies getGET /v1/replies/{id}comment:readอ่านสถานะการทำงานและประวัติความพยายามของ reply
requests getGET /v1/requests/{requestId}key ที่ถูกต้องใด ๆกู้ใบเสร็จ mutation แบบ durable ของ principal นี้
whoamiGET /v1/mekey ที่ถูกต้องใด ๆตรวจดู principal, workspace, target ID และ action ที่ได้รับอนุญาต

รายละเอียดระดับ API ของแต่ละ operation อยู่ใน API reference: discovery และ accounts, posts, publications, inbox, insights และ requests และ activity

Alias: inbox list รัน threads list, insights posts รัน insights post, และ threads resolve รัน threads update ด้วย handled: true (ตั้ง handled เป็น false ไม่ได้ และต้องใช้ scope thread:resolve)

คำสั่งในเครื่องและคำสั่งตั้งค่า

คำสั่งกลุ่มนี้ไม่ได้แมปกับ REST operation ทางโซเชียล โดย schema describe อ่านเอกสาร OpenAPI ของเซิร์ฟเวอร์ที่ GET /api/docs-json ส่วนที่เหลือรันในเครื่องทั้งหมด

Commandความหมาย
postkub help, --help, -hพิมพ์วิธีใช้คำสั่ง
postkub --version, -vพิมพ์เวอร์ชัน CLI
postkub init [--non-interactive]บันทึกและยืนยันการตั้งค่า, สรุป scope ที่ได้รับ และเสนอติดตั้ง agent guide
postkub doctor [--verbose]ตรวจเวอร์ชัน Node, config, รูปแบบ key, การเชื่อมต่อ, scope และความใหม่ของ CLI
postkub config path/get/set/unset [--repo]ดูหรือแก้ global และ repo config
postkub context [--list / TOPIC]พิมพ์หัวข้อ context ที่ agent อ่านได้
postkub completion bash/zsh/fish [--install]พิมพ์หรือติดตั้ง shell completion
postkub install claude/codex [--global] [--dry-run]ติดตั้งคู่มือ Postkub ให้ coding agent
postkub uninstall claude/codex [--global] [--dry-run]ลบเนื้อหาคู่มือส่วนที่ Postkub จัดการออก
postkub schema listแสดงทุก operation ที่ยอมรับพร้อม scope และ flag (ในเครื่อง)
postkub schema describe OPERATIONดึง schema ของ operation หนึ่งตัวจากเอกสาร OpenAPI ที่เซิร์ฟเวอร์ให้บริการ

init --non-interactive ยืนยันการตั้งค่าที่มีอยู่หรือ environment variables โดยไม่ถาม และ --output json ใช้ได้เฉพาะคู่กับ --non-interactive

Flag ทั่วไป (Global flags)

ใช้ได้กับทุกคำสั่ง ประเภท: value ต้องมีค่า, bool ไม่มีค่า, optvalue มีค่าได้หรือไม่มีก็ได้

Flagประเภทคำอธิบาย
--outputvalueauto (ค่าเริ่มต้น), pretty, human หรือ json; auto พิมพ์แบบมนุษย์บน TTY และ JSON เมื่อถูก pipe
--timeoutvaluedeadline ต่อ request หน่วยวินาที 1–900 (ค่าเริ่มต้น 30)
--quietboolซ่อนบรรทัดข้อมูลทาง stderr
--verboseboolพิมพ์ rate-limit response header ทาง stderr
--no-colorboolปิดสี ANSI

Flag สำหรับ mutation

ใช้ได้กับทุก mutating command (ทุกอย่างที่ไม่ใช่ GET):

Flagประเภทคำอธิบาย
--inputvalueอินพุตแบบมีโครงสร้างจากไฟล์ หรือ - สำหรับ stdin
--jsonvalueอินพุตแบบมีโครงสร้างในรูป JSON string แบบ inline
--idempotency-keyvalueUUID idempotency ที่ระบุเอง หากไม่ระบุจะสร้างให้
--waitoptvalueหลังยอมรับ 202 จะ poll จนงานนิ่ง (ค่าเริ่มต้น 120 วินาที, exit code 6 เมื่อหมดเวลา)
--dry-runboolตรวจสอบในเครื่องและพรีวิว request เท่านั้น ไม่ส่งอะไร

ใช้ได้เพียงหนึ่งใน --input / --json เท่านั้น โดย flag รายฟิลด์ช่วยเติมเอกสารได้ แต่แทนที่ฟิลด์ที่เอกสารระบุไว้แล้วไม่ได้

Flag สำหรับการอ่าน

ใช้ได้กับ GET command:

Flagประเภทคำอธิบาย
--fieldsvalueprojection แบบ dot path คั่นด้วยจุลภาค ขยายวงเล็บปีกกาได้, all คืนทั้งหมด
--cursorvaluepagination cursor (เฉพาะ list command)
--limitvalueขนาดหน้า 1–100 (เฉพาะ list command)

brands, accounts และ capabilities

CommandFlagประเภทจำเป็นคำอธิบาย
brands list--fieldsvalueไม่ฉาย (project) response
brands list--cursor, --limitvalueไม่Pagination
accounts list--brand-idvalueไม่กรองตาม Brand หากไม่ใส่จะใช้ defaultBrandId ที่ตั้งไว้
accounts list--fields, --cursor, --limitvalueไม่Projection และ pagination
accounts schedule get--id หรือ --account-idvalueใช้อย่างใดอย่างหนึ่งบัญชีเป้าหมาย, --account-id ใช้ defaultAccountId สำรอง
accounts schedule get--fieldsvalueไม่ฉาย response
accounts schedule update--id หรือ --account-idvalueใช้อย่างใดอย่างหนึ่งบัญชีเป้าหมาย
accounts schedule update--expected-revisionvalueใช่Revision guard
accounts schedule update--timezonevalueไม่Timezone แบบ IANA เช่น Asia/Bangkok
accounts schedule update--slotvalue (repeat)ไม่Weekly slot รูปแบบ WEEKDAY:HH:MM, วันเป็น 1–7 หรือ mon–sun
accounts schedule update--clear-slotsboolไม่ลบ weekly slot ทั้งหมด ห้ามใช้คู่กับ --slot
capabilities get--account-idvalueใช่บัญชีเป้าหมาย ใช้ defaultAccountId สำรอง
capabilities get--fieldsvalueไม่ฉาย response

posts

CommandFlagประเภทจำเป็นคำอธิบาย
posts list--brand-idvalueไม่กรองตาม Brand หากไม่ใส่จะใช้ defaultBrandId
posts list--account-idvalueไม่กรองตามบัญชี
posts list--statusvalueไม่ค่าใดค่าหนึ่งจาก draft, scheduled, publishing, published, failed, cancelled, needs_attention
posts list--from, --tovalueไม่ช่วง UTC instant ต้องใส่คู่กัน
posts list--fields, --cursor, --limitvalueไม่Projection และ pagination
posts get--idvalueใช่Post ID
posts create--brand-idvalueใช่Brand เจ้าของ
posts create--account-idvalue (repeat)ไม่บัญชีเป้าหมาย
posts create--textvalueใช่ (หรือใน input)ข้อความโพสต์ 1–5000 ตัวอักษร
posts create--media-urlvalue (repeat)ไม่URL สื่อ HTTPS สาธารณะเรียงลำดับ
posts create--media-kindvalueไม่image หรือ video, วิดีโอต้องมีสื่อรายการเดียว
posts create--first-commentvalueไม่คอมเมนต์แรกพื้นฐาน (มากสุด 2200 ตัวอักษร, ขึ้นกับ capability)
posts update--idvalueใช่Post ID
posts update--expected-revisionvalueใช่ (หรือใน input)Revision guard
posts update--text, --media-url, --media-kind, --first-comment, --account-idvalue / repeatไม่ความหมายเดียวกับ create
posts delete--idvalueใช่Post ID ของ draft ที่ยังไม่ถูกยอมรับ
posts delete--expected-revisionvalueใช่ (หรือใน input)Revision guard
posts publish--idvalueใช่Post ID
posts publish--expected-revisionvalueไม่Revision guard หากไม่ใส่ต้องอยู่ในเอกสาร input
posts publish--account-idvalue (repeat)ไม่target ย่อย การเผยแพร่ต้องมีอย่างน้อยหนึ่งบัญชี
posts publish--replace-existingboolไม่แทนที่งานที่ยังไม่เริ่มของบัญชีที่เลือก
posts schedule--idvalueใช่Post ID
posts schedule--expected-revisionvalueใช่ (หรือใน input)Revision guard
posts schedule--next-slotboolไม่จอง weekly slot ว่างที่เร็วที่สุดของแต่ละบัญชีที่เลือก
posts schedule--account-idvalue (repeat)ไม่target ย่อย (ใช้คู่กับ --next-slot)
posts cancel--idvalueใช่Post ID
posts cancel--expected-revisionvalueไม่Revision guard
posts cancel--account-idvalue (repeat)ไม่target ย่อยที่ต้องการยกเลิก
posts retry / posts cover-retry--idvalueใช่Post ID
posts retry / posts cover-retry--expected-revisionvalueไม่Revision guard
posts retry / posts cover-retry--account-idvalue (repeat)ไม่target ย่อยที่ต้องการลองใหม่

posts create, posts update, posts schedule, posts cancel, posts retry, posts cover-retry และ posts delete ยังรับรูปแบบเอกสาร JSON เต็มผ่าน --input / --json ด้วยฟิลด์ที่อธิบายไว้ใน posts API และ publications API

inbox: threads, comments และ replies

CommandFlagประเภทจำเป็นคำอธิบาย
threads list / inbox list--account-idvalueไม่กรองตามบัญชี หากไม่ใส่จะใช้ defaultAccountId
threads list / inbox list--handledvalueไม่true หรือ false
threads list / inbox list--post-target-idvalueไม่กรองตาม post target ที่ผูกไว้, ค่า none เลือก thread ที่ไม่ผูกกับโพสต์
threads list / inbox list--fields, --cursor, --limitvalueไม่Projection และ pagination
threads get--idvalueใช่Thread ID
threads update--idvalueใช่Thread ID
threads update--expected-revisionvalueใช่ (หรือใน input)Revision guard
threads update--handledvalueไม่true หรือ false, true ต้องใช้ thread:resolve
threads update--unreadvalueไม่true หรือ false, ต้องใช้ thread:update
comments list--account-idvalueไม่กรองตามบัญชี หากไม่ใส่จะใช้ defaultAccountId
comments list--thread-idvalueไม่กรองตาม thread
comments list--unreadvalueไม่true หรือ false
comments list--fields, --cursor, --limitvalueไม่Projection และ pagination
comments reply--idvalueใช่Comment ID ที่ต้องการตอบ
comments reply--textvalueใช่ (หรือใน input)ข้อความตอบ 1–2200 ตัวอักษร
replies get--idvalueใช่Reply ID

insights และ activity

CommandFlagประเภทจำเป็นคำอธิบาย
insights account--account-id หรือ --idvalueใช้อย่างใดอย่างหนึ่งบัญชีเป้าหมาย, --account-id ใช้ defaultAccountId สำรอง
insights account--range-start-utc, --range-end-utcvalueไม่คู่ UTC instant ห่างกันมากสุด 90 วัน, ค่าเริ่มต้นคือ 30 วันล่าสุด
insights account--fieldsvalueไม่ฉาย response
insights account--dry-runboolไม่พรีวิว request ในเครื่อง
insights post / insights posts--idvalueใช่Post ID
insights post / insights posts--range-start-utc, --range-end-utcvalueไม่คู่ UTC instant
insights post / insights posts--fieldsvalueไม่ฉาย response
insights post / insights posts--dry-runboolไม่พรีวิว request ในเครื่อง
activity list--brand-idvalueไม่กรองตาม Brand หากไม่ใส่จะใช้ defaultBrandId
activity list--account-id, --post-idvalueไม่กรองตามบัญชีหรือโพสต์
activity list--from, --tovalueไม่ช่วง UTC instant
activity list--fields, --cursor, --limitvalueไม่Projection และ pagination

ดูรูปร่าง response ได้ที่ insights API และ requests และ activity API

requests

CommandFlagประเภทจำเป็นคำอธิบาย
requests get--idvalueใช่Request UUID โดย CLI พิมพ์ค่านี้ทาง stderr ก่อนทุก mutation

config

CommandFlagประเภทจำเป็นคำอธิบาย
config path--repoboolไม่พิมพ์ path ของ repo config แทน global
config get--repoboolไม่อ่านค่า repo แทนค่าที่ใช้จริง
config get--allboolไม่พิมพ์ทุกค่าที่ใช้จริง (เฉพาะ global)
config setKEY VALUEpositionalใช่ตั้งค่า key ที่อนุญาต, apiKey จะถูกปฏิเสธ
config set--repoboolไม่เขียนลง repo config
config unsetKEYpositionalใช่ลบ key ที่อนุญาต
config unset--repoboolไม่ลบจาก repo config

key ที่อนุญาต: defaultBrandId, defaultAccountId, output, timeout ในทั้งสองระดับ, apiUrl เฉพาะไฟล์ global (ผ่าน init) และ apiKey ห้ามตั้งผ่าน config set เด็ดขาด

init, doctor และคู่มือ agent

CommandFlagประเภทคำอธิบาย
init--non-interactiveboolใช้ environment หรือ config เดิม ไม่มีการถาม
init--output jsonvalueสรุปแบบ machine-readable ใช้ได้เฉพาะคู่กับ --non-interactive
doctor--verboseboolพิมพ์ทุกการตรวจ ไม่ใช่เฉพาะที่ล้มเหลว
install claude/codex--globalboolเขียนที่ไฟล์คู่มือระดับผู้ใช้แทนระดับโปรเจกต์
install claude/codex--dry-runboolพรีวิวการเปลี่ยนแปลงโดยไม่เขียนไฟล์
uninstall claude/codex--global, --dry-runboolflag เดียวกับ install
completion bash/zsh/fish--installboolเขียน completion block ที่จัดการแล้วและรายงาน path

context และ schema

CommandArgument / flagคำอธิบาย
contextไม่มีพิมพ์ทุกหัวข้อ context เป็น markdown
context --listflagพิมพ์รายการหัวข้อ
context TOPICpositionalพิมพ์หัวข้อเดียว, ดูตารางหัวข้อใน คู่มือ CLI
schema listไม่มีแสดงทุก operation ที่ยอมรับในเครื่อง
schema describepositional OPERATIONดึง schema OpenAPI ที่เซิร์ฟเวอร์ให้บริการของ operation หนึ่งตัว

Exit codes

ตาราง exit code ใช้ร่วมกับคู่มือ CLI: exit codes โดยสรุป: 0 ยอมรับ/เสร็จสมบูรณ์, 1 ข้อผิดพลาด client ที่ไม่คาดคิด, 2 usage/schema, 3 การยืนยันตัวตน/การอนุญาต, 4 API ปฏิเสธ, 5 transport/ไม่ชัดเจน, 6 หมดเวลารอ, 130 SIGINT, 143 SIGTERM