@zseven-w/openpencil 0.0.1

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/README.th.md ADDED
@@ -0,0 +1,132 @@
1
+ # @zseven-w/openpencil
2
+
3
+ [English](./README.md) · [简体中文](./README.zh.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Français](./README.fr.md) · [Español](./README.es.md) · [Deutsch](./README.de.md) · [Português](./README.pt.md) · [Русский](./README.ru.md) · [हिन्दी](./README.hi.md) · [Türkçe](./README.tr.md) · [**ไทย**](./README.th.md) · [Tiếng Việt](./README.vi.md) · [Bahasa Indonesia](./README.id.md)
4
+
5
+ CLI สำหรับ [OpenPencil](https://github.com/ZSeven-W/openpencil) — ควบคุมเครื่องมือออกแบบจากเทอร์มินัลของคุณ
6
+
7
+ ## การติดตั้ง
8
+
9
+ ```bash
10
+ npm install -g @zseven-w/openpencil
11
+ ```
12
+
13
+ ## การรองรับแพลตฟอร์ม
14
+
15
+ CLI จะตรวจจับและเปิดแอปเดสก์ท็อป OpenPencil โดยอัตโนมัติบนทุกแพลตฟอร์ม:
16
+
17
+ | แพลตฟอร์ม | เส้นทางการติดตั้งที่ตรวจพบ |
18
+ | ----------- | --------------------------------------------------------------------------------------------------- |
19
+ | **macOS** | `/Applications/OpenPencil.app`, `~/Applications/OpenPencil.app` |
20
+ | **Windows** | NSIS ต่อผู้ใช้ (`%LOCALAPPDATA%`), ต่อเครื่อง (`%PROGRAMFILES%`), แบบพกพา |
21
+ | **Linux** | `/usr/bin`, `/usr/local/bin`, `~/.local/bin`, AppImage (`~/Applications`, `~/Downloads`), Snap, Flatpak |
22
+
23
+ ## การใช้งาน
24
+
25
+ ```bash
26
+ op <คำสั่ง> [ตัวเลือก]
27
+ ```
28
+
29
+ ### วิธีการป้อนข้อมูล
30
+
31
+ อาร์กิวเมนต์ที่รับ JSON หรือ DSL สามารถส่งได้สามวิธี:
32
+
33
+ ```bash
34
+ op design '...' # ข้อความแบบอินไลน์ (ข้อมูลขนาดเล็ก)
35
+ op design @design.txt # อ่านจากไฟล์ (แนะนำสำหรับการออกแบบขนาดใหญ่)
36
+ cat design.txt | op design - # อ่านจาก stdin (การไพพ์)
37
+ ```
38
+
39
+ ### การควบคุมแอป
40
+
41
+ ```bash
42
+ op start [--desktop|--web] # เปิด OpenPencil (เดสก์ท็อปเป็นค่าเริ่มต้น)
43
+ op stop # หยุดอินสแตนซ์ที่กำลังทำงาน
44
+ op status # ตรวจสอบว่ากำลังทำงานอยู่หรือไม่
45
+ ```
46
+
47
+ ### การออกแบบ (Batch DSL)
48
+
49
+ ```bash
50
+ op design <dsl|@file|-> [--post-process] [--canvas-width N]
51
+ op design:skeleton <json|@file|->
52
+ op design:content <section-id> <json|@file|->
53
+ op design:refine --root-id <id>
54
+ ```
55
+
56
+ ### การดำเนินการเอกสาร
57
+
58
+ ```bash
59
+ op open [file.op] # เปิดไฟล์หรือเชื่อมต่อกับแคนวาสสด
60
+ op save <file.op> # บันทึกเอกสารปัจจุบัน
61
+ op get [--type X] [--name Y] [--id Z] [--depth N]
62
+ op selection # รับการเลือกแคนวาสปัจจุบัน
63
+ ```
64
+
65
+ ### การจัดการโหนด
66
+
67
+ ```bash
68
+ op insert <json> [--parent P] [--index N] [--post-process]
69
+ op update <id> <json> [--post-process]
70
+ op delete <id>
71
+ op move <id> --parent <P> [--index N]
72
+ op copy <id> [--parent P]
73
+ op replace <id> <json> [--post-process]
74
+ ```
75
+
76
+ ### การส่งออกโค้ด
77
+
78
+ ```bash
79
+ op export <format> [--out file]
80
+ # รูปแบบ: react, html, vue, svelte, flutter, swiftui, compose, rn, css
81
+ ```
82
+
83
+ ### ตัวแปรและธีม
84
+
85
+ ```bash
86
+ op vars # รับตัวแปร
87
+ op vars:set <json> # ตั้งค่าตัวแปร
88
+ op themes # รับธีม
89
+ op themes:set <json> # ตั้งค่าธีม
90
+ op theme:save <file.optheme> # บันทึกพรีเซ็ตธีม
91
+ op theme:load <file.optheme> # โหลดพรีเซ็ตธีม
92
+ op theme:list [dir] # แสดงรายการพรีเซ็ตธีม
93
+ ```
94
+
95
+ ### หน้า
96
+
97
+ ```bash
98
+ op page list # แสดงรายการหน้า
99
+ op page add [--name N] # เพิ่มหน้า
100
+ op page remove <id> # ลบหน้า
101
+ op page rename <id> <name> # เปลี่ยนชื่อหน้า
102
+ op page reorder <id> <index> # จัดลำดับหน้าใหม่
103
+ op page duplicate <id> # ทำสำเนาหน้า
104
+ ```
105
+
106
+ ### การนำเข้า
107
+
108
+ ```bash
109
+ op import:svg <file.svg> # นำเข้าไฟล์ SVG
110
+ op import:figma <file.fig> # นำเข้าไฟล์ Figma .fig
111
+ ```
112
+
113
+ ### เลย์เอาต์
114
+
115
+ ```bash
116
+ op layout [--parent P] [--depth N]
117
+ op find-space [--direction right|bottom|left|top]
118
+ ```
119
+
120
+ ### แฟล็กทั่วไป
121
+
122
+ ```text
123
+ --file <path> ไฟล์ .op เป้าหมาย (ค่าเริ่มต้น: แคนวาสสด)
124
+ --page <id> ID หน้าเป้าหมาย
125
+ --pretty แสดงผล JSON แบบอ่านง่าย
126
+ --help แสดงความช่วยเหลือ
127
+ --version แสดงเวอร์ชัน
128
+ ```
129
+
130
+ ## สัญญาอนุญาต
131
+
132
+ MIT
package/README.tr.md ADDED
@@ -0,0 +1,132 @@
1
+ # @zseven-w/openpencil
2
+
3
+ [English](./README.md) · [简体中文](./README.zh.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Français](./README.fr.md) · [Español](./README.es.md) · [Deutsch](./README.de.md) · [Português](./README.pt.md) · [Русский](./README.ru.md) · [हिन्दी](./README.hi.md) · [**Türkçe**](./README.tr.md) · [ไทย](./README.th.md) · [Tiếng Việt](./README.vi.md) · [Bahasa Indonesia](./README.id.md)
4
+
5
+ [OpenPencil](https://github.com/ZSeven-W/openpencil) icin CLI — tasarim aracini terminalinizden kontrol edin.
6
+
7
+ ## Kurulum
8
+
9
+ ```bash
10
+ npm install -g @zseven-w/openpencil
11
+ ```
12
+
13
+ ## Platform Destegi
14
+
15
+ CLI, tum platformlarda OpenPencil masaustu uygulamasini otomatik olarak algilar ve baslatir:
16
+
17
+ | Platform | Algilanan kurulum yollari |
18
+ | ----------- | --------------------------------------------------------------------------------------------------- |
19
+ | **macOS** | `/Applications/OpenPencil.app`, `~/Applications/OpenPencil.app` |
20
+ | **Windows** | Kullanici basina NSIS (`%LOCALAPPDATA%`), makine basina (`%PROGRAMFILES%`), tasinabilir |
21
+ | **Linux** | `/usr/bin`, `/usr/local/bin`, `~/.local/bin`, AppImage (`~/Applications`, `~/Downloads`), Snap, Flatpak |
22
+
23
+ ## Kullanim
24
+
25
+ ```bash
26
+ op <komut> [secenekler]
27
+ ```
28
+
29
+ ### Girdi Yontemleri
30
+
31
+ JSON veya DSL kabul eden argumanlar uc sekilde iletilebilir:
32
+
33
+ ```bash
34
+ op design '...' # Satir ici metin (kucuk veriler)
35
+ op design @design.txt # Dosyadan oku (buyuk tasarimlar icin onerilir)
36
+ cat design.txt | op design - # Stdin'den oku (borulama)
37
+ ```
38
+
39
+ ### Uygulama Kontrolu
40
+
41
+ ```bash
42
+ op start [--desktop|--web] # OpenPencil'i baslat (varsayilan: masaustu)
43
+ op stop # Calisan ornegi durdur
44
+ op status # Calisip calismadigini kontrol et
45
+ ```
46
+
47
+ ### Tasarim (Toplu DSL)
48
+
49
+ ```bash
50
+ op design <dsl|@dosya|-> [--post-process] [--canvas-width N]
51
+ op design:skeleton <json|@dosya|->
52
+ op design:content <bolum-id> <json|@dosya|->
53
+ op design:refine --root-id <id>
54
+ ```
55
+
56
+ ### Belge Islemleri
57
+
58
+ ```bash
59
+ op open [dosya.op] # Dosya ac veya canli tuvale baglan
60
+ op save <dosya.op> # Mevcut belgeyi kaydet
61
+ op get [--type X] [--name Y] [--id Z] [--depth N]
62
+ op selection # Mevcut tuval secimini al
63
+ ```
64
+
65
+ ### Dugum Manipulasyonu
66
+
67
+ ```bash
68
+ op insert <json> [--parent P] [--index N] [--post-process]
69
+ op update <id> <json> [--post-process]
70
+ op delete <id>
71
+ op move <id> --parent <P> [--index N]
72
+ op copy <id> [--parent P]
73
+ op replace <id> <json> [--post-process]
74
+ ```
75
+
76
+ ### Kod Disari Aktarimi
77
+
78
+ ```bash
79
+ op export <format> [--out dosya]
80
+ # Formatlar: react, html, vue, svelte, flutter, swiftui, compose, rn, css
81
+ ```
82
+
83
+ ### Degiskenler ve Temalar
84
+
85
+ ```bash
86
+ op vars # Degiskenleri al
87
+ op vars:set <json> # Degiskenleri ayarla
88
+ op themes # Temalari al
89
+ op themes:set <json> # Temalari ayarla
90
+ op theme:save <dosya.optheme> # Tema onayarini kaydet
91
+ op theme:load <dosya.optheme> # Tema onayarini yukle
92
+ op theme:list [dizin] # Tema onayarlarini listele
93
+ ```
94
+
95
+ ### Sayfalar
96
+
97
+ ```bash
98
+ op page list # Sayfalari listele
99
+ op page add [--name N] # Sayfa ekle
100
+ op page remove <id> # Sayfa kaldir
101
+ op page rename <id> <ad> # Sayfayi yeniden adlandir
102
+ op page reorder <id> <indeks> # Sayfayi yeniden sirala
103
+ op page duplicate <id> # Sayfayi cogalt
104
+ ```
105
+
106
+ ### Iceri Aktarma
107
+
108
+ ```bash
109
+ op import:svg <dosya.svg> # SVG dosyasi iceri aktar
110
+ op import:figma <dosya.fig> # Figma .fig dosyasi iceri aktar
111
+ ```
112
+
113
+ ### Yerlesim
114
+
115
+ ```bash
116
+ op layout [--parent P] [--depth N]
117
+ op find-space [--direction right|bottom|left|top]
118
+ ```
119
+
120
+ ### Genel Bayraklar
121
+
122
+ ```text
123
+ --file <yol> Hedef .op dosyasi (varsayilan: canli tuval)
124
+ --page <id> Hedef sayfa kimligi
125
+ --pretty Okunabilir JSON ciktisi
126
+ --help Yardimi goster
127
+ --version Surumu goster
128
+ ```
129
+
130
+ ## Lisans
131
+
132
+ MIT
package/README.vi.md ADDED
@@ -0,0 +1,132 @@
1
+ # @zseven-w/openpencil
2
+
3
+ [English](./README.md) · [简体中文](./README.zh.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Français](./README.fr.md) · [Español](./README.es.md) · [Deutsch](./README.de.md) · [Português](./README.pt.md) · [Русский](./README.ru.md) · [हिन्दी](./README.hi.md) · [Türkçe](./README.tr.md) · [ไทย](./README.th.md) · [**Tiếng Việt**](./README.vi.md) · [Bahasa Indonesia](./README.id.md)
4
+
5
+ CLI cho [OpenPencil](https://github.com/ZSeven-W/openpencil) — điều khiển công cụ thiết kế từ terminal của bạn.
6
+
7
+ ## Cài đặt
8
+
9
+ ```bash
10
+ npm install -g @zseven-w/openpencil
11
+ ```
12
+
13
+ ## Hỗ trợ nền tảng
14
+
15
+ CLI tự động phát hiện và khởi chạy ứng dụng desktop OpenPencil trên tất cả các nền tảng:
16
+
17
+ | Nền tảng | Đường dẫn cài đặt được phát hiện |
18
+ | ----------- | --------------------------------------------------------------------------------------------------- |
19
+ | **macOS** | `/Applications/OpenPencil.app`, `~/Applications/OpenPencil.app` |
20
+ | **Windows** | NSIS theo người dùng (`%LOCALAPPDATA%`), theo máy (`%PROGRAMFILES%`), di động |
21
+ | **Linux** | `/usr/bin`, `/usr/local/bin`, `~/.local/bin`, AppImage (`~/Applications`, `~/Downloads`), Snap, Flatpak |
22
+
23
+ ## Sử dụng
24
+
25
+ ```bash
26
+ op <lệnh> [tùy-chọn]
27
+ ```
28
+
29
+ ### Phương thức nhập liệu
30
+
31
+ Các đối số chấp nhận JSON hoặc DSL có thể được truyền theo ba cách:
32
+
33
+ ```bash
34
+ op design '...' # Chuỗi nội tuyến (dữ liệu nhỏ)
35
+ op design @design.txt # Đọc từ tệp (khuyến nghị cho thiết kế lớn)
36
+ cat design.txt | op design - # Đọc từ stdin (đường ống)
37
+ ```
38
+
39
+ ### Điều khiển ứng dụng
40
+
41
+ ```bash
42
+ op start [--desktop|--web] # Khởi chạy OpenPencil (mặc định: desktop)
43
+ op stop # Dừng phiên bản đang chạy
44
+ op status # Kiểm tra trạng thái hoạt động
45
+ ```
46
+
47
+ ### Thiết kế (Batch DSL)
48
+
49
+ ```bash
50
+ op design <dsl|@file|-> [--post-process] [--canvas-width N]
51
+ op design:skeleton <json|@file|->
52
+ op design:content <section-id> <json|@file|->
53
+ op design:refine --root-id <id>
54
+ ```
55
+
56
+ ### Thao tác tài liệu
57
+
58
+ ```bash
59
+ op open [file.op] # Mở tệp hoặc kết nối với canvas trực tiếp
60
+ op save <file.op> # Lưu tài liệu hiện tại
61
+ op get [--type X] [--name Y] [--id Z] [--depth N]
62
+ op selection # Lấy vùng chọn canvas hiện tại
63
+ ```
64
+
65
+ ### Thao tác nút
66
+
67
+ ```bash
68
+ op insert <json> [--parent P] [--index N] [--post-process]
69
+ op update <id> <json> [--post-process]
70
+ op delete <id>
71
+ op move <id> --parent <P> [--index N]
72
+ op copy <id> [--parent P]
73
+ op replace <id> <json> [--post-process]
74
+ ```
75
+
76
+ ### Xuất mã nguồn
77
+
78
+ ```bash
79
+ op export <format> [--out file]
80
+ # Định dạng: react, html, vue, svelte, flutter, swiftui, compose, rn, css
81
+ ```
82
+
83
+ ### Biến và giao diện
84
+
85
+ ```bash
86
+ op vars # Lấy biến
87
+ op vars:set <json> # Đặt biến
88
+ op themes # Lấy giao diện
89
+ op themes:set <json> # Đặt giao diện
90
+ op theme:save <file.optheme> # Lưu bộ giao diện mẫu
91
+ op theme:load <file.optheme> # Tải bộ giao diện mẫu
92
+ op theme:list [dir] # Liệt kê bộ giao diện mẫu
93
+ ```
94
+
95
+ ### Trang
96
+
97
+ ```bash
98
+ op page list # Liệt kê trang
99
+ op page add [--name N] # Thêm trang
100
+ op page remove <id> # Xóa trang
101
+ op page rename <id> <name> # Đổi tên trang
102
+ op page reorder <id> <index> # Sắp xếp lại trang
103
+ op page duplicate <id> # Nhân bản trang
104
+ ```
105
+
106
+ ### Nhập
107
+
108
+ ```bash
109
+ op import:svg <file.svg> # Nhập tệp SVG
110
+ op import:figma <file.fig> # Nhập tệp Figma .fig
111
+ ```
112
+
113
+ ### Bố cục
114
+
115
+ ```bash
116
+ op layout [--parent P] [--depth N]
117
+ op find-space [--direction right|bottom|left|top]
118
+ ```
119
+
120
+ ### Cờ toàn cục
121
+
122
+ ```text
123
+ --file <path> Tệp .op đích (mặc định: canvas trực tiếp)
124
+ --page <id> ID trang đích
125
+ --pretty Xuất JSON dễ đọc
126
+ --help Hiển thị trợ giúp
127
+ --version Hiển thị phiên bản
128
+ ```
129
+
130
+ ## Giấy phép
131
+
132
+ MIT
@@ -0,0 +1,132 @@
1
+ # @zseven-w/openpencil
2
+
3
+ [English](./README.md) · [简体中文](./README.zh.md) · [**繁體中文**](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Français](./README.fr.md) · [Español](./README.es.md) · [Deutsch](./README.de.md) · [Português](./README.pt.md) · [Русский](./README.ru.md) · [हिन्दी](./README.hi.md) · [Türkçe](./README.tr.md) · [ไทย](./README.th.md) · [Tiếng Việt](./README.vi.md) · [Bahasa Indonesia](./README.id.md)
4
+
5
+ [OpenPencil](https://github.com/ZSeven-W/openpencil) 的命令列工具 — 從終端機控制設計工具。
6
+
7
+ ## 安裝
8
+
9
+ ```bash
10
+ npm install -g @zseven-w/openpencil
11
+ ```
12
+
13
+ ## 平台支援
14
+
15
+ CLI 會自動偵測並啟動所有平台上的 OpenPencil 桌面應用程式:
16
+
17
+ | 平台 | 偵測的安裝路徑 |
18
+ | ----------- | --------------------------------------------------------------------------------------------------- |
19
+ | **macOS** | `/Applications/OpenPencil.app`、`~/Applications/OpenPencil.app` |
20
+ | **Windows** | NSIS 使用者安裝(`%LOCALAPPDATA%`)、全域安裝(`%PROGRAMFILES%`)、可攜版 |
21
+ | **Linux** | `/usr/bin`、`/usr/local/bin`、`~/.local/bin`、AppImage(`~/Applications`、`~/Downloads`)、Snap、Flatpak |
22
+
23
+ ## 使用方式
24
+
25
+ ```bash
26
+ op <command> [options]
27
+ ```
28
+
29
+ ### 輸入方式
30
+
31
+ 接受 JSON 或 DSL 的參數可透過三種方式傳入:
32
+
33
+ ```bash
34
+ op design '...' # 內嵌字串(適合小型內容)
35
+ op design @design.txt # 從檔案讀取(建議用於大型設計)
36
+ cat design.txt | op design - # 從標準輸入讀取(管線傳輸)
37
+ ```
38
+
39
+ ### 應用程式控制
40
+
41
+ ```bash
42
+ op start [--desktop|--web] # 啟動 OpenPencil(預設為桌面版)
43
+ op stop # 停止執行中的實例
44
+ op status # 檢查是否正在執行
45
+ ```
46
+
47
+ ### 設計(批次 DSL)
48
+
49
+ ```bash
50
+ op design <dsl|@file|-> [--post-process] [--canvas-width N]
51
+ op design:skeleton <json|@file|->
52
+ op design:content <section-id> <json|@file|->
53
+ op design:refine --root-id <id>
54
+ ```
55
+
56
+ ### 文件操作
57
+
58
+ ```bash
59
+ op open [file.op] # 開啟檔案或連線至即時畫布
60
+ op save <file.op> # 儲存目前的文件
61
+ op get [--type X] [--name Y] [--id Z] [--depth N]
62
+ op selection # 取得目前畫布的選取項目
63
+ ```
64
+
65
+ ### 節點操作
66
+
67
+ ```bash
68
+ op insert <json> [--parent P] [--index N] [--post-process]
69
+ op update <id> <json> [--post-process]
70
+ op delete <id>
71
+ op move <id> --parent <P> [--index N]
72
+ op copy <id> [--parent P]
73
+ op replace <id> <json> [--post-process]
74
+ ```
75
+
76
+ ### 程式碼匯出
77
+
78
+ ```bash
79
+ op export <format> [--out file]
80
+ # 格式:react, html, vue, svelte, flutter, swiftui, compose, rn, css
81
+ ```
82
+
83
+ ### 變數與主題
84
+
85
+ ```bash
86
+ op vars # 取得變數
87
+ op vars:set <json> # 設定變數
88
+ op themes # 取得主題
89
+ op themes:set <json> # 設定主題
90
+ op theme:save <file.optheme> # 儲存主題預設
91
+ op theme:load <file.optheme> # 載入主題預設
92
+ op theme:list [dir] # 列出主題預設
93
+ ```
94
+
95
+ ### 頁面
96
+
97
+ ```bash
98
+ op page list # 列出頁面
99
+ op page add [--name N] # 新增頁面
100
+ op page remove <id> # 移除頁面
101
+ op page rename <id> <name> # 重新命名頁面
102
+ op page reorder <id> <index> # 重新排序頁面
103
+ op page duplicate <id> # 複製頁面
104
+ ```
105
+
106
+ ### 匯入
107
+
108
+ ```bash
109
+ op import:svg <file.svg> # 匯入 SVG 檔案
110
+ op import:figma <file.fig> # 匯入 Figma .fig 檔案
111
+ ```
112
+
113
+ ### 版面配置
114
+
115
+ ```bash
116
+ op layout [--parent P] [--depth N]
117
+ op find-space [--direction right|bottom|left|top]
118
+ ```
119
+
120
+ ### 全域旗標
121
+
122
+ ```text
123
+ --file <path> 目標 .op 檔案(預設:即時畫布)
124
+ --page <id> 目標頁面 ID
125
+ --pretty 人類可讀的 JSON 輸出
126
+ --help 顯示說明
127
+ --version 顯示版本
128
+ ```
129
+
130
+ ## 授權條款
131
+
132
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,132 @@
1
+ # @zseven-w/openpencil
2
+
3
+ [English](./README.md) · [**简体中文**](./README.zh.md) · [繁體中文](./README.zh-TW.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md) · [Français](./README.fr.md) · [Español](./README.es.md) · [Deutsch](./README.de.md) · [Português](./README.pt.md) · [Русский](./README.ru.md) · [हिन्दी](./README.hi.md) · [Türkçe](./README.tr.md) · [ไทย](./README.th.md) · [Tiếng Việt](./README.vi.md) · [Bahasa Indonesia](./README.id.md)
4
+
5
+ [OpenPencil](https://github.com/ZSeven-W/openpencil) 的命令行工具 — 从终端控制设计工具。
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ npm install -g @zseven-w/openpencil
11
+ ```
12
+
13
+ ## 平台支持
14
+
15
+ CLI 会自动检测并启动各平台上的 OpenPencil 桌面应用:
16
+
17
+ | 平台 | 检测的安装路径 |
18
+ | ----------- | --------------------------------------------------------------------------------------------------- |
19
+ | **macOS** | `/Applications/OpenPencil.app`, `~/Applications/OpenPencil.app` |
20
+ | **Windows** | NSIS 用户级 (`%LOCALAPPDATA%`)、系统级 (`%PROGRAMFILES%`)、便携版 |
21
+ | **Linux** | `/usr/bin`, `/usr/local/bin`, `~/.local/bin`, AppImage (`~/Applications`, `~/Downloads`), Snap, Flatpak |
22
+
23
+ ## 用法
24
+
25
+ ```bash
26
+ op <command> [options]
27
+ ```
28
+
29
+ ### 输入方式
30
+
31
+ 接受 JSON 或 DSL 的参数支持三种传入方式:
32
+
33
+ ```bash
34
+ op design '...' # 内联字符串(适合小型内容)
35
+ op design @design.txt # 从文件读取(推荐用于大型设计)
36
+ cat design.txt | op design - # 从标准输入读取(管道传入)
37
+ ```
38
+
39
+ ### 应用控制
40
+
41
+ ```bash
42
+ op start [--desktop|--web] # 启动 OpenPencil(默认桌面版)
43
+ op stop # 停止运行中的实例
44
+ op status # 检查运行状态
45
+ ```
46
+
47
+ ### 设计(批量 DSL)
48
+
49
+ ```bash
50
+ op design <dsl|@file|-> [--post-process] [--canvas-width N]
51
+ op design:skeleton <json|@file|->
52
+ op design:content <section-id> <json|@file|->
53
+ op design:refine --root-id <id>
54
+ ```
55
+
56
+ ### 文档操作
57
+
58
+ ```bash
59
+ op open [file.op] # 打开文件或连接到实时画布
60
+ op save <file.op> # 保存当前文档
61
+ op get [--type X] [--name Y] [--id Z] [--depth N]
62
+ op selection # 获取当前画布选中项
63
+ ```
64
+
65
+ ### 节点操作
66
+
67
+ ```bash
68
+ op insert <json> [--parent P] [--index N] [--post-process]
69
+ op update <id> <json> [--post-process]
70
+ op delete <id>
71
+ op move <id> --parent <P> [--index N]
72
+ op copy <id> [--parent P]
73
+ op replace <id> <json> [--post-process]
74
+ ```
75
+
76
+ ### 代码导出
77
+
78
+ ```bash
79
+ op export <format> [--out file]
80
+ # 格式:react, html, vue, svelte, flutter, swiftui, compose, rn, css
81
+ ```
82
+
83
+ ### 变量与主题
84
+
85
+ ```bash
86
+ op vars # 获取变量
87
+ op vars:set <json> # 设置变量
88
+ op themes # 获取主题
89
+ op themes:set <json> # 设置主题
90
+ op theme:save <file.optheme> # 保存主题预设
91
+ op theme:load <file.optheme> # 加载主题预设
92
+ op theme:list [dir] # 列出主题预设
93
+ ```
94
+
95
+ ### 页面
96
+
97
+ ```bash
98
+ op page list # 列出页面
99
+ op page add [--name N] # 添加页面
100
+ op page remove <id> # 删除页面
101
+ op page rename <id> <name> # 重命名页面
102
+ op page reorder <id> <index> # 调整页面顺序
103
+ op page duplicate <id> # 复制页面
104
+ ```
105
+
106
+ ### 导入
107
+
108
+ ```bash
109
+ op import:svg <file.svg> # 导入 SVG 文件
110
+ op import:figma <file.fig> # 导入 Figma .fig 文件
111
+ ```
112
+
113
+ ### 布局
114
+
115
+ ```bash
116
+ op layout [--parent P] [--depth N]
117
+ op find-space [--direction right|bottom|left|top]
118
+ ```
119
+
120
+ ### 全局选项
121
+
122
+ ```text
123
+ --file <path> 目标 .op 文件(默认:实时画布)
124
+ --page <id> 目标页面 ID
125
+ --pretty 人类可读的 JSON 输出
126
+ --help 显示帮助
127
+ --version 显示版本
128
+ ```
129
+
130
+ ## 许可证
131
+
132
+ MIT