Skip to content

คำสั่ง CLI และ Flags

คำสั่งย่อย (Subcommands)

Section titled “คำสั่งย่อย (Subcommands)”
  • microbase serve (ค่าเริ่มต้น) — เปิดเซิร์ฟเวอร์ HTTP และ Admin UI
  • microbase init-config [--path <path>] [--force] — สร้าง microbase.conf (mode 0600) พร้อมสุ่ม JWT_SECRET และ ENCRYPTION_KEY
  • microbase update [--check] [--dry-run] [--to vX.Y.Z] — เช็ค, ทดสอบ SHA-256 แบบ dry-run, หรืออัปเดต/rollback binary
  • microbase superuser [--config <path>] [--db <url>] upsert <email> <password> — สร้างหรือรีเซ็ต Superuser
  • microbase migrate [--config <path>] [--migrationsDir ./mb_migrations] <up|down|status|create <name>|snapshot> — จัดการ migration
  • microbase version (หรือ -v, --version) — แสดงเวอร์ชันปัจจุบัน
Flag Env Var ค่าเริ่มต้น คำอธิบาย
-c, --config <path> — auto ระบุไฟล์ microbase.conf
--db <url> DATABASE_URL — Override PostgreSQL URL
--dir <path> DATA_DIR ./storage โฟลเดอร์เก็บไฟล์ local
--http <addr> — 0.0.0.0:3000 Listen address (host:port)
--host / --port HOST / PORT 0.0.0.0 / 3000 Host และ Port
--origins <list> CORS_ORIGINS * รายการ CORS origins
--no-ui DISABLE_ADMIN_UI=true false ปิด Admin UI (API-only)
--dev DEV=true false เปิด debug log
--hooksDir <path> HOOKS_DIR ./mb_hooks โฟลเดอร์ JS hooks
--migrationsDir <p> MIGRATIONS_DIR ./mb_migrations โฟลเดอร์ migrations