@limrun/cli 0.3.0 → 0.4.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.
Files changed (315) hide show
  1. package/README.md +127 -99
  2. package/bin/run.js +60 -5
  3. package/dist/base-command.d.ts +6 -0
  4. package/dist/base-command.d.ts.map +1 -1
  5. package/dist/base-command.js +28 -7
  6. package/dist/base-command.js.map +1 -1
  7. package/dist/commands/android/connect.d.ts +2 -1
  8. package/dist/commands/android/connect.d.ts.map +1 -1
  9. package/dist/commands/android/connect.js +13 -4
  10. package/dist/commands/android/connect.js.map +1 -1
  11. package/dist/commands/android/create.d.ts +1 -2
  12. package/dist/commands/android/create.d.ts.map +1 -1
  13. package/dist/commands/android/create.js +37 -32
  14. package/dist/commands/android/create.js.map +1 -1
  15. package/dist/commands/android/delete.d.ts +2 -1
  16. package/dist/commands/android/delete.d.ts.map +1 -1
  17. package/dist/commands/android/delete.js +6 -3
  18. package/dist/commands/android/delete.js.map +1 -1
  19. package/dist/commands/android/element-tree.d.ts +15 -0
  20. package/dist/commands/android/element-tree.d.ts.map +1 -0
  21. package/dist/commands/android/element-tree.js +62 -0
  22. package/dist/commands/android/element-tree.js.map +1 -0
  23. package/dist/commands/android/find-element.d.ts +27 -0
  24. package/dist/commands/android/find-element.d.ts.map +1 -0
  25. package/dist/commands/android/find-element.js +72 -0
  26. package/dist/commands/android/find-element.js.map +1 -0
  27. package/dist/commands/android/get.d.ts +2 -1
  28. package/dist/commands/android/get.d.ts.map +1 -1
  29. package/dist/commands/android/get.js +3 -3
  30. package/dist/commands/android/get.js.map +1 -1
  31. package/dist/commands/android/install-app.d.ts +17 -0
  32. package/dist/commands/android/install-app.d.ts.map +1 -0
  33. package/dist/commands/android/install-app.js +72 -0
  34. package/dist/commands/android/install-app.js.map +1 -0
  35. package/dist/commands/android/list.d.ts +2 -0
  36. package/dist/commands/android/list.d.ts.map +1 -1
  37. package/dist/commands/android/list.js +17 -5
  38. package/dist/commands/android/list.js.map +1 -1
  39. package/dist/commands/android/open-url.d.ts +17 -0
  40. package/dist/commands/android/open-url.d.ts.map +1 -0
  41. package/dist/commands/android/open-url.js +53 -0
  42. package/dist/commands/android/open-url.js.map +1 -0
  43. package/dist/commands/android/press-key.d.ts +18 -0
  44. package/dist/commands/android/press-key.d.ts.map +1 -0
  45. package/dist/commands/android/press-key.js +54 -0
  46. package/dist/commands/android/press-key.js.map +1 -0
  47. package/dist/commands/android/record.d.ts +21 -0
  48. package/dist/commands/android/record.d.ts.map +1 -0
  49. package/dist/commands/android/record.js +105 -0
  50. package/dist/commands/android/record.js.map +1 -0
  51. package/dist/commands/android/screenshot.d.ts +16 -0
  52. package/dist/commands/android/screenshot.d.ts.map +1 -0
  53. package/dist/commands/android/screenshot.js +70 -0
  54. package/dist/commands/android/screenshot.js.map +1 -0
  55. package/dist/commands/android/scroll.d.ts +31 -0
  56. package/dist/commands/android/scroll.d.ts.map +1 -0
  57. package/dist/commands/android/scroll.js +73 -0
  58. package/dist/commands/android/scroll.js.map +1 -0
  59. package/dist/commands/android/tap-element.d.ts +26 -0
  60. package/dist/commands/android/tap-element.d.ts.map +1 -0
  61. package/dist/commands/android/tap-element.js +62 -0
  62. package/dist/commands/android/tap-element.js.map +1 -0
  63. package/dist/commands/android/tap.d.ts +24 -0
  64. package/dist/commands/android/tap.d.ts.map +1 -0
  65. package/dist/commands/android/tap.js +57 -0
  66. package/dist/commands/android/tap.js.map +1 -0
  67. package/dist/commands/android/type.d.ts +30 -0
  68. package/dist/commands/android/type.d.ts.map +1 -0
  69. package/dist/commands/android/type.js +55 -0
  70. package/dist/commands/android/type.js.map +1 -0
  71. package/dist/commands/asset/delete.d.ts +2 -1
  72. package/dist/commands/asset/delete.d.ts.map +1 -1
  73. package/dist/commands/asset/delete.js +2 -2
  74. package/dist/commands/asset/delete.js.map +1 -1
  75. package/dist/commands/asset/list.d.ts +3 -1
  76. package/dist/commands/asset/list.d.ts.map +1 -1
  77. package/dist/commands/asset/list.js +22 -6
  78. package/dist/commands/asset/list.js.map +1 -1
  79. package/dist/commands/asset/pull.d.ts +2 -1
  80. package/dist/commands/asset/pull.d.ts.map +1 -1
  81. package/dist/commands/asset/pull.js +18 -6
  82. package/dist/commands/asset/pull.js.map +1 -1
  83. package/dist/commands/asset/push.d.ts +2 -1
  84. package/dist/commands/asset/push.d.ts.map +1 -1
  85. package/dist/commands/asset/push.js +5 -6
  86. package/dist/commands/asset/push.js.map +1 -1
  87. package/dist/commands/exec/element-tree.d.ts +2 -1
  88. package/dist/commands/exec/element-tree.d.ts.map +1 -1
  89. package/dist/commands/exec/element-tree.js +6 -2
  90. package/dist/commands/exec/element-tree.js.map +1 -1
  91. package/dist/commands/exec/install-app.d.ts +1 -1
  92. package/dist/commands/exec/install-app.d.ts.map +1 -1
  93. package/dist/commands/exec/install-app.js +10 -5
  94. package/dist/commands/exec/install-app.js.map +1 -1
  95. package/dist/commands/exec/open-url.d.ts +2 -1
  96. package/dist/commands/exec/open-url.d.ts.map +1 -1
  97. package/dist/commands/exec/open-url.js +9 -3
  98. package/dist/commands/exec/open-url.js.map +1 -1
  99. package/dist/commands/exec/perform.d.ts +17 -0
  100. package/dist/commands/exec/perform.d.ts.map +1 -0
  101. package/dist/commands/exec/perform.js +232 -0
  102. package/dist/commands/exec/perform.js.map +1 -0
  103. package/dist/commands/exec/press-key.d.ts +2 -1
  104. package/dist/commands/exec/press-key.d.ts.map +1 -1
  105. package/dist/commands/exec/press-key.js +9 -3
  106. package/dist/commands/exec/press-key.js.map +1 -1
  107. package/dist/commands/exec/record.d.ts +2 -1
  108. package/dist/commands/exec/record.d.ts.map +1 -1
  109. package/dist/commands/exec/record.js +20 -6
  110. package/dist/commands/exec/record.js.map +1 -1
  111. package/dist/commands/exec/screenshot.d.ts +2 -1
  112. package/dist/commands/exec/screenshot.d.ts.map +1 -1
  113. package/dist/commands/exec/screenshot.js +9 -3
  114. package/dist/commands/exec/screenshot.js.map +1 -1
  115. package/dist/commands/exec/scroll.d.ts +2 -1
  116. package/dist/commands/exec/scroll.d.ts.map +1 -1
  117. package/dist/commands/exec/scroll.js +7 -4
  118. package/dist/commands/exec/scroll.js.map +1 -1
  119. package/dist/commands/exec/tap-element.d.ts +2 -1
  120. package/dist/commands/exec/tap-element.d.ts.map +1 -1
  121. package/dist/commands/exec/tap-element.js +16 -6
  122. package/dist/commands/exec/tap-element.js.map +1 -1
  123. package/dist/commands/exec/tap.d.ts +2 -1
  124. package/dist/commands/exec/tap.d.ts.map +1 -1
  125. package/dist/commands/exec/tap.js +13 -4
  126. package/dist/commands/exec/tap.js.map +1 -1
  127. package/dist/commands/exec/type.d.ts +3 -2
  128. package/dist/commands/exec/type.d.ts.map +1 -1
  129. package/dist/commands/exec/type.js +12 -6
  130. package/dist/commands/exec/type.js.map +1 -1
  131. package/dist/commands/ios/app-log.d.ts +19 -0
  132. package/dist/commands/ios/app-log.d.ts.map +1 -0
  133. package/dist/commands/ios/app-log.js +93 -0
  134. package/dist/commands/ios/app-log.js.map +1 -0
  135. package/dist/commands/ios/cp.d.ts +18 -0
  136. package/dist/commands/ios/cp.d.ts.map +1 -0
  137. package/dist/commands/ios/cp.js +66 -0
  138. package/dist/commands/ios/cp.js.map +1 -0
  139. package/dist/commands/ios/create.d.ts +1 -1
  140. package/dist/commands/ios/create.d.ts.map +1 -1
  141. package/dist/commands/ios/create.js +55 -24
  142. package/dist/commands/ios/create.js.map +1 -1
  143. package/dist/commands/ios/delete.d.ts +2 -1
  144. package/dist/commands/ios/delete.d.ts.map +1 -1
  145. package/dist/commands/ios/delete.js +3 -3
  146. package/dist/commands/ios/delete.js.map +1 -1
  147. package/dist/commands/ios/element-tree.d.ts +15 -0
  148. package/dist/commands/ios/element-tree.d.ts.map +1 -0
  149. package/dist/commands/ios/element-tree.js +59 -0
  150. package/dist/commands/ios/element-tree.js.map +1 -0
  151. package/dist/commands/ios/get.d.ts +2 -1
  152. package/dist/commands/ios/get.d.ts.map +1 -1
  153. package/dist/commands/ios/get.js +3 -3
  154. package/dist/commands/ios/get.js.map +1 -1
  155. package/dist/commands/{delete/index.d.ts → ios/info.d.ts} +6 -5
  156. package/dist/commands/ios/info.d.ts.map +1 -0
  157. package/dist/commands/ios/info.js +60 -0
  158. package/dist/commands/ios/info.js.map +1 -0
  159. package/dist/commands/ios/install-app.d.ts +19 -0
  160. package/dist/commands/ios/install-app.d.ts.map +1 -0
  161. package/dist/commands/ios/install-app.js +99 -0
  162. package/dist/commands/ios/install-app.js.map +1 -0
  163. package/dist/commands/ios/launch-app.d.ts +2 -1
  164. package/dist/commands/ios/launch-app.d.ts.map +1 -1
  165. package/dist/commands/ios/launch-app.js +5 -3
  166. package/dist/commands/ios/launch-app.js.map +1 -1
  167. package/dist/commands/ios/list-apps.d.ts +2 -1
  168. package/dist/commands/ios/list-apps.d.ts.map +1 -1
  169. package/dist/commands/ios/list-apps.js +9 -3
  170. package/dist/commands/ios/list-apps.js.map +1 -1
  171. package/dist/commands/ios/list.d.ts +2 -0
  172. package/dist/commands/ios/list.d.ts.map +1 -1
  173. package/dist/commands/ios/list.js +17 -5
  174. package/dist/commands/ios/list.js.map +1 -1
  175. package/dist/commands/ios/log.d.ts +3 -1
  176. package/dist/commands/ios/log.d.ts.map +1 -1
  177. package/dist/commands/ios/log.js +31 -8
  178. package/dist/commands/ios/log.js.map +1 -1
  179. package/dist/commands/ios/lsof.d.ts +15 -0
  180. package/dist/commands/ios/lsof.d.ts.map +1 -0
  181. package/dist/commands/ios/lsof.js +49 -0
  182. package/dist/commands/ios/lsof.js.map +1 -0
  183. package/dist/commands/ios/open-url.d.ts +17 -0
  184. package/dist/commands/ios/open-url.d.ts.map +1 -0
  185. package/dist/commands/ios/open-url.js +53 -0
  186. package/dist/commands/ios/open-url.js.map +1 -0
  187. package/dist/commands/ios/perform.d.ts +17 -0
  188. package/dist/commands/ios/perform.d.ts.map +1 -0
  189. package/dist/commands/ios/perform.js +230 -0
  190. package/dist/commands/ios/perform.js.map +1 -0
  191. package/dist/commands/ios/press-key.d.ts +18 -0
  192. package/dist/commands/ios/press-key.d.ts.map +1 -0
  193. package/dist/commands/ios/press-key.js +54 -0
  194. package/dist/commands/ios/press-key.js.map +1 -0
  195. package/dist/commands/ios/record.d.ts +21 -0
  196. package/dist/commands/ios/record.d.ts.map +1 -0
  197. package/dist/commands/ios/record.js +106 -0
  198. package/dist/commands/ios/record.js.map +1 -0
  199. package/dist/commands/ios/screenshot.d.ts +16 -0
  200. package/dist/commands/ios/screenshot.d.ts.map +1 -0
  201. package/dist/commands/ios/screenshot.js +69 -0
  202. package/dist/commands/ios/screenshot.js.map +1 -0
  203. package/dist/commands/ios/scroll.d.ts +18 -0
  204. package/dist/commands/ios/scroll.d.ts.map +1 -0
  205. package/dist/commands/ios/scroll.js +58 -0
  206. package/dist/commands/ios/scroll.js.map +1 -0
  207. package/dist/commands/ios/simctl.d.ts +16 -0
  208. package/dist/commands/ios/simctl.d.ts.map +1 -0
  209. package/dist/commands/ios/simctl.js +75 -0
  210. package/dist/commands/ios/simctl.js.map +1 -0
  211. package/dist/commands/ios/sync.d.ts +22 -0
  212. package/dist/commands/ios/sync.d.ts.map +1 -0
  213. package/dist/commands/ios/sync.js +100 -0
  214. package/dist/commands/ios/sync.js.map +1 -0
  215. package/dist/commands/ios/syslog.d.ts +15 -0
  216. package/dist/commands/ios/syslog.d.ts.map +1 -0
  217. package/dist/commands/ios/syslog.js +65 -0
  218. package/dist/commands/ios/syslog.js.map +1 -0
  219. package/dist/commands/ios/tap-element.d.ts +22 -0
  220. package/dist/commands/ios/tap-element.d.ts.map +1 -0
  221. package/dist/commands/ios/tap-element.js +94 -0
  222. package/dist/commands/ios/tap-element.js.map +1 -0
  223. package/dist/commands/ios/tap.d.ts +24 -0
  224. package/dist/commands/ios/tap.d.ts.map +1 -0
  225. package/dist/commands/ios/tap.js +57 -0
  226. package/dist/commands/ios/tap.js.map +1 -0
  227. package/dist/commands/ios/terminate-app.d.ts +2 -1
  228. package/dist/commands/ios/terminate-app.d.ts.map +1 -1
  229. package/dist/commands/ios/terminate-app.js +9 -3
  230. package/dist/commands/ios/terminate-app.js.map +1 -1
  231. package/dist/commands/ios/type.d.ts +18 -0
  232. package/dist/commands/ios/type.d.ts.map +1 -0
  233. package/dist/commands/ios/type.js +55 -0
  234. package/dist/commands/ios/type.js.map +1 -0
  235. package/dist/commands/ios/xcodebuild.d.ts +16 -0
  236. package/dist/commands/ios/xcodebuild.d.ts.map +1 -0
  237. package/dist/commands/ios/xcodebuild.js +61 -0
  238. package/dist/commands/ios/xcodebuild.js.map +1 -0
  239. package/dist/commands/ios/xcrun.d.ts +16 -0
  240. package/dist/commands/ios/xcrun.d.ts.map +1 -0
  241. package/dist/commands/ios/xcrun.js +62 -0
  242. package/dist/commands/ios/xcrun.js.map +1 -0
  243. package/dist/commands/login.d.ts +8 -2
  244. package/dist/commands/login.d.ts.map +1 -1
  245. package/dist/commands/login.js +7 -3
  246. package/dist/commands/login.js.map +1 -1
  247. package/dist/commands/logout.d.ts +8 -2
  248. package/dist/commands/logout.d.ts.map +1 -1
  249. package/dist/commands/logout.js +7 -3
  250. package/dist/commands/logout.js.map +1 -1
  251. package/dist/commands/session/start.d.ts +1 -0
  252. package/dist/commands/session/start.d.ts.map +1 -1
  253. package/dist/commands/session/start.js +4 -2
  254. package/dist/commands/session/start.js.map +1 -1
  255. package/dist/commands/session/status.d.ts +2 -0
  256. package/dist/commands/session/status.d.ts.map +1 -1
  257. package/dist/commands/session/status.js +2 -1
  258. package/dist/commands/session/status.js.map +1 -1
  259. package/dist/commands/session/stop.d.ts +5 -2
  260. package/dist/commands/session/stop.d.ts.map +1 -1
  261. package/dist/commands/session/stop.js +12 -5
  262. package/dist/commands/session/stop.js.map +1 -1
  263. package/dist/commands/{build.d.ts → xcode/build.d.ts} +6 -3
  264. package/dist/commands/xcode/build.d.ts.map +1 -0
  265. package/dist/commands/xcode/build.js +117 -0
  266. package/dist/commands/xcode/build.js.map +1 -0
  267. package/dist/commands/xcode/create.d.ts +1 -1
  268. package/dist/commands/xcode/create.d.ts.map +1 -1
  269. package/dist/commands/xcode/create.js +28 -14
  270. package/dist/commands/xcode/create.js.map +1 -1
  271. package/dist/commands/xcode/delete.d.ts +2 -1
  272. package/dist/commands/xcode/delete.d.ts.map +1 -1
  273. package/dist/commands/xcode/delete.js +4 -4
  274. package/dist/commands/xcode/delete.js.map +1 -1
  275. package/dist/commands/xcode/get.d.ts +2 -1
  276. package/dist/commands/xcode/get.d.ts.map +1 -1
  277. package/dist/commands/xcode/get.js +3 -3
  278. package/dist/commands/xcode/get.js.map +1 -1
  279. package/dist/commands/xcode/list.d.ts +2 -0
  280. package/dist/commands/xcode/list.d.ts.map +1 -1
  281. package/dist/commands/xcode/list.js +16 -4
  282. package/dist/commands/xcode/list.js.map +1 -1
  283. package/dist/commands/{sync.d.ts → xcode/sync.d.ts} +6 -3
  284. package/dist/commands/xcode/sync.d.ts.map +1 -0
  285. package/dist/commands/xcode/sync.js +107 -0
  286. package/dist/commands/xcode/sync.js.map +1 -0
  287. package/dist/lib/android-selector.d.ts +50 -0
  288. package/dist/lib/android-selector.d.ts.map +1 -0
  289. package/dist/lib/android-selector.js +103 -0
  290. package/dist/lib/android-selector.js.map +1 -0
  291. package/dist/lib/daemon-client.d.ts +1 -1
  292. package/dist/lib/daemon-client.d.ts.map +1 -1
  293. package/dist/lib/daemon-client.js +2 -2
  294. package/dist/lib/daemon-client.js.map +1 -1
  295. package/dist/lib/daemon.d.ts.map +1 -1
  296. package/dist/lib/daemon.js +37 -3
  297. package/dist/lib/daemon.js.map +1 -1
  298. package/dist/lib/ignore-patterns.d.ts +2 -0
  299. package/dist/lib/ignore-patterns.d.ts.map +1 -0
  300. package/dist/lib/ignore-patterns.js +18 -0
  301. package/dist/lib/ignore-patterns.js.map +1 -0
  302. package/dist/lib/instance-client-factory.d.ts +1 -1
  303. package/dist/lib/instance-client-factory.d.ts.map +1 -1
  304. package/dist/lib/instance-client-factory.js +2 -2
  305. package/dist/lib/instance-client-factory.js.map +1 -1
  306. package/package.json +7 -19
  307. package/dist/commands/build.d.ts.map +0 -1
  308. package/dist/commands/build.js +0 -93
  309. package/dist/commands/build.js.map +0 -1
  310. package/dist/commands/delete/index.d.ts.map +0 -1
  311. package/dist/commands/delete/index.js +0 -48
  312. package/dist/commands/delete/index.js.map +0 -1
  313. package/dist/commands/sync.d.ts.map +0 -1
  314. package/dist/commands/sync.js +0 -85
  315. package/dist/commands/sync.js.map +0 -1
package/README.md CHANGED
@@ -35,11 +35,12 @@ The CLI stores configuration in `~/.lim/config.yaml`. This file is compatible wi
35
35
 
36
36
  Every command supports these flags:
37
37
 
38
- | Flag | Description |
39
- |------|-------------|
40
- | `--api-key <value>` | API key (also reads `LIM_API_KEY` env var) |
41
- | `--json` | Output as JSON instead of human-readable tables |
42
- | `--help` | Show help for any command |
38
+ | Flag | Description |
39
+ | ------------------- | ----------------------------------------------- |
40
+ | `--api-key <value>` | API key (also reads `LIM_API_KEY` env var) |
41
+ | `--json` | Output as JSON instead of human-readable tables |
42
+ | `--quiet` | Suppress intermediate logs and print only the final result |
43
+ | `--help` | Show help for any command |
43
44
 
44
45
  ## Command Structure
45
46
 
@@ -67,14 +68,16 @@ You can always provide an ID explicitly to target a specific instance:
67
68
  lim ios screenshot -o test.png --id ios_def456
68
69
  ```
69
70
 
70
- **Top-level shortcuts** are available for common actions the platform is auto-detected from the instance ID prefix:
71
+ For repeatable scripts and LLM agents, prefer explicit platform commands plus an explicit `--id` once you have it:
71
72
 
72
73
  ```bash
73
- lim screenshot --id ios_abc123 # Works for both iOS and Android
74
- lim tap 100 200 --id ios_abc123 # Auto-detects platform from ID prefix
75
- lim delete ios_abc123 # Auto-detects resource type from ID prefix
74
+ lim ios get ios_abc123 --json
75
+ lim ios screenshot --id ios_abc123 -o screenshot.png
76
+ lim android tap --id android_abc123 100 200
76
77
  ```
77
78
 
79
+ This avoids relying on locally cached "last created" state and keeps the target platform explicit.
80
+
78
81
  ## Commands
79
82
 
80
83
  - [iOS](#ios) — Create, manage, and interact with iOS instances
@@ -93,6 +96,7 @@ lim ios create # Create a new iOS instance
93
96
  lim ios list # List all ready iOS instances
94
97
  lim ios get <ID> # Get details of a specific instance
95
98
  lim ios delete <ID> # Delete an instance
99
+ lim ios info # Get device info from a running instance
96
100
  ```
97
101
 
98
102
  #### Create Options
@@ -116,19 +120,19 @@ lim ios create --region us-west --display-name "CI Test" --label env=ci --rm
116
120
 
117
121
  **Flags for `ios create`:**
118
122
 
119
- | Flag | Description |
120
- |------|-------------|
121
- | `--rm` | Auto-delete the instance on exit (Ctrl+C) |
122
- | `--model <iphone\|ipad\|watch>` | Simulator device model |
123
- | `--xcode` | Attach a Xcode build sandbox to the iOS instance |
124
- | `--region <value>` | Region for the instance (e.g. `us-west`) |
125
- | `--display-name <value>` | Human-readable name |
126
- | `--label <key=value>` | Labels (repeatable). Used for filtering and reuse |
127
- | `--hard-timeout <duration>` | Max lifetime (e.g. `1m`, `10m`, `3h`). Default: none |
128
- | `--inactivity-timeout <duration>` | Idle timeout. Default: `3m` |
129
- | `--reuse-if-exists` | Reuse an existing instance with matching labels/region |
130
- | `--install <file>` | Local file to install (auto-uploads, repeatable) |
131
- | `--install-asset <name>` | Asset name to install (repeatable) |
123
+ | Flag | Description |
124
+ | --------------------------------- | ------------------------------------------------------ |
125
+ | `--rm` | Auto-delete the instance on exit (Ctrl+C) |
126
+ | `--model <iphone\|ipad\|watch>` | Simulator device model |
127
+ | `--xcode` | Attach a Xcode build sandbox to the iOS instance |
128
+ | `--region <value>` | Region for the instance (e.g. `us-west`) |
129
+ | `--display-name <value>` | Human-readable name |
130
+ | `--label <key=value>` | Labels (repeatable). Used for filtering and reuse |
131
+ | `--hard-timeout <duration>` | Max lifetime (e.g. `1m`, `10m`, `3h`). Default: none |
132
+ | `--inactivity-timeout <duration>` | Idle timeout. Default: `3m` |
133
+ | `--reuse-if-exists` | Reuse an existing instance with matching labels/region |
134
+ | `--install <file>` | Local file to install (auto-uploads, repeatable) |
135
+ | `--install-asset <name>` | Asset name to install (repeatable) |
132
136
 
133
137
  #### List and Filter
134
138
 
@@ -147,24 +151,40 @@ lim ios get <ID> # Single instance details
147
151
  All interaction commands accept an optional `--id`. When omitted, the last created iOS instance is used.
148
152
 
149
153
  ```bash
154
+ # Device info
155
+ lim ios info
156
+ lim ios info --json
157
+
150
158
  # Screenshots
151
159
  lim ios screenshot -o screenshot.png
152
160
  lim ios screenshot # Output base64 to stdout
153
161
 
154
162
  # Tapping
155
163
  lim ios tap 100 200
156
- lim ios tap-element --label "Submit"
157
- lim ios tap-element --accessibility-id btn_ok
164
+ lim ios tap-element --ax-label "Submit"
165
+ lim ios tap-element --ax-unique-id btn_ok
158
166
 
159
167
  # Text input
160
168
  lim ios type "Hello World"
161
- lim ios type "search query" --press-enter
169
+ lim ios type "search query" --enter
162
170
  lim ios press-key enter
163
171
  lim ios press-key a --modifier shift
164
172
 
165
173
  # Scrolling
166
174
  lim ios scroll down --amount 500
167
175
 
176
+ # Batch multiple actions in one call
177
+ lim ios perform --action type=tap,x=100,y=200 --action 'type=typeText,text=Hello World'
178
+ lim ios perform --action type=wait,durationMs=500 --action type=pressKey,key=enter
179
+ lim ios perform --file ./actions.yaml
180
+
181
+ # actions.yaml
182
+ - type: tap
183
+ x: 100
184
+ y: 200
185
+ - type: typeText
186
+ text: "Hello World"
187
+
168
188
  # UI inspection
169
189
  lim ios element-tree
170
190
  lim ios element-tree | jq '.'
@@ -172,6 +192,13 @@ lim ios element-tree | jq '.'
172
192
  # Open URLs / deep links
173
193
  lim ios open-url https://example.com
174
194
  lim ios open-url myapp://settings
195
+
196
+ # Low-level simulator access
197
+ lim ios simctl -- listapps booted
198
+ lim ios xcrun -- --sdk iphonesimulator --show-sdk-version
199
+ lim ios xcodebuild -- -version
200
+ lim ios cp payload.json ./fixtures/payload.json
201
+ lim ios lsof
175
202
  ```
176
203
 
177
204
  #### App Management (iOS only)
@@ -180,6 +207,8 @@ lim ios open-url myapp://settings
180
207
  # Install an app (local file auto-uploads, or use URL)
181
208
  lim ios install-app ./MyApp.ipa
182
209
  lim ios install-app https://example.com/app.ipa
210
+ lim ios install-app https://example.com/app.ipa --md5 <hex-digest>
211
+ lim ios install-app ./MyApp.ipa --launch-mode RelaunchIfRunning
183
212
 
184
213
  # Launch / terminate
185
214
  lim ios launch-app com.example.myapp
@@ -194,10 +223,14 @@ lim ios list-apps
194
223
 
195
224
  ```bash
196
225
  # Tail recent logs
197
- lim ios log com.example.myapp --lines 50
226
+ lim ios app-log com.example.myapp --tail 50
198
227
 
199
228
  # Stream logs continuously (Ctrl+C to stop)
200
- lim ios log com.example.myapp -f
229
+ lim ios app-log com.example.myapp --follow
230
+
231
+ # Stream full simulator syslog
232
+ lim ios syslog
233
+ lim ios syslog --json
201
234
  ```
202
235
 
203
236
  #### Video Recording
@@ -210,12 +243,17 @@ lim ios record stop -o recording.mp4
210
243
  lim ios record stop --presigned-url https://example.com/upload
211
244
  ```
212
245
 
213
- #### Xcode Integration
246
+ #### Built App Sync (iOS only)
214
247
 
215
248
  ```bash
216
- # Sync/build use the current directory if no path is provided; pass instance IDs with --id (requires --xcode on create)
217
- lim ios sync ./MyProject
218
- lim ios build --scheme MyApp --workspace MyApp.xcworkspace
249
+ # Sync a built .app bundle to the current iOS instance
250
+ lim ios sync ./Build/Products/Debug-iphonesimulator/MyApp.app
251
+
252
+ # Re-sync on changes and relaunch if the app is already running
253
+ lim ios sync ./MyApp.app --watch --launch-mode RelaunchIfRunning
254
+
255
+ # Tune the delta-sync cache and patch size
256
+ lim ios sync ./MyApp.app --basis-cache-dir ./.limsync-cache --max-patch-bytes 2097152
219
257
  ```
220
258
 
221
259
  ---
@@ -232,14 +270,14 @@ lim android delete <ID> # Delete an instance
232
270
  #### Create Options
233
271
 
234
272
  ```bash
235
- # Basic (with ADB tunnel and scrcpy streaming)
273
+ # Basic (prints a Console URL you can open in the browser)
236
274
  lim android create
237
275
 
238
276
  # With apps pre-installed
239
277
  lim android create --install ./my-app.apk --install ./another.apk
240
278
 
241
- # Without streaming
242
- lim android create --no-stream
279
+ # Create without opening an ADB tunnel
280
+ lim android create --no-connect
243
281
 
244
282
  # Full options
245
283
  lim android create --region us-west --display-name "CI Test" --label env=ci --rm
@@ -247,11 +285,12 @@ lim android create --region us-west --display-name "CI Test" --label env=ci --rm
247
285
 
248
286
  **Android-specific flags:**
249
287
 
250
- | Flag | Description |
251
- |------|-------------|
252
- | `--[no-]connect` | Start ADB tunnel (default: true) |
253
- | `--[no-]stream` | Launch scrcpy for visual control (default: true) |
254
- | `--adb-path <path>` | Path to `adb` binary (default: `adb`) |
288
+ | Flag | Description |
289
+ | ------------------- | ------------------------------------------------ |
290
+ | `--[no-]connect` | Start an ADB tunnel immediately (default: true) |
291
+ | `--adb-path <path>` | Path to `adb` binary (default: `adb`) |
292
+
293
+ `lim android create` always prints a Console URL such as `https://console.limrun.com/stream/android_...` that you can open in the browser for live viewing. For automation, `--no-connect` is usually the safest default.
255
294
 
256
295
  #### Device Interaction
257
296
 
@@ -264,14 +303,18 @@ lim android screenshot -o screenshot.png
264
303
  # Tapping
265
304
  lim android tap 100 200
266
305
  lim android tap-element --resource-id com.example:id/button
306
+ lim android tap-element --content-desc "Sign In button"
267
307
  lim android tap-element --text "Sign In"
308
+ lim android find-element --resource-id com.example:id/button --json
268
309
 
269
310
  # Text input
270
311
  lim android type "Hello World"
312
+ lim android type "Hello World" --resource-id com.example:id/search_input
271
313
  lim android press-key enter
272
314
 
273
315
  # Scrolling
274
316
  lim android scroll down --amount 500
317
+ lim android scroll down --resource-id com.example:id/list --amount 500
275
318
 
276
319
  # UI inspection
277
320
  lim android element-tree
@@ -284,6 +327,7 @@ lim android open-url https://example.com
284
327
 
285
328
  # Video recording
286
329
  lim android record start
330
+ lim android record start --quality 8
287
331
  lim android record stop
288
332
  lim android record stop -o recording.mp4
289
333
  lim android record stop --presigned-url https://example.com/upload
@@ -317,12 +361,15 @@ lim xcode delete <ID> # Delete an instance
317
361
  # Create with options
318
362
  lim xcode create --rm --region us-west --hard-timeout 1h
319
363
 
320
- # Sync and build
321
- lim xcode sync ./MyProject
322
- lim xcode build --scheme MyApp --workspace MyApp.xcworkspace
364
+ # Build (automatically syncs the project path first)
365
+ lim xcode build ./MyProject --scheme MyApp --workspace MyApp.xcworkspace
323
366
 
324
367
  # Build and upload artifact
325
- lim xcode build --scheme MyApp --upload my-app-build
368
+ lim xcode build ./MyProject --scheme MyApp --upload my-app-build
369
+
370
+ # Tune sync cache, patch size, or ignore additional paths
371
+ lim xcode sync ./MyProject --watch --basis-cache-dir ./.limsync-cache --max-patch-bytes 2097152
372
+ lim xcode sync ./MyProject --ignore "\\.xcuserdata/" --ignore "^DerivedData/"
326
373
  ```
327
374
 
328
375
  ---
@@ -338,13 +385,15 @@ lim asset push ./my-app.ipa -n custom-name
338
385
 
339
386
  # Download a file
340
387
  lim asset pull asset_abc123
341
- lim asset pull my-app.apk
342
388
  lim asset pull asset_abc123 -o ./downloads
389
+ lim asset list --name my-app.apk --json
390
+ lim asset pull asset_abc123
343
391
 
344
392
  # List assets
345
393
  lim asset list
346
394
  lim asset list --name my-app
347
395
  lim asset list --download-url
396
+ lim asset list --include-app-store
348
397
 
349
398
  # Get a specific asset
350
399
  lim asset list asset_abc123
@@ -386,7 +435,7 @@ This makes sessions essential for interactive workflows, AI agent loops, and any
386
435
  #### Session Commands
387
436
 
388
437
  ```bash
389
- # Start a session (defaults to last created instance)
438
+ # Start a session (defaults to the last remembered iOS instance, otherwise Android, then Xcode)
390
439
  lim session start
391
440
 
392
441
  # Or specify an instance explicitly
@@ -407,13 +456,14 @@ lim session stop --id ios_abc123
407
456
  lim session stop --all
408
457
  ```
409
458
 
410
- If only one session is active, `lim session stop` (no ID) stops it automatically.
459
+ If only one session is active, `lim session stop` (no ID) stops it automatically. For scripts and agents, prefer `--id` explicitly so the target instance is unambiguous.
411
460
 
412
461
  #### How It Works
413
462
 
414
463
  Each `lim session start` spawns an independent background daemon that:
464
+
415
465
  - Holds a persistent WebSocket connection to that specific instance
416
- - Listens on its own Unix socket at `/tmp/lim-sessions/<instance-id>/`
466
+ - Listens on its own Unix socket under `~/.lim/sessions/<hashed-instance-id>/`
417
467
  - All interaction commands automatically detect the matching session and route through it
418
468
  - Multiple sessions run in parallel with no shared state
419
469
 
@@ -426,9 +476,9 @@ lim session start
426
476
  # Fast interaction loop — each command takes ~50ms
427
477
  lim ios launch-app com.example.myapp
428
478
  lim ios element-tree | jq '.tree'
429
- lim ios tap-element --label "Login"
479
+ lim ios tap-element --ax-label "Login"
430
480
  lim ios type "user@example.com"
431
- lim ios tap-element --label "Submit"
481
+ lim ios tap-element --ax-label "Submit"
432
482
  lim ios screenshot -o after-login.png
433
483
 
434
484
  lim session stop
@@ -482,7 +532,7 @@ done
482
532
  # Tear down
483
533
  lim session stop --all
484
534
  for ID in "${IDS[@]}"; do
485
- lim delete $ID
535
+ lim ios delete $ID
486
536
  done
487
537
  ```
488
538
 
@@ -504,26 +554,23 @@ lim ios create --xcode
504
554
  # Xcode Sandbox: https://...limrun.net/v1/sandbox_.../xcode
505
555
  # (sandbox URL is cached locally for sync/build to use)
506
556
 
507
- # 2. Sync your project code to the Xcode sandbox
508
- lim ios sync ./MyProject
509
-
510
- # 3. Build — the app is auto-installed on the simulator
511
- lim ios build --scheme MyApp --workspace MyApp.xcworkspace
557
+ # 2. Build — automatically syncs your project code first, then auto-installs on the simulator
558
+ lim xcode build ./MyProject --id ios_abc123 --scheme MyApp --workspace MyApp.xcworkspace
512
559
 
513
- # 4. Start a session for fast device interaction
560
+ # 3. Start a session for fast device interaction
514
561
  lim session start
515
562
 
516
- # 5. Test the built app on the simulator (~50ms per command)
563
+ # 4. Test the built app on the simulator (~50ms per command)
517
564
  lim ios launch-app com.example.myapp
518
565
  lim ios element-tree | jq '.'
519
566
  lim ios screenshot -o built-app.png
520
567
 
521
- # 6. Clean up
568
+ # 5. Clean up
522
569
  lim session stop
523
570
  lim ios delete ios_abc123
524
571
  ```
525
572
 
526
- > **Note:** The Xcode sandbox URL is only returned when the instance is created — not on subsequent `list` calls. The CLI caches it locally at `~/.lim/instances/` so that `sync` and `build` can find it. This means `sync`/`build` must run on the same machine where `ios create --xcode` was executed.
573
+ > **Note:** `lim xcode build` already syncs the project path you pass before invoking `xcodebuild`, so you do not need to call `lim xcode sync` first. The Xcode sandbox URL is only returned when the instance is created — not on subsequent `list` calls. The CLI caches it locally at `~/.lim/instances/` so that build workflows can find it. This means `build` must run on the same machine where `ios create --xcode` was executed.
527
574
 
528
575
  #### Option B: Standalone Xcode Instance
529
576
 
@@ -533,37 +580,19 @@ Use this when you only need to build (no simulator needed), or when you want to
533
580
  # 1. Create a standalone Xcode instance
534
581
  lim xcode create --rm
535
582
 
536
- # 2. Sync and build
537
- lim xcode sync ./MyProject
538
- lim xcode build --scheme MyApp --workspace MyApp.xcworkspace
583
+ # 2. Build (automatically syncs the project path first)
584
+ lim xcode build ./MyProject --scheme MyApp --workspace MyApp.xcworkspace
539
585
 
540
586
  # 3. Upload build artifact
541
- lim xcode build --scheme MyApp --upload my-app-build
587
+ lim xcode build ./MyProject --scheme MyApp --upload my-app-build
542
588
 
543
589
  # 4. Download the artifact
544
590
  lim asset pull my-app-build -o ./build-output
545
591
  ```
546
592
 
547
- #### Sync Options
548
-
549
- ```bash
550
- # Sync the current directory
551
- lim ios sync
552
-
553
- # Watch mode (re-syncs on file changes)
554
- lim ios sync ./MyProject --watch
593
+ #### Build Behavior
555
594
 
556
- # One-shot sync (default)
557
- lim ios sync ./MyProject
558
-
559
- # Explicitly disable watch mode
560
- lim ios sync ./MyProject --no-watch
561
-
562
- # Sync without installing
563
- lim ios sync ./MyProject --no-install
564
- ```
565
-
566
- The sync automatically ignores build artifacts (`build/`, `DerivedData/`, `.build/`), dependency folders (`Pods/`, `Carthage/Build/`, `.swiftpm/`), and user-specific files (`xcuserdata/`, `.dSYM/`).
595
+ `lim xcode build [PATH]` automatically performs a one-shot code sync for the given project path before invoking `xcodebuild`. The sync step automatically ignores build artifacts (`build/`, `DerivedData/`, `.build/`), dependency folders (`Pods/`, `Carthage/Build/`, `.swiftpm/`), and user-specific files (`xcuserdata/`, `.dSYM/`).
567
596
 
568
597
  ---
569
598
 
@@ -577,10 +606,10 @@ The CLI reads configuration from multiple sources (in order of precedence):
577
606
 
578
607
  **Config file keys:**
579
608
 
580
- | Key | Default | Description |
581
- |-----|---------|-------------|
582
- | `api-key` | — | Your Limrun API key |
583
- | `api-endpoint` | `https://api.limrun.com` | API base URL |
609
+ | Key | Default | Description |
610
+ | ------------------ | ---------------------------- | ----------------------- |
611
+ | `api-key` | — | Your Limrun API key |
612
+ | `api-endpoint` | `https://api.limrun.com` | API base URL |
584
613
  | `console-endpoint` | `https://console.limrun.com` | Console URL (for login) |
585
614
 
586
615
  ---
@@ -598,8 +627,8 @@ lim android list --json | jq '.[].metadata.id'
598
627
 
599
628
  # Use in scripts
600
629
  INSTANCE_ID=$(lim ios create --json | jq -r '.metadata.id')
601
- lim ios screenshot -o test.png
602
- lim delete $INSTANCE_ID
630
+ lim ios screenshot --id $INSTANCE_ID -o test.png
631
+ lim ios delete $INSTANCE_ID
603
632
  ```
604
633
 
605
634
  ---
@@ -621,7 +650,7 @@ lim ios screenshot -o test-result.png
621
650
 
622
651
  # Clean up
623
652
  lim session stop
624
- lim delete ios_abc123
653
+ lim ios delete ios_abc123
625
654
  ```
626
655
 
627
656
  ### AI Agent Automation
@@ -637,16 +666,16 @@ lim session start
637
666
  # Agent can interact at high speed
638
667
  lim ios tap 200 400
639
668
  lim ios type "test@example.com"
640
- lim ios tap-element --label "Sign In"
669
+ lim ios tap-element --ax-label "Sign In"
641
670
  lim ios screenshot -o result.png
642
671
  lim ios element-tree --json > ui-state.json
643
672
 
644
673
  # Tail logs (non-streaming works through session too)
645
- lim ios log com.example.myapp --lines 20
674
+ lim ios app-log com.example.myapp --tail 20
646
675
 
647
676
  # Clean up
648
677
  lim session stop
649
- lim delete $ID
678
+ lim ios delete $ID
650
679
  ```
651
680
 
652
681
  ### Remote Build + Test on iOS Simulator
@@ -655,9 +684,8 @@ lim delete $ID
655
684
  # Single instance: Xcode sandbox + iOS simulator
656
685
  ID=$(lim ios create --xcode --json | jq -r '.metadata.id')
657
686
 
658
- # Sync, build, and test
659
- lim ios sync ./MyiOSProject
660
- lim ios build --scheme MyApp --workspace MyApp.xcworkspace
687
+ # Build and test (build automatically syncs the project path first)
688
+ lim xcode build ./MyiOSProject --id $ID --scheme MyApp --workspace MyApp.xcworkspace
661
689
 
662
690
  # Verify the built app on the simulator
663
691
  lim session start
@@ -667,7 +695,7 @@ lim ios element-tree | grep "Welcome"
667
695
  lim ios screenshot -o test-result.png
668
696
  lim session stop
669
697
 
670
- lim delete $ID
698
+ lim ios delete $ID
671
699
  ```
672
700
 
673
701
  ### Build-Only with Artifact Upload
@@ -675,9 +703,9 @@ lim delete $ID
675
703
  ```bash
676
704
  lim xcode create --rm --reuse-if-exists --label project=myapp
677
705
 
678
- lim xcode sync ./MyiOSProject
679
- lim xcode build --scheme MyApp --workspace MyApp.xcworkspace --upload myapp-latest
680
- lim asset pull myapp-latest -o ./build-output
706
+ lim xcode build ./MyiOSProject --scheme MyApp --workspace MyApp.xcworkspace --upload myapp-latest
707
+ lim asset list --name myapp-latest --json
708
+ lim asset pull asset_abc123 -o ./build-output
681
709
  ```
682
710
 
683
711
  ---
package/bin/run.js CHANGED
@@ -1,8 +1,63 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const oclif = require('@oclif/core');
3
+ const { flush } = require('@oclif/core');
4
+ const { Config } = require('@oclif/core/config');
5
+ const { handle } = require('@oclif/core/errors');
6
+ const { Help, standardizeIDFromArgv } = require('@oclif/core/help');
7
+ const { run } = require('@oclif/core/run');
4
8
 
5
- oclif
6
- .execute({ dir: __dirname, args: process.argv.slice(2) })
7
- .then(oclif.flush)
8
- .catch(oclif.Errors.handle);
9
+ function isUsageError(error) {
10
+ return typeof error?.message === 'string' && error.message.includes('\nSee more help with --help');
11
+ }
12
+
13
+ async function inferCommandArgv(argv) {
14
+ const config = await Config.load(__dirname);
15
+ const normalizedArgv = standardizeIDFromArgv([...argv], config);
16
+ const normalizedCommandId = normalizedArgv[0];
17
+
18
+ if (normalizedCommandId && config.findCommand(normalizedCommandId)) {
19
+ return { commandArgv: normalizedCommandId.split(':'), config };
20
+ }
21
+
22
+ const positionalPrefix = [];
23
+ for (const token of argv) {
24
+ if (token === '--' || token.startsWith('-')) break;
25
+ positionalPrefix.push(token);
26
+ }
27
+
28
+ for (let i = positionalPrefix.length; i > 0; i -= 1) {
29
+ const commandId = positionalPrefix.slice(0, i).join(':');
30
+ if (config.findCommand(commandId)) {
31
+ return { commandArgv: commandId.split(':'), config };
32
+ }
33
+ }
34
+
35
+ return { commandArgv: undefined, config };
36
+ }
37
+
38
+ async function handleError(error) {
39
+ if (!isUsageError(error)) {
40
+ await handle(error);
41
+ return;
42
+ }
43
+
44
+ error.message = error.message.replace(/\nSee more help with --help$/, '');
45
+
46
+ const { commandArgv, config } = await inferCommandArgv(process.argv.slice(2));
47
+ if (!commandArgv) {
48
+ await handle(error);
49
+ return;
50
+ }
51
+
52
+ console.error(typeof error.render === 'function' ? error.render() : error.message);
53
+ console.error();
54
+
55
+ const help = new Help(config, {
56
+ ...(config.pjson.oclif.helpOptions ?? config.pjson.helpOptions),
57
+ sendToStderr: true,
58
+ });
59
+ await help.showHelp(commandArgv);
60
+ process.exitCode = error.oclif?.exit ?? 1;
61
+ }
62
+
63
+ run(process.argv.slice(2), __dirname).catch(handleError).finally(flush);
@@ -4,12 +4,18 @@ export declare abstract class BaseCommand extends Command {
4
4
  static baseFlags: {
5
5
  'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
6
6
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
8
  };
8
9
  private _client?;
9
10
  protected get client(): Limrun;
10
11
  private _parsedFlags?;
11
12
  protected get parsedFlags(): Record<string, unknown> | undefined;
12
13
  protected setParsedFlags(flags: Record<string, unknown>): void;
14
+ protected isJsonEnabled(): boolean;
15
+ protected isQuietEnabled(): boolean;
16
+ protected shouldSuppressInfo(): boolean;
17
+ protected info(message?: string): void;
18
+ protected output(message?: string): void;
13
19
  protected withAuth<T>(fn: () => Promise<T>): Promise<T>;
14
20
  protected outputTable(headers: string[], rows: string[][]): void;
15
21
  protected outputJson(data: unknown): void;
@@ -1 +1 @@
1
- {"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,MAA+B,MAAM,aAAa,CAAC;AAO1D,8BAAsB,WAAY,SAAQ,OAAO;IAC/C,MAAM,CAAC,SAAS;;;MASd;IAEF,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,SAAS,KAAK,MAAM,IAAI,MAAM,CAc7B;IAED,OAAO,CAAC,YAAY,CAAC,CAA0B;IAE/C,SAAS,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAE/D;IAED,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;cAI9C,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAiB7D,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI;IAgBhE,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAIzC,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAKtD;;;OAGG;IACH,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;CAO5D"}
1
+ {"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,MAA+B,MAAM,aAAa,CAAC;AAO1D,8BAAsB,WAAY,SAAQ,OAAO;IAC/C,MAAM,CAAC,SAAS;;;;MAed;IAEF,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,SAAS,KAAK,MAAM,IAAI,MAAM,CAc7B;IAED,OAAO,CAAC,YAAY,CAAC,CAA0B;IAE/C,SAAS,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAE/D;IAED,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI9D,SAAS,CAAC,aAAa,IAAI,OAAO;IAIlC,SAAS,CAAC,cAAc,IAAI,OAAO;IAInC,SAAS,CAAC,kBAAkB,IAAI,OAAO;IAIvC,SAAS,CAAC,IAAI,CAAC,OAAO,SAAK,GAAG,IAAI;IAMlC,SAAS,CAAC,MAAM,CAAC,OAAO,SAAK,GAAG,IAAI;cAIpB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAiB7D,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI;IAgBhE,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAIzC,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAKtD;;;OAGG;IACH,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;CAO5D"}
@@ -60,6 +60,23 @@ class BaseCommand extends core_1.Command {
60
60
  setParsedFlags(flags) {
61
61
  this._parsedFlags = flags;
62
62
  }
63
+ isJsonEnabled() {
64
+ return Boolean(this.parsedFlags?.json);
65
+ }
66
+ isQuietEnabled() {
67
+ return Boolean(this.parsedFlags?.quiet);
68
+ }
69
+ shouldSuppressInfo() {
70
+ return this.isJsonEnabled() || this.isQuietEnabled();
71
+ }
72
+ info(message = '') {
73
+ if (!this.shouldSuppressInfo()) {
74
+ super.log(message);
75
+ }
76
+ }
77
+ output(message = '') {
78
+ super.log(message);
79
+ }
63
80
  async withAuth(fn) {
64
81
  try {
65
82
  return await fn();
@@ -67,9 +84,9 @@ class BaseCommand extends core_1.Command {
67
84
  catch (err) {
68
85
  if (err instanceof api_1.AuthenticationError) {
69
86
  const config = (0, config_1.readConfig)();
70
- this.log('Session expired. Logging in...');
87
+ this.info('Session expired. Logging in...');
71
88
  await (0, auth_1.login)(config.consoleEndpoint, VERSION);
72
- this.log('You are logged in now.');
89
+ this.info('You are logged in now.');
73
90
  // Reset client so it picks up the new key
74
91
  this._client = undefined;
75
92
  return fn();
@@ -87,14 +104,14 @@ class BaseCommand extends core_1.Command {
87
104
  });
88
105
  return obj;
89
106
  });
90
- this.log(JSON.stringify(objects, null, 2));
107
+ this.output(JSON.stringify(objects, null, 2));
91
108
  }
92
109
  else {
93
- this.log((0, formatting_1.renderTable)(headers, rows));
110
+ this.output((0, formatting_1.renderTable)(headers, rows));
94
111
  }
95
112
  }
96
113
  outputJson(data) {
97
- this.log(JSON.stringify(data, null, 2));
114
+ this.output(JSON.stringify(data, null, 2));
98
115
  }
99
116
  consoleStreamUrl(instanceId) {
100
117
  const baseUrl = (0, config_1.readConfig)().consoleEndpoint.replace(/\/+$/, '');
@@ -115,11 +132,15 @@ class BaseCommand extends core_1.Command {
115
132
  exports.BaseCommand = BaseCommand;
116
133
  BaseCommand.baseFlags = {
117
134
  'api-key': core_1.Flags.string({
118
- description: 'API key for authentication',
135
+ description: 'API key to use for this command. Overrides the saved login and can also be provided via LIM_API_KEY.',
119
136
  env: 'LIM_API_KEY',
120
137
  }),
121
138
  json: core_1.Flags.boolean({
122
- description: 'Output as JSON',
139
+ description: 'Output structured JSON instead of human-readable tables or plain text when the command supports it.',
140
+ default: false,
141
+ }),
142
+ quiet: core_1.Flags.boolean({
143
+ description: 'Suppress intermediate human-readable logs and only emit the final result.',
123
144
  default: false,
124
145
  }),
125
146
  };