@jackwener/opencli 0.9.4 → 0.9.6
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.md +5 -10
- package/README.zh-CN.md +4 -3
- package/dist/cli-manifest.json +287 -4
- package/dist/clis/antigravity/model.js +2 -2
- package/dist/clis/antigravity/send.js +2 -2
- package/dist/clis/chatgpt/ask.d.ts +1 -0
- package/dist/clis/chatgpt/ask.js +68 -0
- package/dist/clis/chatgpt/new.d.ts +1 -0
- package/dist/clis/chatgpt/new.js +23 -0
- package/dist/clis/chatgpt/read.d.ts +1 -0
- package/dist/clis/chatgpt/read.js +28 -0
- package/dist/clis/chatgpt/send.d.ts +1 -0
- package/dist/clis/chatgpt/send.js +42 -0
- package/dist/clis/chatgpt/status.d.ts +1 -0
- package/dist/clis/chatgpt/status.js +21 -0
- package/dist/clis/codex/ask.d.ts +1 -0
- package/dist/clis/codex/ask.js +67 -0
- package/dist/clis/codex/export.d.ts +1 -0
- package/dist/clis/codex/export.js +37 -0
- package/dist/clis/codex/history.d.ts +1 -0
- package/dist/clis/codex/history.js +43 -0
- package/dist/clis/codex/read.js +3 -5
- package/dist/clis/codex/screenshot.d.ts +1 -0
- package/dist/clis/codex/screenshot.js +27 -0
- package/dist/clis/codex/send.js +3 -6
- package/dist/clis/codex/status.js +2 -1
- package/dist/clis/cursor/ask.d.ts +1 -0
- package/dist/clis/cursor/ask.js +69 -0
- package/dist/clis/cursor/composer.js +9 -28
- package/dist/clis/cursor/export.d.ts +1 -0
- package/dist/clis/cursor/export.js +51 -0
- package/dist/clis/cursor/history.d.ts +1 -0
- package/dist/clis/cursor/history.js +43 -0
- package/dist/clis/cursor/new.js +4 -13
- package/dist/clis/cursor/screenshot.d.ts +1 -0
- package/dist/clis/cursor/screenshot.js +31 -0
- package/package.json +1 -1
- package/src/clis/antigravity/README.md +2 -3
- package/src/clis/antigravity/README.zh-CN.md +2 -3
- package/src/clis/antigravity/SKILL.md +1 -1
- package/src/clis/antigravity/model.ts +2 -2
- package/src/clis/antigravity/send.ts +2 -2
- package/src/clis/chatgpt/README.md +44 -0
- package/src/clis/chatgpt/README.zh-CN.md +44 -0
- package/src/clis/chatgpt/ask.ts +77 -0
- package/src/clis/chatgpt/new.ts +24 -0
- package/src/clis/chatgpt/read.ts +32 -0
- package/src/clis/chatgpt/send.ts +48 -0
- package/src/clis/chatgpt/status.ts +22 -0
- package/src/clis/codex/README.md +1 -0
- package/src/clis/codex/ask.ts +77 -0
- package/src/clis/codex/export.ts +42 -0
- package/src/clis/codex/extract-diff.ts +1 -0
- package/src/clis/codex/history.ts +47 -0
- package/src/clis/codex/read.ts +5 -6
- package/src/clis/codex/screenshot.ts +33 -0
- package/src/clis/codex/send.ts +6 -7
- package/src/clis/codex/status.ts +4 -2
- package/src/clis/cursor/README.md +33 -0
- package/src/clis/cursor/README.zh-CN.md +33 -0
- package/src/clis/cursor/ask.ts +81 -0
- package/src/clis/cursor/composer.ts +9 -30
- package/src/clis/cursor/export.ts +57 -0
- package/src/clis/cursor/history.ts +47 -0
- package/src/clis/cursor/new.ts +4 -15
- package/src/clis/cursor/screenshot.ts +38 -0
package/README.md
CHANGED
|
@@ -143,25 +143,20 @@ npm install -g @jackwener/opencli@latest
|
|
|
143
143
|
|
|
144
144
|
## Built-in Commands
|
|
145
145
|
|
|
146
|
-
**
|
|
146
|
+
**26 sites · 128 commands** — run `opencli list` for the live registry.
|
|
147
147
|
|
|
148
148
|
| Site | Commands | Count | Mode |
|
|
149
149
|
|------|----------|:-----:|------|
|
|
150
150
|
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` | 18 | 🔐 Browser |
|
|
151
151
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 15 | 🔐 Browser |
|
|
152
|
-
| **antigravity** | `status` `send` `read` `new` `evaluate` | 5 | 🖥️ Desktop |
|
|
153
|
-
| **bbc** | `news` | 1 | 🌐 Public |
|
|
154
152
|
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` | 11 | 🔐 Browser |
|
|
155
|
-
| **
|
|
156
|
-
| **codex** | `status` `send` `read` `new` `extract-diff` `model` |
|
|
157
|
-
| **coupang** | `search` `add-to-cart` | 2 | 🔐 Browser |
|
|
158
|
-
| **ctrip** | `search` | 1 | 🔐 Browser |
|
|
159
|
-
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` | 7 | 🖥️ Desktop |
|
|
160
|
-
| **github** | `search` | 1 | 🌐 Public |
|
|
161
|
-
| **hackernews** | `top` | 1 | 🌐 Public |
|
|
153
|
+
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 12 | 🖥️ Desktop |
|
|
154
|
+
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` | 10 | 🖥️ Desktop |
|
|
162
155
|
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` | 6 | 🌐 / 🔐 |
|
|
163
156
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 6 | 🔐 Browser |
|
|
157
|
+
| **antigravity** | `status` `send` `read` `new` `evaluate` | 5 | 🖥️ Desktop |
|
|
164
158
|
| **xiaohongshu** | `search` `notifications` `feed` `me` `user` | 5 | 🔐 Browser |
|
|
159
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` | 5 | 🖥️ Desktop |
|
|
165
160
|
| **xiaoyuzhou** | `podcast` `podcast-episodes` `episode` | 3 | 🌐 Public |
|
|
166
161
|
| **youtube** | `search` `video` `transcript` | 3 | 🔐 Browser |
|
|
167
162
|
| **zhihu** | `hot` `search` `question` | 3 | 🔐 Browser |
|
package/README.zh-CN.md
CHANGED
|
@@ -144,15 +144,16 @@ npm install -g @jackwener/opencli@latest
|
|
|
144
144
|
|
|
145
145
|
## 内置命令
|
|
146
146
|
|
|
147
|
-
**
|
|
147
|
+
**26 个站点 · 128 命令** — 运行 `opencli list` 查看完整注册表。
|
|
148
148
|
|
|
149
149
|
| 站点 | 命令 | 数量 | 模式 |
|
|
150
150
|
|------|------|:----:|------|
|
|
151
151
|
| **twitter** | `trending` `bookmarks` `profile` `search` `timeline` `thread` `following` `followers` `notifications` `post` `reply` `delete` `like` `article` `follow` `unfollow` `bookmark` `unbookmark` | 18 | 🔐 浏览器 |
|
|
152
152
|
| **reddit** | `hot` `frontpage` `popular` `search` `subreddit` `read` `user` `user-posts` `user-comments` `upvote` `save` `comment` `subscribe` `saved` `upvoted` | 15 | 🔐 浏览器 |
|
|
153
153
|
| **antigravity** | `status` `send` `read` `new` `evaluate` | 5 | 🖥️ 桌面端 |
|
|
154
|
-
| **
|
|
155
|
-
| **
|
|
154
|
+
| **chatgpt** | `status` `new` `send` `read` `ask` | 5 | 🖥️ 桌面端 |
|
|
155
|
+
| **codex** | `status` `send` `read` `new` `extract-diff` `model` `ask` `screenshot` `history` `export` | 10 | 🖥️ 桌面端 |
|
|
156
|
+
| **cursor** | `status` `send` `read` `new` `dump` `composer` `model` `extract-code` `ask` `screenshot` `history` `export` | 12 | 🖥️ 桌面端 |
|
|
156
157
|
| **bilibili** | `hot` `search` `me` `favorite` `history` `feed` `subtitle` `dynamic` `ranking` `following` `user-videos` | 11 | 🔐 浏览器 |
|
|
157
158
|
| **v2ex** | `hot` `latest` `topic` `daily` `me` `notifications` | 6 | 🌐 / 🔐 |
|
|
158
159
|
| **xueqiu** | `feed` `hot-stock` `hot` `search` `stock` `watchlist` | 6 | 🔐 浏览器 |
|
package/dist/cli-manifest.json
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"modulePath": "antigravity/model.js",
|
|
48
48
|
"domain": "localhost",
|
|
49
49
|
"columns": [
|
|
50
|
-
"
|
|
50
|
+
"Status"
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"modulePath": "antigravity/send.js",
|
|
106
106
|
"domain": "localhost",
|
|
107
107
|
"columns": [
|
|
108
|
-
"
|
|
109
|
-
"
|
|
108
|
+
"Status",
|
|
109
|
+
"Message"
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
112
|
{
|
|
@@ -810,6 +810,131 @@
|
|
|
810
810
|
"url"
|
|
811
811
|
]
|
|
812
812
|
},
|
|
813
|
+
{
|
|
814
|
+
"site": "chatgpt",
|
|
815
|
+
"name": "ask",
|
|
816
|
+
"description": "Send a prompt and wait for the AI response (send + wait + read)",
|
|
817
|
+
"strategy": "public",
|
|
818
|
+
"browser": false,
|
|
819
|
+
"args": [
|
|
820
|
+
{
|
|
821
|
+
"name": "text",
|
|
822
|
+
"type": "str",
|
|
823
|
+
"required": true,
|
|
824
|
+
"positional": true,
|
|
825
|
+
"help": "Prompt to send"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"name": "timeout",
|
|
829
|
+
"type": "str",
|
|
830
|
+
"default": "30)",
|
|
831
|
+
"required": false,
|
|
832
|
+
"help": "Max seconds to wait for response (default: 30)"
|
|
833
|
+
}
|
|
834
|
+
],
|
|
835
|
+
"type": "ts",
|
|
836
|
+
"modulePath": "chatgpt/ask.js",
|
|
837
|
+
"domain": "localhost",
|
|
838
|
+
"columns": [
|
|
839
|
+
"Role",
|
|
840
|
+
"Text"
|
|
841
|
+
]
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"site": "chatgpt",
|
|
845
|
+
"name": "new",
|
|
846
|
+
"description": "Open a new chat in ChatGPT Desktop App",
|
|
847
|
+
"strategy": "public",
|
|
848
|
+
"browser": false,
|
|
849
|
+
"args": [],
|
|
850
|
+
"type": "ts",
|
|
851
|
+
"modulePath": "chatgpt/new.js",
|
|
852
|
+
"domain": "localhost",
|
|
853
|
+
"columns": [
|
|
854
|
+
"Status"
|
|
855
|
+
]
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"site": "chatgpt",
|
|
859
|
+
"name": "read",
|
|
860
|
+
"description": "Copy the most recent ChatGPT Desktop App response to clipboard and read it",
|
|
861
|
+
"strategy": "public",
|
|
862
|
+
"browser": false,
|
|
863
|
+
"args": [],
|
|
864
|
+
"type": "ts",
|
|
865
|
+
"modulePath": "chatgpt/read.js",
|
|
866
|
+
"domain": "localhost",
|
|
867
|
+
"columns": [
|
|
868
|
+
"Role",
|
|
869
|
+
"Text"
|
|
870
|
+
]
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"site": "chatgpt",
|
|
874
|
+
"name": "send",
|
|
875
|
+
"description": "Send a message to the active ChatGPT Desktop App window",
|
|
876
|
+
"strategy": "public",
|
|
877
|
+
"browser": false,
|
|
878
|
+
"args": [
|
|
879
|
+
{
|
|
880
|
+
"name": "text",
|
|
881
|
+
"type": "str",
|
|
882
|
+
"required": true,
|
|
883
|
+
"positional": true,
|
|
884
|
+
"help": "Message to send"
|
|
885
|
+
}
|
|
886
|
+
],
|
|
887
|
+
"type": "ts",
|
|
888
|
+
"modulePath": "chatgpt/send.js",
|
|
889
|
+
"domain": "localhost",
|
|
890
|
+
"columns": [
|
|
891
|
+
"Status"
|
|
892
|
+
]
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
"site": "chatgpt",
|
|
896
|
+
"name": "status",
|
|
897
|
+
"description": "Check if ChatGPT Desktop App is running natively on macOS",
|
|
898
|
+
"strategy": "public",
|
|
899
|
+
"browser": false,
|
|
900
|
+
"args": [],
|
|
901
|
+
"type": "ts",
|
|
902
|
+
"modulePath": "chatgpt/status.js",
|
|
903
|
+
"domain": "localhost",
|
|
904
|
+
"columns": [
|
|
905
|
+
"Status"
|
|
906
|
+
]
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
"site": "codex",
|
|
910
|
+
"name": "ask",
|
|
911
|
+
"description": "Send a prompt and wait for the AI response (send + wait + read)",
|
|
912
|
+
"strategy": "ui",
|
|
913
|
+
"browser": true,
|
|
914
|
+
"args": [
|
|
915
|
+
{
|
|
916
|
+
"name": "text",
|
|
917
|
+
"type": "str",
|
|
918
|
+
"required": true,
|
|
919
|
+
"positional": true,
|
|
920
|
+
"help": "Prompt to send"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"name": "timeout",
|
|
924
|
+
"type": "str",
|
|
925
|
+
"default": "60)",
|
|
926
|
+
"required": false,
|
|
927
|
+
"help": "Max seconds to wait for response (default: 60)"
|
|
928
|
+
}
|
|
929
|
+
],
|
|
930
|
+
"type": "ts",
|
|
931
|
+
"modulePath": "codex/ask.js",
|
|
932
|
+
"domain": "localhost",
|
|
933
|
+
"columns": [
|
|
934
|
+
"Role",
|
|
935
|
+
"Text"
|
|
936
|
+
]
|
|
937
|
+
},
|
|
813
938
|
{
|
|
814
939
|
"site": "codex",
|
|
815
940
|
"name": "dump",
|
|
@@ -825,6 +950,31 @@
|
|
|
825
950
|
"files"
|
|
826
951
|
]
|
|
827
952
|
},
|
|
953
|
+
{
|
|
954
|
+
"site": "codex",
|
|
955
|
+
"name": "export",
|
|
956
|
+
"description": "Export the current Codex conversation to a Markdown file",
|
|
957
|
+
"strategy": "ui",
|
|
958
|
+
"browser": true,
|
|
959
|
+
"args": [
|
|
960
|
+
{
|
|
961
|
+
"name": "output",
|
|
962
|
+
"type": "str",
|
|
963
|
+
"default": "/tmp/codex-export.md)",
|
|
964
|
+
"required": false,
|
|
965
|
+
"positional": true,
|
|
966
|
+
"help": "Output file (default: /tmp/codex-export.md)"
|
|
967
|
+
}
|
|
968
|
+
],
|
|
969
|
+
"type": "ts",
|
|
970
|
+
"modulePath": "codex/export.js",
|
|
971
|
+
"domain": "localhost",
|
|
972
|
+
"columns": [
|
|
973
|
+
"Status",
|
|
974
|
+
"File",
|
|
975
|
+
"Messages"
|
|
976
|
+
]
|
|
977
|
+
},
|
|
828
978
|
{
|
|
829
979
|
"site": "codex",
|
|
830
980
|
"name": "extract-diff",
|
|
@@ -840,6 +990,21 @@
|
|
|
840
990
|
"Diff"
|
|
841
991
|
]
|
|
842
992
|
},
|
|
993
|
+
{
|
|
994
|
+
"site": "codex",
|
|
995
|
+
"name": "history",
|
|
996
|
+
"description": "List recent conversation threads in Codex",
|
|
997
|
+
"strategy": "ui",
|
|
998
|
+
"browser": true,
|
|
999
|
+
"args": [],
|
|
1000
|
+
"type": "ts",
|
|
1001
|
+
"modulePath": "codex/history.js",
|
|
1002
|
+
"domain": "localhost",
|
|
1003
|
+
"columns": [
|
|
1004
|
+
"Index",
|
|
1005
|
+
"Title"
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
843
1008
|
{
|
|
844
1009
|
"site": "codex",
|
|
845
1010
|
"name": "model",
|
|
@@ -889,7 +1054,31 @@
|
|
|
889
1054
|
"modulePath": "codex/read.js",
|
|
890
1055
|
"domain": "localhost",
|
|
891
1056
|
"columns": [
|
|
892
|
-
"
|
|
1057
|
+
"Content"
|
|
1058
|
+
]
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
"site": "codex",
|
|
1062
|
+
"name": "screenshot",
|
|
1063
|
+
"description": "Capture a snapshot of the current Codex window (DOM + Accessibility tree)",
|
|
1064
|
+
"strategy": "ui",
|
|
1065
|
+
"browser": true,
|
|
1066
|
+
"args": [
|
|
1067
|
+
{
|
|
1068
|
+
"name": "output",
|
|
1069
|
+
"type": "str",
|
|
1070
|
+
"default": "/tmp/codex-snapshot.txt)",
|
|
1071
|
+
"required": false,
|
|
1072
|
+
"positional": true,
|
|
1073
|
+
"help": "Output file path (default: /tmp/codex-snapshot.txt)"
|
|
1074
|
+
}
|
|
1075
|
+
],
|
|
1076
|
+
"type": "ts",
|
|
1077
|
+
"modulePath": "codex/screenshot.js",
|
|
1078
|
+
"domain": "localhost",
|
|
1079
|
+
"columns": [
|
|
1080
|
+
"Status",
|
|
1081
|
+
"File"
|
|
893
1082
|
]
|
|
894
1083
|
},
|
|
895
1084
|
{
|
|
@@ -1044,6 +1233,36 @@
|
|
|
1044
1233
|
"url"
|
|
1045
1234
|
]
|
|
1046
1235
|
},
|
|
1236
|
+
{
|
|
1237
|
+
"site": "cursor",
|
|
1238
|
+
"name": "ask",
|
|
1239
|
+
"description": "Send a prompt and wait for the AI response (send + wait + read)",
|
|
1240
|
+
"strategy": "ui",
|
|
1241
|
+
"browser": true,
|
|
1242
|
+
"args": [
|
|
1243
|
+
{
|
|
1244
|
+
"name": "text",
|
|
1245
|
+
"type": "str",
|
|
1246
|
+
"required": true,
|
|
1247
|
+
"positional": true,
|
|
1248
|
+
"help": "Prompt to send"
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
"name": "timeout",
|
|
1252
|
+
"type": "str",
|
|
1253
|
+
"default": "30)",
|
|
1254
|
+
"required": false,
|
|
1255
|
+
"help": "Max seconds to wait for response (default: 30)"
|
|
1256
|
+
}
|
|
1257
|
+
],
|
|
1258
|
+
"type": "ts",
|
|
1259
|
+
"modulePath": "cursor/ask.js",
|
|
1260
|
+
"domain": "localhost",
|
|
1261
|
+
"columns": [
|
|
1262
|
+
"Role",
|
|
1263
|
+
"Text"
|
|
1264
|
+
]
|
|
1265
|
+
},
|
|
1047
1266
|
{
|
|
1048
1267
|
"site": "cursor",
|
|
1049
1268
|
"name": "composer",
|
|
@@ -1082,6 +1301,31 @@
|
|
|
1082
1301
|
"files"
|
|
1083
1302
|
]
|
|
1084
1303
|
},
|
|
1304
|
+
{
|
|
1305
|
+
"site": "cursor",
|
|
1306
|
+
"name": "export",
|
|
1307
|
+
"description": "Export the current ${site} conversation to a Markdown file",
|
|
1308
|
+
"strategy": "ui",
|
|
1309
|
+
"browser": true,
|
|
1310
|
+
"args": [
|
|
1311
|
+
{
|
|
1312
|
+
"name": "output",
|
|
1313
|
+
"type": "str",
|
|
1314
|
+
"default": "/tmp/${site",
|
|
1315
|
+
"required": false,
|
|
1316
|
+
"positional": true,
|
|
1317
|
+
"help": ""
|
|
1318
|
+
}
|
|
1319
|
+
],
|
|
1320
|
+
"type": "ts",
|
|
1321
|
+
"modulePath": "cursor/export.js",
|
|
1322
|
+
"domain": "localhost",
|
|
1323
|
+
"columns": [
|
|
1324
|
+
"Status",
|
|
1325
|
+
"File",
|
|
1326
|
+
"Messages"
|
|
1327
|
+
]
|
|
1328
|
+
},
|
|
1085
1329
|
{
|
|
1086
1330
|
"site": "cursor",
|
|
1087
1331
|
"name": "extract-code",
|
|
@@ -1096,6 +1340,21 @@
|
|
|
1096
1340
|
"Code"
|
|
1097
1341
|
]
|
|
1098
1342
|
},
|
|
1343
|
+
{
|
|
1344
|
+
"site": "cursor",
|
|
1345
|
+
"name": "history",
|
|
1346
|
+
"description": "List recent chat sessions from the Cursor sidebar",
|
|
1347
|
+
"strategy": "ui",
|
|
1348
|
+
"browser": true,
|
|
1349
|
+
"args": [],
|
|
1350
|
+
"type": "ts",
|
|
1351
|
+
"modulePath": "cursor/history.js",
|
|
1352
|
+
"domain": "localhost",
|
|
1353
|
+
"columns": [
|
|
1354
|
+
"Index",
|
|
1355
|
+
"Title"
|
|
1356
|
+
]
|
|
1357
|
+
},
|
|
1099
1358
|
{
|
|
1100
1359
|
"site": "cursor",
|
|
1101
1360
|
"name": "model",
|
|
@@ -1148,6 +1407,30 @@
|
|
|
1148
1407
|
"Text"
|
|
1149
1408
|
]
|
|
1150
1409
|
},
|
|
1410
|
+
{
|
|
1411
|
+
"site": "cursor",
|
|
1412
|
+
"name": "screenshot",
|
|
1413
|
+
"description": "Capture a snapshot of the current ${site} window (DOM + Accessibility tree)",
|
|
1414
|
+
"strategy": "ui",
|
|
1415
|
+
"browser": true,
|
|
1416
|
+
"args": [
|
|
1417
|
+
{
|
|
1418
|
+
"name": "output",
|
|
1419
|
+
"type": "str",
|
|
1420
|
+
"default": "/tmp/${site",
|
|
1421
|
+
"required": false,
|
|
1422
|
+
"positional": true,
|
|
1423
|
+
"help": ""
|
|
1424
|
+
}
|
|
1425
|
+
],
|
|
1426
|
+
"type": "ts",
|
|
1427
|
+
"modulePath": "cursor/screenshot.js",
|
|
1428
|
+
"domain": "localhost",
|
|
1429
|
+
"columns": [
|
|
1430
|
+
"Status",
|
|
1431
|
+
"File"
|
|
1432
|
+
]
|
|
1433
|
+
},
|
|
1151
1434
|
{
|
|
1152
1435
|
"site": "cursor",
|
|
1153
1436
|
"name": "send",
|
|
@@ -9,7 +9,7 @@ export const modelCommand = cli({
|
|
|
9
9
|
args: [
|
|
10
10
|
{ name: 'name', help: 'Target model name (e.g. claude, gemini, o1)', required: true, positional: true }
|
|
11
11
|
],
|
|
12
|
-
columns: ['
|
|
12
|
+
columns: ['Status'],
|
|
13
13
|
func: async (page, kwargs) => {
|
|
14
14
|
const targetName = kwargs.name.toLowerCase();
|
|
15
15
|
await page.evaluate(`
|
|
@@ -39,6 +39,6 @@ export const modelCommand = cli({
|
|
|
39
39
|
}
|
|
40
40
|
`);
|
|
41
41
|
await page.wait(0.5);
|
|
42
|
-
return [{
|
|
42
|
+
return [{ Status: `Model switched to: ${kwargs.name}` }];
|
|
43
43
|
},
|
|
44
44
|
});
|
|
@@ -9,7 +9,7 @@ export const sendCommand = cli({
|
|
|
9
9
|
args: [
|
|
10
10
|
{ name: 'message', help: 'The message text to send', required: true, positional: true }
|
|
11
11
|
],
|
|
12
|
-
columns: ['
|
|
12
|
+
columns: ['Status', 'Message'],
|
|
13
13
|
func: async (page, kwargs) => {
|
|
14
14
|
const text = kwargs.message;
|
|
15
15
|
// We use evaluate to focus and insert text because Lexical editors maintain
|
|
@@ -30,6 +30,6 @@ export const sendCommand = cli({
|
|
|
30
30
|
await page.wait(0.5);
|
|
31
31
|
// Press Enter to submit the message
|
|
32
32
|
await page.pressKey('Enter');
|
|
33
|
-
return [{
|
|
33
|
+
return [{ Status: 'Sent successfully', Message: text }];
|
|
34
34
|
},
|
|
35
35
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const askCommand: import("../../registry.js").CliCommand;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { execSync, spawnSync } from 'node:child_process';
|
|
2
|
+
import { cli, Strategy } from '../../registry.js';
|
|
3
|
+
export const askCommand = cli({
|
|
4
|
+
site: 'chatgpt',
|
|
5
|
+
name: 'ask',
|
|
6
|
+
description: 'Send a prompt and wait for the AI response (send + wait + read)',
|
|
7
|
+
domain: 'localhost',
|
|
8
|
+
strategy: Strategy.PUBLIC,
|
|
9
|
+
browser: false,
|
|
10
|
+
args: [
|
|
11
|
+
{ name: 'text', required: true, positional: true, help: 'Prompt to send' },
|
|
12
|
+
{ name: 'timeout', required: false, help: 'Max seconds to wait for response (default: 30)', default: '30' },
|
|
13
|
+
],
|
|
14
|
+
columns: ['Role', 'Text'],
|
|
15
|
+
func: async (page, kwargs) => {
|
|
16
|
+
const text = kwargs.text;
|
|
17
|
+
const timeout = parseInt(kwargs.timeout, 10) || 30;
|
|
18
|
+
// Backup clipboard
|
|
19
|
+
let clipBackup = '';
|
|
20
|
+
try {
|
|
21
|
+
clipBackup = execSync('pbpaste', { encoding: 'utf-8' });
|
|
22
|
+
}
|
|
23
|
+
catch { }
|
|
24
|
+
// Send the message
|
|
25
|
+
spawnSync('pbcopy', { input: text });
|
|
26
|
+
execSync("osascript -e 'tell application \"ChatGPT\" to activate'");
|
|
27
|
+
execSync("osascript -e 'delay 0.5'");
|
|
28
|
+
const cmd = "osascript " +
|
|
29
|
+
"-e 'tell application \"System Events\"' " +
|
|
30
|
+
"-e 'keystroke \"v\" using command down' " +
|
|
31
|
+
"-e 'delay 0.2' " +
|
|
32
|
+
"-e 'keystroke return' " +
|
|
33
|
+
"-e 'end tell'";
|
|
34
|
+
execSync(cmd);
|
|
35
|
+
// Clear clipboard marker
|
|
36
|
+
spawnSync('pbcopy', { input: '__OPENCLI_WAITING__' });
|
|
37
|
+
// Wait for response, then read it
|
|
38
|
+
const pollInterval = 3;
|
|
39
|
+
const maxPolls = Math.ceil(timeout / pollInterval);
|
|
40
|
+
let response = '';
|
|
41
|
+
for (let i = 0; i < maxPolls; i++) {
|
|
42
|
+
// Wait
|
|
43
|
+
execSync(`sleep ${pollInterval}`);
|
|
44
|
+
// Try Cmd+Shift+C to copy the latest response
|
|
45
|
+
execSync("osascript -e 'tell application \"ChatGPT\" to activate'");
|
|
46
|
+
execSync("osascript -e 'tell application \"System Events\" to keystroke \"c\" using {command down, shift down}'");
|
|
47
|
+
execSync("osascript -e 'delay 0.3'");
|
|
48
|
+
const copied = execSync('pbpaste', { encoding: 'utf-8' }).trim();
|
|
49
|
+
if (copied && copied !== '__OPENCLI_WAITING__' && copied !== text) {
|
|
50
|
+
response = copied;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// Restore clipboard
|
|
55
|
+
if (clipBackup)
|
|
56
|
+
spawnSync('pbcopy', { input: clipBackup });
|
|
57
|
+
if (!response) {
|
|
58
|
+
return [
|
|
59
|
+
{ Role: 'User', Text: text },
|
|
60
|
+
{ Role: 'System', Text: `No response within ${timeout}s. ChatGPT may still be generating.` },
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
return [
|
|
64
|
+
{ Role: 'User', Text: text },
|
|
65
|
+
{ Role: 'Assistant', Text: response },
|
|
66
|
+
];
|
|
67
|
+
},
|
|
68
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const newCommand: import("../../registry.js").CliCommand;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { cli, Strategy } from '../../registry.js';
|
|
3
|
+
export const newCommand = cli({
|
|
4
|
+
site: 'chatgpt',
|
|
5
|
+
name: 'new',
|
|
6
|
+
description: 'Open a new chat in ChatGPT Desktop App',
|
|
7
|
+
domain: 'localhost',
|
|
8
|
+
strategy: Strategy.PUBLIC,
|
|
9
|
+
browser: false,
|
|
10
|
+
args: [],
|
|
11
|
+
columns: ['Status'],
|
|
12
|
+
func: async (page) => {
|
|
13
|
+
try {
|
|
14
|
+
execSync("osascript -e 'tell application \"ChatGPT\" to activate'");
|
|
15
|
+
execSync("osascript -e 'delay 0.5'");
|
|
16
|
+
execSync("osascript -e 'tell application \"System Events\" to keystroke \"n\" using command down'");
|
|
17
|
+
return [{ Status: 'Success' }];
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
return [{ Status: "Error: " + err.message }];
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const readCommand: import("../../registry.js").CliCommand;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { cli, Strategy } from '../../registry.js';
|
|
3
|
+
export const readCommand = cli({
|
|
4
|
+
site: 'chatgpt',
|
|
5
|
+
name: 'read',
|
|
6
|
+
description: 'Copy the most recent ChatGPT Desktop App response to clipboard and read it',
|
|
7
|
+
domain: 'localhost',
|
|
8
|
+
strategy: Strategy.PUBLIC,
|
|
9
|
+
browser: false,
|
|
10
|
+
args: [],
|
|
11
|
+
columns: ['Role', 'Text'],
|
|
12
|
+
func: async (page) => {
|
|
13
|
+
try {
|
|
14
|
+
execSync("osascript -e 'tell application \"ChatGPT\" to activate'");
|
|
15
|
+
execSync("osascript -e 'delay 0.5'");
|
|
16
|
+
execSync("osascript -e 'tell application \"System Events\" to keystroke \"c\" using {command down, shift down}'");
|
|
17
|
+
execSync("osascript -e 'delay 0.3'");
|
|
18
|
+
const result = execSync('pbpaste', { encoding: 'utf-8' }).trim();
|
|
19
|
+
if (!result) {
|
|
20
|
+
return [{ Role: 'System', Text: 'No text was copied. Is there a response in the chat?' }];
|
|
21
|
+
}
|
|
22
|
+
return [{ Role: 'Assistant', Text: result }];
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
throw new Error("Failed to read from ChatGPT: " + err.message);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sendCommand: import("../../registry.js").CliCommand;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { execSync, spawnSync } from 'node:child_process';
|
|
2
|
+
import { cli, Strategy } from '../../registry.js';
|
|
3
|
+
export const sendCommand = cli({
|
|
4
|
+
site: 'chatgpt',
|
|
5
|
+
name: 'send',
|
|
6
|
+
description: 'Send a message to the active ChatGPT Desktop App window',
|
|
7
|
+
domain: 'localhost',
|
|
8
|
+
strategy: Strategy.PUBLIC,
|
|
9
|
+
browser: false,
|
|
10
|
+
args: [{ name: 'text', required: true, positional: true, help: 'Message to send' }],
|
|
11
|
+
columns: ['Status'],
|
|
12
|
+
func: async (page, kwargs) => {
|
|
13
|
+
const text = kwargs.text;
|
|
14
|
+
try {
|
|
15
|
+
// Backup current clipboard content
|
|
16
|
+
let clipBackup = '';
|
|
17
|
+
try {
|
|
18
|
+
clipBackup = execSync('pbpaste', { encoding: 'utf-8' });
|
|
19
|
+
}
|
|
20
|
+
catch { /* clipboard may be empty */ }
|
|
21
|
+
// Copy text to clipboard
|
|
22
|
+
spawnSync('pbcopy', { input: text });
|
|
23
|
+
execSync("osascript -e 'tell application \"ChatGPT\" to activate'");
|
|
24
|
+
execSync("osascript -e 'delay 0.5'");
|
|
25
|
+
const cmd = "osascript " +
|
|
26
|
+
"-e 'tell application \"System Events\"' " +
|
|
27
|
+
"-e 'keystroke \"v\" using command down' " +
|
|
28
|
+
"-e 'delay 0.2' " +
|
|
29
|
+
"-e 'keystroke return' " +
|
|
30
|
+
"-e 'end tell'";
|
|
31
|
+
execSync(cmd);
|
|
32
|
+
// Restore original clipboard content
|
|
33
|
+
if (clipBackup) {
|
|
34
|
+
spawnSync('pbcopy', { input: clipBackup });
|
|
35
|
+
}
|
|
36
|
+
return [{ Status: 'Success' }];
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
return [{ Status: "Error: " + err.message }];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const statusCommand: import("../../registry.js").CliCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { cli, Strategy } from '../../registry.js';
|
|
3
|
+
export const statusCommand = cli({
|
|
4
|
+
site: 'chatgpt',
|
|
5
|
+
name: 'status',
|
|
6
|
+
description: 'Check if ChatGPT Desktop App is running natively on macOS',
|
|
7
|
+
domain: 'localhost',
|
|
8
|
+
strategy: Strategy.PUBLIC,
|
|
9
|
+
browser: false,
|
|
10
|
+
args: [],
|
|
11
|
+
columns: ['Status'],
|
|
12
|
+
func: async (page) => {
|
|
13
|
+
try {
|
|
14
|
+
const output = execSync("osascript -e 'application \"ChatGPT\" is running'", { encoding: 'utf-8' }).trim();
|
|
15
|
+
return [{ Status: output === 'true' ? 'Running' : 'Stopped' }];
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return [{ Status: 'Error querying application state' }];
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const askCommand: import("../../registry.js").CliCommand;
|