qrlkit 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -178
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -193,63 +193,25 @@ State is stored in `$XDG_STATE_HOME/qrlkit/state.yaml` on Linux, falling back to
|
|
|
193
193
|
|
|
194
194
|
## Config syntax
|
|
195
195
|
|
|
196
|
-
Each example replaces the previous one.
|
|
197
|
-
|
|
198
|
-
References use their full path, like `{shared.repos}`.
|
|
199
|
-
Strings supply fixed values. Lists offer choices when no value is supplied.
|
|
200
|
-
CLI values follow first-reference order, including lookup inputs.
|
|
201
|
-
Use `args` to declare argument order. Repeated references reuse the same selection.
|
|
202
|
-
|
|
203
196
|
### URLs
|
|
204
197
|
|
|
205
198
|
Open URLs in your default browser.
|
|
206
199
|
|
|
207
200
|
```toml
|
|
208
201
|
[repos]
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Choose the repository with an argument.
|
|
213
|
-
|
|
214
|
-
```toml
|
|
215
|
-
[repos]
|
|
216
|
-
open = "https://github.com/qrlkit/{repo}"
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Reuse an organization.
|
|
220
|
-
|
|
221
|
-
```toml
|
|
222
|
-
[shared]
|
|
223
|
-
hidden = true
|
|
224
|
-
org = "qrlkit"
|
|
225
|
-
|
|
226
|
-
[repos]
|
|
227
|
-
open = "https://github.com/{shared.org}/{repo}"
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
Add hints and override the browser.
|
|
231
|
-
|
|
232
|
-
```toml
|
|
233
|
-
[shared]
|
|
234
|
-
hidden = true
|
|
235
|
-
org = "qrlkit"
|
|
236
|
-
|
|
237
|
-
[repos]
|
|
238
|
-
browser = "firefox"
|
|
239
|
-
# hint: Browse the source code
|
|
240
|
-
open = "https://github.com/{shared.org}/{repo}"
|
|
202
|
+
rs = "https://github.com/qrlkit/qrlkit-rs"
|
|
241
203
|
```
|
|
242
204
|
|
|
243
|
-
|
|
205
|
+
Or go advanced with reuseable constants and hints.
|
|
244
206
|
|
|
245
207
|
```toml
|
|
246
|
-
[
|
|
208
|
+
[const]
|
|
247
209
|
hidden = true
|
|
248
210
|
org = "qrlkit"
|
|
249
211
|
repos = ["qrlkit-rs", "qrlkit-web"]
|
|
250
212
|
|
|
251
213
|
[repos.open]
|
|
252
|
-
url = "https://github.com/{
|
|
214
|
+
url = "https://github.com/{const.org}/{const.repos}"
|
|
253
215
|
hint = "Browse the source code"
|
|
254
216
|
browser = "firefox"
|
|
255
217
|
```
|
|
@@ -273,46 +235,16 @@ Print file paths without configured hooks.
|
|
|
273
235
|
readme = "~/dev/qrlkit-rs/README.md"
|
|
274
236
|
```
|
|
275
237
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
```toml
|
|
279
|
-
[files]
|
|
280
|
-
readme = "~/dev/{repo}/README.md"
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Reuse your development directory across paths.
|
|
238
|
+
Or beef it up with reuseable constants, hints and a custom filehook:
|
|
284
239
|
|
|
285
240
|
```toml
|
|
286
|
-
[
|
|
287
|
-
hidden = true
|
|
288
|
-
root = "~/dev"
|
|
289
|
-
|
|
290
|
-
[files]
|
|
291
|
-
readme = "{shared.root}/{repo}/README.md"
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
Add hints and open your editor.
|
|
295
|
-
|
|
296
|
-
```toml
|
|
297
|
-
[shared]
|
|
298
|
-
hidden = true
|
|
299
|
-
root = "~/dev"
|
|
300
|
-
|
|
301
|
-
[files]
|
|
302
|
-
filehook = "nvim $file"
|
|
303
|
-
readme = "{shared.root}/{repo}/README.md" # hint: Edit the project README
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
Offer project choices before opening files.
|
|
307
|
-
|
|
308
|
-
```toml
|
|
309
|
-
[shared]
|
|
241
|
+
[const]
|
|
310
242
|
hidden = true
|
|
311
243
|
root = "~/dev"
|
|
312
244
|
repos = ["qrlkit-rs", "qrlkit-web"]
|
|
313
245
|
|
|
314
246
|
[files.readme]
|
|
315
|
-
url = "{
|
|
247
|
+
url = "{const.root}/{const.repos}/README.md"
|
|
316
248
|
hint = "Edit the project README"
|
|
317
249
|
filehook = "nvim $file"
|
|
318
250
|
```
|
|
@@ -322,52 +254,19 @@ qrlkit files readme qrlkit-rs # Open directly
|
|
|
322
254
|
qrlkit files readme # Choose interactively
|
|
323
255
|
```
|
|
324
256
|
|
|
325
|
-
Set global defaults with `qrlkit set-filehook`.
|
|
326
|
-
|
|
327
257
|
### Dirs
|
|
328
258
|
|
|
329
|
-
|
|
259
|
+
By default you can `cd` into a dir:
|
|
330
260
|
|
|
331
261
|
```toml
|
|
332
262
|
[dirs]
|
|
333
263
|
project = "~/dev/qrlkit-rs"
|
|
334
264
|
```
|
|
335
265
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
```toml
|
|
339
|
-
[dirs]
|
|
340
|
-
project = "~/dev/{repo}"
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
Reuse your development directory across projects.
|
|
266
|
+
Or mod it similarly to files and urls with consts, dirhooks and hints:
|
|
344
267
|
|
|
345
268
|
```toml
|
|
346
|
-
[
|
|
347
|
-
hidden = true
|
|
348
|
-
root = "~/dev"
|
|
349
|
-
|
|
350
|
-
[dirs]
|
|
351
|
-
project = "{shared.root}/{repo}"
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
Add hints and list directory contents.
|
|
355
|
-
|
|
356
|
-
```toml
|
|
357
|
-
[shared]
|
|
358
|
-
hidden = true
|
|
359
|
-
root = "~/dev"
|
|
360
|
-
|
|
361
|
-
[dirs]
|
|
362
|
-
dirhook = "cd $dir && tree -L 1"
|
|
363
|
-
# hint: Enter and inspect the project
|
|
364
|
-
project = "{shared.root}/{repo}"
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
Offer project choices before changing directories.
|
|
368
|
-
|
|
369
|
-
```toml
|
|
370
|
-
[shared]
|
|
269
|
+
[const]
|
|
371
270
|
hidden = true
|
|
372
271
|
root = "~/dev"
|
|
373
272
|
repos = ["qrlkit-rs", "qrlkit-web"]
|
|
@@ -383,8 +282,6 @@ qrlkit dirs project qrlkit-rs # Open directly
|
|
|
383
282
|
qrlkit dirs project # Choose interactively
|
|
384
283
|
```
|
|
385
284
|
|
|
386
|
-
Set global defaults with `qrlkit set-dirhook`.
|
|
387
|
-
|
|
388
285
|
### Scripts
|
|
389
286
|
|
|
390
287
|
Run Bash from the config's directory.
|
|
@@ -463,23 +360,6 @@ qrlkit greet Hey
|
|
|
463
360
|
|
|
464
361
|
Supported shells: `bash`, `sh`, and `zsh`.
|
|
465
362
|
|
|
466
|
-
Use a script's output in another resource.
|
|
467
|
-
|
|
468
|
-
```toml
|
|
469
|
-
[system]
|
|
470
|
-
hidden = true
|
|
471
|
-
|
|
472
|
-
[system.hostname]
|
|
473
|
-
run = "hostname"
|
|
474
|
-
|
|
475
|
-
[logs]
|
|
476
|
-
url = "https://logs.example.com/search?host={system.hostname}"
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Referenced scripts run only when needed. Their stdout is reused within the command,
|
|
480
|
-
with trailing newlines removed. A failed script stops the command.
|
|
481
|
-
Script bodies stay literal; use `args` and `env` to pass values.
|
|
482
|
-
|
|
483
363
|
### Shared values
|
|
484
364
|
|
|
485
365
|
Put shared values in any config and register it with `qrlkit add`.
|
|
@@ -510,71 +390,58 @@ run = 'printf "Hello, %s!\n" "$NAME"'
|
|
|
510
390
|
NAME = "{shared.name}"
|
|
511
391
|
```
|
|
512
392
|
|
|
513
|
-
`constants.toml` is no longer loaded automatically. Register shared values explicitly
|
|
514
|
-
and replace `{global.name}` with their full path. `constants` is now an ordinary group.
|
|
515
|
-
|
|
516
393
|
### Composition
|
|
517
394
|
|
|
518
|
-
|
|
395
|
+
`qrlkit` offers a few ways to compose one QRL from multiple others. First principle is that everything is callable and referenceable if its not `hidden = true`.
|
|
519
396
|
|
|
520
|
-
|
|
521
|
-
[shared]
|
|
522
|
-
hidden = true
|
|
523
|
-
repos = ["qrlkit-rs", "qrlkit-web"]
|
|
524
|
-
|
|
525
|
-
[repos.open]
|
|
526
|
-
url = "https://github.com/qrlkit/{shared.repos}"
|
|
527
|
-
|
|
528
|
-
[repos.prs]
|
|
529
|
-
url = "{repos.open}/pulls"
|
|
530
|
-
```
|
|
531
|
-
|
|
532
|
-
```sh
|
|
533
|
-
repos prs qrlkit-web # Opens the repository's pull requests
|
|
534
|
-
repos prs # Choose the repository
|
|
397
|
+
** One QRL calls another**
|
|
535
398
|
```
|
|
399
|
+
[qrl-1]
|
|
400
|
+
url = "https:/..."
|
|
536
401
|
|
|
537
|
-
|
|
402
|
+
[qrl-1.qrl-2]
|
|
403
|
+
run = 'echo "sub/path"'
|
|
538
404
|
|
|
539
|
-
|
|
405
|
+
[qrl-3]
|
|
406
|
+
url = "{qrl-1}/{qrl-1.qrl-2}"
|
|
407
|
+
```
|
|
408
|
+
Not here its possible to chain keys with a dot like `objs.fruits.apples`.
|
|
540
409
|
|
|
541
|
-
|
|
542
|
-
or multiple selectors to walk nested mappings.
|
|
410
|
+
** Group static fields and ref them**
|
|
543
411
|
|
|
544
412
|
```toml
|
|
545
|
-
[
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
[shared]
|
|
550
|
-
hidden = true
|
|
551
|
-
environments = ["sim", "live"]
|
|
413
|
+
[args]
|
|
414
|
+
floors = ["1", "2", "3"]
|
|
415
|
+
apartment = ["a", "b", "c"]
|
|
552
416
|
|
|
553
|
-
[
|
|
554
|
-
url = "https://{
|
|
417
|
+
[ding]
|
|
418
|
+
url = "https://ding-a.door/{floor}/{apartment}"
|
|
419
|
+
args = [
|
|
420
|
+
{ name = "floor", enum = { ref = "args.floors" } },
|
|
421
|
+
{ name = "apartment", enum = { ref = "args.apartment" } },
|
|
422
|
+
]
|
|
423
|
+
```
|
|
555
424
|
|
|
556
|
-
|
|
557
|
-
hidden = true
|
|
425
|
+
**Dynamically look up keys**
|
|
558
426
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
427
|
+
```toml
|
|
428
|
+
[args]
|
|
429
|
+
project = ["docs", "status"]
|
|
430
|
+
environment = ["staging", "prod"]
|
|
562
431
|
|
|
563
|
-
[
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
```
|
|
432
|
+
[domains.docs]
|
|
433
|
+
staging = "docs-staging.example.com"
|
|
434
|
+
prod = "docs.example.com"
|
|
567
435
|
|
|
568
|
-
|
|
436
|
+
[domains.status]
|
|
437
|
+
staging = "status-staging.example.com"
|
|
438
|
+
prod = "status.example.com"
|
|
569
439
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
logs qrlkit-rs # Choose the environment
|
|
573
|
-
logs # Choose the repository and environment
|
|
440
|
+
[site]
|
|
441
|
+
url = "https://{domains[args.project, args.environment]}"
|
|
574
442
|
```
|
|
575
443
|
|
|
576
|
-
|
|
577
|
-
use `--` before a value that matches a child command's name.
|
|
444
|
+
Here `domains[args.project, args.environment]` resolves by first prompting for project (`docs` or `status`) and then use that to select either `[domains.docs]` or `[domains.status]` and prompt for a environment (`staging` or `prod`).
|
|
578
445
|
|
|
579
446
|
### Hints and hidden groups
|
|
580
447
|
|
package/package.json
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
11
|
"optionalDependencies": {
|
|
12
|
-
"qrlkit-darwin-arm64": "0.
|
|
13
|
-
"qrlkit-darwin-x64": "0.
|
|
14
|
-
"qrlkit-linux-arm64": "0.
|
|
15
|
-
"qrlkit-linux-x64": "0.
|
|
12
|
+
"qrlkit-darwin-arm64": "0.13.0",
|
|
13
|
+
"qrlkit-darwin-x64": "0.13.0",
|
|
14
|
+
"qrlkit-linux-arm64": "0.13.0",
|
|
15
|
+
"qrlkit-linux-x64": "0.13.0"
|
|
16
16
|
},
|
|
17
17
|
"os": [
|
|
18
18
|
"linux",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/qrlkit/qrlkit-rs/issues"
|
|
36
36
|
},
|
|
37
|
-
"version": "0.
|
|
37
|
+
"version": "0.13.0"
|
|
38
38
|
}
|