qrlkit 0.10.3 → 0.12.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 (2) hide show
  1. package/README.md +270 -51
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -113,9 +113,9 @@ cargo install --path .
113
113
  ## Version 1 Roadmap
114
114
 
115
115
  **Version 1 happens January 2027. Until then expect everything to break.
116
- Current version is 0.5.5 but any minor version can ship with a breaking change until v1.**
116
+ Current version is 0.10.3 but any minor version can ship with a breaking change until v1.**
117
117
 
118
- ### Version 1
118
+ ### Version 1.0.0 goals
119
119
 
120
120
  #### `qrlkit` ####
121
121
 
@@ -175,7 +175,14 @@ Current version is 0.5.5 but any minor version can ship with a breaking change u
175
175
  | `qrlkit set-dirhook <command>` | Choose the directory hook (`--clear` restores changing directory) |
176
176
  | `qrlkit init` | Choose browser, shell, filehook, and dirhook interactively |
177
177
  | `qrlkit init <shell>` | Print the directory wrapper for manual setup |
178
- | `qrlkit nuke` | Reset imports, renames, browser selection, and hooks |
178
+ | `qrlkit nuke` | Reset imports, renames, browser selection, hooks, and theme settings |
179
+ | `qrlkit themes` | List themes with previews |
180
+ | `qrlkit themes current` | Show the global theme and tool policy |
181
+ | `qrlkit themes add <file>` | Import a theme without activating it |
182
+ | `qrlkit themes set [name]` | Set the global theme; omit name for live previews |
183
+ | `qrlkit themes tools <on/off>` | Enable or disable tool themes |
184
+ | `qrlkit themes tools deny <tool>` | Ignore a tool's theme |
185
+ | `qrlkit themes tools reset <tool>` | Remove a tool's theme exclusion |
179
186
  | `qrlkit --help` | Show help |
180
187
 
181
188
  `nuke` keeps your original config files and installed shell integration.
@@ -188,8 +195,10 @@ State is stored in `$XDG_STATE_HOME/qrlkit/state.yaml` on Linux, falling back to
188
195
 
189
196
  Each example replaces the previous one.
190
197
 
191
- Resource arguments match every placeholder name.
192
- CLI values follow argument declaration order.
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.
193
202
 
194
203
  ### URLs
195
204
 
@@ -207,42 +216,42 @@ Choose the repository with an argument.
207
216
  open = "https://github.com/qrlkit/{repo}"
208
217
  ```
209
218
 
210
- Reuse an organization through a constant.
219
+ Reuse an organization.
211
220
 
212
221
  ```toml
213
- [constants]
222
+ [shared]
223
+ hidden = true
214
224
  org = "qrlkit"
215
225
 
216
226
  [repos]
217
- open = "https://github.com/{constants.org}/{repo}"
227
+ open = "https://github.com/{shared.org}/{repo}"
218
228
  ```
219
229
 
220
230
  Add hints and override the browser.
221
231
 
222
232
  ```toml
223
- [constants]
233
+ [shared]
234
+ hidden = true
224
235
  org = "qrlkit"
225
236
 
226
237
  [repos]
227
238
  browser = "firefox"
228
239
  # hint: Browse the source code
229
- open = "https://github.com/{constants.org}/{repo}"
240
+ open = "https://github.com/{shared.org}/{repo}"
230
241
  ```
231
242
 
232
- Offer repository choices from a constant.
243
+ Offer repository choices.
233
244
 
234
245
  ```toml
235
- [constants]
246
+ [shared]
247
+ hidden = true
236
248
  org = "qrlkit"
237
249
  repos = ["qrlkit-rs", "qrlkit-web"]
238
250
 
239
251
  [repos.open]
240
- url = "https://github.com/{constants.org}/{repo}"
252
+ url = "https://github.com/{shared.org}/{shared.repos}"
241
253
  hint = "Browse the source code"
242
254
  browser = "firefox"
243
- args = [
244
- { name = "repo", enum = { ref = "constants.repos" } },
245
- ]
246
255
  ```
247
256
 
248
257
  ```sh
@@ -274,37 +283,38 @@ readme = "~/dev/{repo}/README.md"
274
283
  Reuse your development directory across paths.
275
284
 
276
285
  ```toml
277
- [constants]
286
+ [shared]
287
+ hidden = true
278
288
  root = "~/dev"
279
289
 
280
290
  [files]
281
- readme = "{constants.root}/{repo}/README.md"
291
+ readme = "{shared.root}/{repo}/README.md"
282
292
  ```
283
293
 
284
294
  Add hints and open your editor.
285
295
 
286
296
  ```toml
287
- [constants]
297
+ [shared]
298
+ hidden = true
288
299
  root = "~/dev"
289
300
 
290
301
  [files]
291
302
  filehook = "nvim $file"
292
- readme = "{constants.root}/{repo}/README.md" # hint: Edit the project README
303
+ readme = "{shared.root}/{repo}/README.md" # hint: Edit the project README
293
304
  ```
294
305
 
295
306
  Offer project choices before opening files.
296
307
 
297
308
  ```toml
298
- [constants]
309
+ [shared]
310
+ hidden = true
299
311
  root = "~/dev"
312
+ repos = ["qrlkit-rs", "qrlkit-web"]
300
313
 
301
314
  [files.readme]
302
- url = "{constants.root}/{repo}/README.md"
315
+ url = "{shared.root}/{shared.repos}/README.md"
303
316
  hint = "Edit the project README"
304
317
  filehook = "nvim $file"
305
- args = [
306
- { name = "repo", enum = ["qrlkit-rs", "qrlkit-web"] },
307
- ]
308
318
  ```
309
319
 
310
320
  ```sh
@@ -333,38 +343,39 @@ project = "~/dev/{repo}"
333
343
  Reuse your development directory across projects.
334
344
 
335
345
  ```toml
336
- [constants]
346
+ [shared]
347
+ hidden = true
337
348
  root = "~/dev"
338
349
 
339
350
  [dirs]
340
- project = "{constants.root}/{repo}"
351
+ project = "{shared.root}/{repo}"
341
352
  ```
342
353
 
343
354
  Add hints and list directory contents.
344
355
 
345
356
  ```toml
346
- [constants]
357
+ [shared]
358
+ hidden = true
347
359
  root = "~/dev"
348
360
 
349
361
  [dirs]
350
362
  dirhook = "cd $dir && tree -L 1"
351
363
  # hint: Enter and inspect the project
352
- project = "{constants.root}/{repo}"
364
+ project = "{shared.root}/{repo}"
353
365
  ```
354
366
 
355
367
  Offer project choices before changing directories.
356
368
 
357
369
  ```toml
358
- [constants]
370
+ [shared]
371
+ hidden = true
359
372
  root = "~/dev"
373
+ repos = ["qrlkit-rs", "qrlkit-web"]
360
374
 
361
375
  [dirs.project]
362
- url = "{constants.root}/{repo}"
376
+ url = "{shared.root}/{shared.repos}"
363
377
  hint = "Enter and inspect the project"
364
378
  dirhook = "cd $dir && tree -L 1"
365
- args = [
366
- { name = "repo", enum = ["qrlkit-rs", "qrlkit-web"] },
367
- ]
368
379
  ```
369
380
 
370
381
  ```sh
@@ -391,40 +402,43 @@ args = [{ name = "name" }]
391
402
  run = 'printf "Hello, %s!\n" "$1"'
392
403
  ```
393
404
 
394
- Supply constants through `env` without prompting.
405
+ Supply fixed values through `env` without prompting.
395
406
 
396
407
  ```toml
397
- [constants]
408
+ [shared]
409
+ hidden = true
398
410
  name = "World"
399
411
 
400
412
  [greet]
401
413
  run = 'printf "Hello, %s!\n" "$NAME"'
402
414
 
403
415
  [greet.env]
404
- NAME = "{constants.name}"
416
+ NAME = "{shared.name}"
405
417
  ```
406
418
 
407
- Combine constant values with argument choices.
419
+ Combine shared values with argument choices.
408
420
 
409
421
  ```toml
410
- [constants]
422
+ [shared]
423
+ hidden = true
411
424
  name = "World"
412
425
  greetings = ["Hello", "Hi", "Hey"]
413
426
 
414
427
  [greet]
415
428
  args = [
416
- { name = "greeting", enum = { ref = "constants.greetings" } },
429
+ { name = "greeting", enum = { ref = "shared.greetings" } },
417
430
  ]
418
431
  run = 'printf "%s, %s!\n" "$1" "$NAME"'
419
432
 
420
433
  [greet.env]
421
- NAME = "{constants.name}"
434
+ NAME = "{shared.name}"
422
435
  ```
423
436
 
424
437
  Add hints and choose your shell.
425
438
 
426
439
  ```toml
427
- [constants]
440
+ [shared]
441
+ hidden = true
428
442
  name = "World"
429
443
  greetings = ["Hello", "Hi", "Hey"]
430
444
 
@@ -432,7 +446,7 @@ greetings = ["Hello", "Hi", "Hey"]
432
446
  hint = "Say hello with some personality"
433
447
  shell = "zsh"
434
448
  args = [
435
- { name = "greeting", enum = { ref = "constants.greetings" } },
449
+ { name = "greeting", enum = { ref = "shared.greetings" } },
436
450
  ]
437
451
  run = '''
438
452
  printf '%s, %s!\n' "$1" "$NAME"
@@ -440,7 +454,7 @@ printf 'Have a lovely day!\n'
440
454
  '''
441
455
 
442
456
  [greet.env]
443
- NAME = "{constants.name}"
457
+ NAME = "{shared.name}"
444
458
  ```
445
459
 
446
460
  ```sh
@@ -449,31 +463,236 @@ qrlkit greet Hey
449
463
 
450
464
  Supported shells: `bash`, `sh`, and `zsh`.
451
465
 
452
- ### Shared constants
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
+ ### Shared values
453
484
 
454
- Place `constants.toml` beside your state file.
485
+ Put shared values in any config and register it with `qrlkit add`.
455
486
 
456
487
  ```toml
457
- # constants.toml
458
- [constants]
488
+ # shared.toml
489
+ [shared]
490
+ hidden = true
459
491
  root = "~/dev"
460
492
  name = "World"
461
493
  ```
462
494
 
463
- Reference shared constants with `{global.name}` syntax.
495
+ ```sh
496
+ qrlkit add shared.toml
497
+ ```
498
+
499
+ Reference them from other registered configs.
464
500
 
465
501
  ```toml
466
502
  # QRLs.toml
467
503
  [dirs]
468
- project = "{global.root}/{repo}"
504
+ project = "{shared.root}/{repo}"
469
505
 
470
506
  [greet]
471
507
  run = 'printf "Hello, %s!\n" "$NAME"'
472
508
 
473
509
  [greet.env]
474
- NAME = "{global.name}"
510
+ NAME = "{shared.name}"
511
+ ```
512
+
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
+ ### Composition
517
+
518
+ Reference another resource's target without opening it.
519
+
520
+ ```toml
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
535
+ ```
536
+
537
+ Missing references and circular dependencies are errors.
538
+
539
+ ### Lookups
540
+
541
+ Choose a URL part from a mapping. Use one selector for a flat mapping,
542
+ or multiple selectors to walk nested mappings.
543
+
544
+ ```toml
545
+ [projects]
546
+ hidden = true
547
+ repos = ["qrlkit-rs", "qrlkit-web"]
548
+
549
+ [shared]
550
+ hidden = true
551
+ environments = ["sim", "live"]
552
+
553
+ [logs]
554
+ url = "https://{logs.subdomains[projects.repos, shared.environments]}.logs.example.com"
555
+
556
+ [logs.subdomains]
557
+ hidden = true
558
+
559
+ [logs.subdomains.qrlkit-rs]
560
+ sim = "rust-sandbox"
561
+ live = "rust-production"
562
+
563
+ [logs.subdomains.qrlkit-web]
564
+ sim = "web-sandbox"
565
+ live = "web-production"
566
+ ```
567
+
568
+ Put `url` directly on a group to call it without a subcommand.
569
+
570
+ ```sh
571
+ logs qrlkit-rs live # Opens https://rust-production.logs.example.com
572
+ logs qrlkit-rs # Choose the environment
573
+ logs # Choose the repository and environment
574
+ ```
575
+
576
+ Missing lookup keys are errors. Child commands take precedence over arguments;
577
+ use `--` before a value that matches a child command's name.
578
+
579
+ ### Hints and hidden groups
580
+
581
+ Hide a group from pickers with `hidden = true`. Its values can still be referenced
582
+ or called directly. Add hints to groups, tools, lists, and individual choices.
583
+
584
+ ```toml
585
+ [projects]
586
+ hidden = true
587
+
588
+ [projects.repos]
589
+ hint = "Choose a qrlkit project"
590
+ values = [
591
+ { value = "qrlkit-rs", hint = "Rust CLI" },
592
+ { value = "qrlkit-web", hint = "Documentation website" },
593
+ ]
594
+
595
+ [repos]
596
+ hint = "GitHub resources"
597
+
598
+ [repos.open]
599
+ hint = "Browse the repository"
600
+ url = "https://github.com/qrlkit/{projects.repos}"
601
+ ```
602
+
603
+ ```sh
604
+ repos open # Choose a repository with hints
605
+ projects repos # Choose and print a value from the hidden group
606
+ ```
607
+
608
+ Use `values = ["qrlkit-rs", "qrlkit-web"]` when only the list needs a hint.
609
+ Each tool keeps its own hint when composing resources.
610
+
611
+ See [examples/composition.toml](examples/composition.toml) for a complete config.
612
+
613
+ ## Themes
614
+
615
+ Make the picker fit your terminal.
616
+
617
+ Available themes:
618
+ `terminal` (default), `catppuccin-latte`, `catppuccin-mocha`, `dracula`,
619
+ `gruvbox-dark`, `gruvbox-light`, `nord`, and `tokyo-night`.
620
+
621
+ Preview the themes and choose a global default.
622
+
623
+ ```sh
624
+ qrlkit themes # List themes with previews
625
+ qrlkit themes set # Preview as you navigate; Enter saves, Esc cancels
626
+ qrlkit themes set dracula # Choose directly
627
+ qrlkit themes current # Show your theme and tool policy
475
628
  ```
476
629
 
630
+ Give a tool its own theme in the config.
631
+
632
+ ```toml
633
+ [gh]
634
+ theme = "dracula"
635
+ home = "https://github.com"
636
+ ```
637
+
638
+ Or choose the colors, box and selection marker yourself.
639
+
640
+ ```toml
641
+ [gh]
642
+ home = "https://github.com"
643
+
644
+ [gh.theme]
645
+ background = "#1e1e2e"
646
+ text = "#cdd6f4"
647
+ selected = "#ffffff"
648
+ selected_background = "#45475a"
649
+ hint = "#a6adc8"
650
+ title = "#cba6f7"
651
+ border = "rounded" # none, plain, rounded, or double
652
+ border_color = "#9399b2"
653
+ marker = "--x"
654
+ selection_width = "row" # Or content: highlight only the marker, key and hint
655
+ ```
656
+
657
+ Nested keys keep their parent's theme unless they define their own.
658
+ A new theme replaces the whole thing. Missing values use terminal colors,
659
+ no border, a `>` marker and full-row selection. Themes are never mixed.
660
+ Use `"default"` for a color to restore your terminal's color.
661
+
662
+ Save your own global theme in a separate file with a name inside `[theme]`.
663
+
664
+ ```toml
665
+ # personal-theme.toml
666
+ [theme]
667
+ name = "personal"
668
+ background = "#1e1e2e"
669
+ text = "#cdd6f4"
670
+ selected = "#cba6f7"
671
+ selected_background = "#45475a"
672
+ border = "rounded"
673
+ ```
674
+
675
+ ```sh
676
+ qrlkit themes add personal-theme.toml
677
+ qrlkit themes set personal
678
+ ```
679
+
680
+ Importing saves a copy and adds it to the list.
681
+
682
+ Tool themes are on by default. Turn them off to use your global theme everywhere,
683
+ or exclude a single tool and all its nested keys.
684
+
685
+ ```sh
686
+ qrlkit themes tools off # Use your global theme everywhere
687
+ qrlkit themes tools on # Use tool themes where defined
688
+ qrlkit themes tools deny gh # Use your global theme for gh
689
+ qrlkit themes tools reset gh # Remove gh's exclusion
690
+ ```
691
+
692
+ Tools without a theme use your global default. Exclusions survive off/on toggles.
693
+ `qrlkit nuke` resets the theme to `terminal`, enables tool themes and removes
694
+ exclusions and imported themes.
695
+
477
696
  ## Contributing
478
697
 
479
698
  Contributions are welcome!
package/package.json CHANGED
@@ -9,10 +9,10 @@
9
9
  "README.md"
10
10
  ],
11
11
  "optionalDependencies": {
12
- "qrlkit-darwin-arm64": "0.10.3",
13
- "qrlkit-darwin-x64": "0.10.3",
14
- "qrlkit-linux-arm64": "0.10.3",
15
- "qrlkit-linux-x64": "0.10.3"
12
+ "qrlkit-darwin-arm64": "0.12.0",
13
+ "qrlkit-darwin-x64": "0.12.0",
14
+ "qrlkit-linux-arm64": "0.12.0",
15
+ "qrlkit-linux-x64": "0.12.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.10.3"
37
+ "version": "0.12.0"
38
38
  }