pterm 0.0.15 → 0.0.16

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 (3) hide show
  1. package/README.md +85 -2
  2. package/package.json +1 -1
  3. package/util.js +20 -1
package/README.md CHANGED
@@ -108,9 +108,11 @@ Run a launcher. Equivalent to the user visiting a launcher page. Will run whiche
108
108
  ### syntax
109
109
 
110
110
  ```
111
- pterm run <launcher_path>
111
+ pterm run <launcher_path_or_uri> [--open]
112
112
  ```
113
113
 
114
+ - `--open`: (optional) open URL results in the browser. Default behavior is to print the URL to stdout without opening a browser.
115
+
114
116
  ### examples
115
117
 
116
118
  Launch the launcher in the current path
@@ -125,6 +127,88 @@ Launch from absolute path
125
127
  pterm run /pinokio/api/test
126
128
  ```
127
129
 
130
+ Run from a launcher URI and auto-open the resulting URL in browser
131
+
132
+ ```
133
+ pterm run https://github.com/example/my-launcher --open
134
+ ```
135
+
136
+ ## search
137
+
138
+ Search installed or available apps.
139
+
140
+ ### syntax
141
+
142
+ ```
143
+ pterm search [query words...]
144
+ pterm search --q="<query>"
145
+ pterm search "<query>" [--mode=balanced|broad|strict] [--min-match=<n>] [--limit=<n>]
146
+ ```
147
+
148
+ - `--mode`: (optional) search strategy. `broad` (default), `balanced`, or `strict`.
149
+ - `--min-match`: (optional) minimum number of query terms an app should match.
150
+ - `--limit`: (optional) max number of app results to return.
151
+
152
+ ### examples
153
+
154
+ ```
155
+ pterm search comfyui
156
+ ```
157
+
158
+ ```
159
+ pterm search --q="text generation"
160
+ ```
161
+
162
+ ```
163
+ pterm search "tts speech synthesis" --mode=balanced --min-match=2 --limit=8
164
+ ```
165
+
166
+ ## status
167
+
168
+ Get app status by app id.
169
+
170
+ ### syntax
171
+
172
+ ```
173
+ pterm status <app_id> [--probe] [--timeout=<ms>]
174
+ ```
175
+
176
+ - `--probe`: (optional) actively probe app health.
177
+ - `--timeout`: (optional) probe timeout in milliseconds.
178
+
179
+ ### examples
180
+
181
+ ```
182
+ pterm status comfyanonymous-comfyui
183
+ ```
184
+
185
+ ```
186
+ pterm status comfyanonymous-comfyui --probe --timeout=5000
187
+ ```
188
+
189
+ ## logs
190
+
191
+ Get app logs by app id.
192
+
193
+ ### syntax
194
+
195
+ ```
196
+ pterm logs <app_id> [--script=<name>] [--tail=<lines>]
197
+ ```
198
+
199
+ - `--script`: (optional) filter to a script.
200
+ - `--tail`: (optional) return only the last N lines.
201
+
202
+ ### examples
203
+
204
+ ```
205
+ pterm logs comfyanonymous-comfyui
206
+ ```
207
+
208
+ ```
209
+ pterm logs comfyanonymous-comfyui --script=start --tail=200
210
+ ```
211
+
128
212
  ## filepicker
129
213
 
130
214
  Display a file picker dialog, which lets the user select one or more file or folder paths, powered by tkinter.
@@ -268,4 +352,3 @@ pterm push 'this is a notification' --sound
268
352
  ```
269
353
  pterm push 'this is an image notification' --image=icon.png
270
354
  ```
271
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pterm",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/util.js CHANGED
@@ -9,8 +9,27 @@ class Util {
9
9
  }
10
10
  async search(argv) {
11
11
  const query = (argv._.slice(1).join(" ") || argv.q || "").trim()
12
+ const params = { q: query }
13
+ const mode = typeof argv.mode === "string" ? argv.mode.trim().toLowerCase() : ""
14
+ const minMatchRaw = argv.minMatch ?? argv["min-match"] ?? argv.min_match
15
+ const limitRaw = argv.limit
16
+ if (mode === "broad" || mode === "balanced" || mode === "strict") {
17
+ params.mode = mode
18
+ }
19
+ if (minMatchRaw !== undefined && minMatchRaw !== null && minMatchRaw !== "") {
20
+ const minMatch = Number.parseInt(String(minMatchRaw), 10)
21
+ if (Number.isFinite(minMatch) && minMatch > 0) {
22
+ params.min_match = String(minMatch)
23
+ }
24
+ }
25
+ if (limitRaw !== undefined && limitRaw !== null && limitRaw !== "") {
26
+ const limit = Number.parseInt(String(limitRaw), 10)
27
+ if (Number.isFinite(limit) && limit > 0) {
28
+ params.limit = String(limit)
29
+ }
30
+ }
12
31
  const response = await axios.get("http://localhost:42000/apps/search", {
13
- params: { q: query }
32
+ params
14
33
  })
15
34
  this.printJson(response.data)
16
35
  }