@luaward/cli 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Luaward (ATG)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,61 @@
1
- # Temporary Holding Version
1
+ # @luaward/cli — Luaward CLI (v0.2.0)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ จัดการ source, build, kill switch, คีย์, error reports และรัน/ดีบักไฟล์ `.lua`/`.luau` ในเซสชันเกม Roblox จาก terminal หรือ CI
4
+
5
+ ## การติดตั้ง (Installation · Early Access)
6
+
7
+ - ติดตั้งจาก public npm (Node.js **20 ขึ้นไป**, ขณะนี้ระบบแดชบอร์ด + `/api/ide` ยังเปิดแบบ **Early Access** สำหรับบัญชีที่อนุญาตใน `EARLY_ACCESS_EMAILS`; ดูเพิ่มเติมที่ [luaward.com/docs](https://luaward.com/docs) และ [github.com/luaward](https://github.com/luaward)):
8
+
9
+ ```bash
10
+ npm install -g @luaward/cli
11
+ luaward --version
12
+ ```
13
+
14
+ หรือติดตั้งจาก tarball ทางการ หรือ build จาก repository:
15
+
16
+ ```bash
17
+ npm install -g https://luaward.com/luaward-cli.tgz
18
+ luaward --version
19
+ ```
20
+
21
+ หรือ build จาก checkout ของ repository:
22
+
23
+ ```bash
24
+ pnpm --filter @luaward/cli build
25
+ node packages/cli/dist/cli.js --help
26
+ ```
27
+
28
+ เพื่อสร้าง tarball อัปเดตไปยัง `apps/web/public/luaward-cli.tgz`:
29
+
30
+ ```bash
31
+ pnpm --filter @luaward/cli pack:public
32
+ ```
33
+
34
+ ## Credentials และสิทธิ์
35
+
36
+ CLI ใช้ personal token **`lwm_…`** กับ `https://luaward.com/api/ide` (ห้ามใช้ Developer API key `lwa_live_…`) เก็บ credentials ที่ `~/.config/luaward/credentials.json` (เปลี่ยนตำแหน่งด้วย `LUAWARD_CONFIG_DIR`) หรือส่งผ่าน `LUAWARD_TOKEN=lwm_…`
37
+
38
+ - `read`: ดู workspace, scripts, sessions, builds และรายการ errors
39
+ - `manage`: อ่าน source, deploy, toggle kill switch/preset, ออก/ดู/รีเซ็ตคีย์ และจัดการ errors (ต้องเป็นโทเคนโหมดรันทันที)
40
+ - `control`: รันไฟล์ (`dev`), รัน snippet (`exec`), หยุดสคริปต์ (`stop`) และสร้างคำสั่งเชื่อมเกม (`pair`)
41
+
42
+ ## คำสั่งทั้งหมด
43
+
44
+ | คำสั่ง | ความสามารถ |
45
+ | --- | --- |
46
+ | `login`, `logout`, `status` | ล็อกอินด้วย 1-Click Allow ผ่านเบราว์เซอร์ (หรือ `--token`), ลบ credentials และตรวจสถานะเวิร์กสเปซ |
47
+ | `init [--project <id-or-name>] [--merge\|--force] [--pull]` | สร้าง `luaward.json` (ป้องกันเขียนทับโดยไม่ตั้งใจ, ใช้ `--merge` เพิ่มเฉพาะสคริปต์ใหม่ได้) |
48
+ | `scripts [--project <id-or-name>]` | แสดงรายการสคริปต์ทั้งหมดพร้อมสถานะ Enable/Pause, เวอร์ชัน, โหมดป้องกัน และสถานะ build |
49
+ | `pull [alias-or-script-id] [--out <file>] [--stdout]` | ดึง source ล่าสุดลงไฟล์ใน `luaward.json` หรือระบุ script ID 32 หลักโดยตรง |
50
+ | `push [alias-or-file] [--preset fast\|balanced\|max] [--script <id>] [--new --project <id> --name <name>] [--no-wait] [--timeout <sec>]` | อัปโหลดและรอ build พร้อมใช้งาน (คืน exit code 1 เมื่อ build พังหรือหมดเวลา) |
51
+ | `toggle <target> [--enable\|--disable] [--preset <preset>]` | เปิด/ปิด kill switch หรือเปลี่ยน preset ของสคริปต์จาก terminal |
52
+ | `sessions`, `pair` | ดูเกมที่เชื่อมต่ออยู่ และสร้างคำสั่ง `loadstring(...)()` สำหรับวางใน Executor |
53
+ | `dev [alias-or-file] [--script <id>] [--watch\|--no-watch] [--session <sid>] [--observe <1-30>] [--stop-on-exit]` | รันไฟล์ local ในเกมสดและ Hot Reload ทุกครั้งที่บันทึกไฟล์ (ไม่ทับสคริปต์ลูกค้า) |
54
+ | `exec <luau-code\|@file.luau> [--session <sid>] [--no-wait]` | ส่งโค้ด Luau สั้นๆ หรือไฟล์ไปรันในเกมและรออ่านผลจากคอนโซล |
55
+ | `stop [--session <sid>]` | สั่งหยุดสคริปต์ทดสอบที่กำลังทำงานในเกม |
56
+ | `keys list [--project <id>] [--limit <1-50>]` | ดูคีย์ล่าสุดในโปรเจกต์ |
57
+ | `keys create [--project <id>] [--days <N>] [--note <text>] [--discord <id>]` | ออกคีย์ใหม่ (รองรับผูก Discord ID 15–22 หลัก) |
58
+ | `keys reset-hwid <key-or-discord-id> [--project <id>]` | รีเซ็ต HWID ของคีย์ |
59
+ | `errors [target] [--status open\|resolved\|ignored\|all]` | ดูรายงาน error (หรือใช้ `--resolve` / `--ignore` / `--reopen <error-id>`) |
60
+
61
+ รองรับ `--json` / `-j` ในทุกคำสั่งสำหรับสคริปต์อัตโนมัติและ CI และอ่านค่า `luaward.json` จากโฟลเดอร์แม่ให้อัตโนมัติเมื่อรันจากโฟลเดอร์ย่อยครับ
package/action.yml ADDED
@@ -0,0 +1,46 @@
1
+ name: "Luaward Deploy Action"
2
+ description: "Protect and deploy Roblox Luau scripts defined in luaward.json using a Luaward Personal Token (lwm_…)"
3
+ author: "Luaward"
4
+ branding:
5
+ icon: "shield"
6
+ color: "red"
7
+ inputs:
8
+ token:
9
+ description: "Luaward Personal Token (lwm_…) stored in GitHub Secrets"
10
+ required: true
11
+ target:
12
+ description: "Optional script alias or file from luaward.json (omit to deploy all scripts in luaward.json)"
13
+ required: false
14
+ default: ""
15
+ preset:
16
+ description: "Optional override protection preset (fast, balanced, max)"
17
+ required: false
18
+ default: ""
19
+ api_url:
20
+ description: "Luaward base URL"
21
+ required: false
22
+ default: "https://luaward.com"
23
+ working_directory:
24
+ description: "Directory containing luaward.json"
25
+ required: false
26
+ default: "."
27
+ runs:
28
+ using: "composite"
29
+ steps:
30
+ - name: Deploy with Luaward CLI
31
+ shell: bash
32
+ working-directory: ${{ inputs.working_directory }}
33
+ env:
34
+ LUAWARD_TOKEN: ${{ inputs.token }}
35
+ LUAWARD_API_URL: ${{ inputs.api_url }}
36
+ INPUT_TARGET: ${{ inputs.target }}
37
+ INPUT_PRESET: ${{ inputs.preset }}
38
+ run: |
39
+ ARGS=("push")
40
+ if [ -n "$INPUT_TARGET" ]; then
41
+ ARGS+=("$INPUT_TARGET")
42
+ fi
43
+ if [ -n "$INPUT_PRESET" ]; then
44
+ ARGS+=("--preset" "$INPUT_PRESET")
45
+ fi
46
+ npx --yes @luaward/cli "${ARGS[@]}"