qrlkit 0.5.5 → 0.6.1

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 +243 -0
  2. package/package.json +7 -6
package/README.md ADDED
@@ -0,0 +1,243 @@
1
+ <p align="center">
2
+ <img src="QRLs.png" alt="QRLs" width="500">
3
+ </p>
4
+
5
+ [![CI](https://github.com/qrlkit/qrlkit-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/qrlkit/qrlkit-rs/actions/workflows/ci.yml)
6
+ [![Crates.io](https://img.shields.io/crates/v/qrlkit.svg)](https://crates.io/crates/qrlkit)
7
+ [![Documentation](https://img.shields.io/badge/docs-qrlkit.github.io-blue.svg)](https://qrlkit.github.io/qrlkit-web/)
8
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
+
10
+ # Quick Resource Locators (QRLs)
11
+
12
+ Basic tool to keep your key resources quickly available at your fingertips.
13
+
14
+ Define a config with urls, dirs, scripts/snippets, files etc:
15
+
16
+ ```toml
17
+ # QRLs.toml
18
+
19
+ [repos]
20
+ rs = "https://github.com/qrlkit/qrlkit-rs"
21
+ web = "https://github.com/qrlkit/qrlkit-web"
22
+
23
+ [repos.prs]
24
+ rs = "https://github.com/qrlkit/qrlkit-rs"
25
+ web = "https://github.com/qrlkit/qrlkit-web/pulls"
26
+
27
+ [qk.check]
28
+ run = """
29
+ cargo fmt
30
+ cargo test
31
+ cargo clippy
32
+ python3 "~dev/qrlkit-rs/test/integration.py"
33
+ """
34
+ shell = "zsh"
35
+
36
+ [qk.dirs]
37
+ rs = "~/dev/qrlkit-rs"
38
+ web = "~/dev/qrlkit-web"
39
+ dirhook = "cd $dir && tree -L 1"
40
+
41
+ [files]
42
+ cargo-toml = "~/dev/qrlkit-rs/Cargo.toml"
43
+ readme = "~/dev/qrlkit-rs/README.md"
44
+ changelog = "~/dev/qrlkit-web/CHANGELOG.md"
45
+ filehook = "nvim $file"
46
+ ```
47
+
48
+ Import the file with `qrlkit add` and turn it in to a lightweight CLI tool:
49
+
50
+ ```sh
51
+ $ qrlkit add QRLs.toml
52
+
53
+ # Open a new terminal, then:
54
+
55
+ repos rs # Opens gh repo with browser
56
+ repos prs web # Opens prs for gh page in browser
57
+ qk check # Run standard rust checks and tests in chosen shell
58
+ qk dirs web # cd into dir and see content via custom dirhook
59
+ qk files readme # open qrlkit-rs README.md in neovim
60
+
61
+ ```
62
+
63
+ The tool is built to 1) optimize for adaptability to *your* flow:
64
+
65
+ - `qrlkit add <x>` accepts any file name and supports toml, json and yaml configs
66
+ - Set hooks to customize behavior for files and dirs in each config and/or globally
67
+ - Define your own CLI behavior:
68
+ - By setting config keys you decide if it's `logs live nginx` or `logs nginx live`.
69
+ - Name tools and paths what you want
70
+ - Multiple configs are supported at once. Make one for your projects, your machine or your team/org
71
+
72
+ and 2) have as little friction as possible:
73
+
74
+ - If you forget something run `qrlkit` to run any imported tool
75
+ - `qrlkit` will suggest the next keys if you get stuck
76
+
77
+
78
+ ## Install
79
+
80
+ *Step 1* Clone repo and install qrlkit binary
81
+
82
+ ```
83
+ git clone git@github.com:qrlkit/qrlkit-rs.git
84
+ cd qrlkit-rs
85
+ cargo install --path .
86
+
87
+ # Then start init to set the defaults you want (shell, browser etc)
88
+ qrlkit init
89
+ ```
90
+
91
+ *Step 2* Write some config you want
92
+
93
+ *Step 3* Add the config
94
+
95
+ ```
96
+ qrlkit add shortcuts.toml
97
+ ```
98
+
99
+ ## Version 1 Roadmap
100
+
101
+ **Version 1 happens January 2027. Until then expect everything to break.
102
+ Current version is 0.5.5 but any minor version can ship with a breaking change until v1.**
103
+
104
+ ### Version 1
105
+
106
+ #### `qrlkit` ####
107
+
108
+ - [x] init
109
+ - [x] add <file | dir path>
110
+ - [x] multiple configs at once
111
+ - [x] graceful collisions
112
+ - [x] qrlkit [keys…]
113
+ - [x] ls
114
+ - [x] rm <path>
115
+ - [x] reload
116
+ - [x] set-browser
117
+ - [x] set-filehook <command>
118
+ - [x] set-dirhook <command>
119
+ - [x] nuke
120
+ - [ ] merge keys collisions
121
+
122
+ #### config ####
123
+
124
+ - [x] yaml, json and toml
125
+ - [x] nested keys
126
+ - [x] URLs
127
+ - [x] files and dirs
128
+ - [x] shell scripts
129
+ - [x] variables in paths, urls, scripts
130
+ - [x] file hooks
131
+ - [x] dir hooks
132
+ - [x] browser hooks
133
+ - [x] run shell scripts
134
+ - [ ] automatic docs
135
+ - [ ] hardcoded arg suggestions
136
+ - [ ] constants
137
+
138
+ #### package managers ####
139
+
140
+ - [x] `cargo install`
141
+ - [x] `npm install`
142
+
143
+ #### Raw install ####
144
+
145
+ - [x] linux and macos binaries released on GitHub
146
+ - [x] install.sh
147
+
148
+ ## Commands
149
+
150
+ | Command | What it does |
151
+ | --- | --- |
152
+ | `qrlkit [keys…]` | Browse or open a resource |
153
+ | `qrlkit --config <path> …` | Use a separate state file for debugging |
154
+ | `qrlkit add <file-or-directory>` | Register configs and set up root commands |
155
+ | `qrlkit ls` | List registered config files |
156
+ | `qrlkit rm <path>` | Unregister a config; keep the file |
157
+ | `qrlkit reload` | Refresh imports and retry shell setup |
158
+ | `qrlkit set-browser` | Choose the default browser |
159
+ | `qrlkit set-filehook <command>` | Choose the default file action (`--clear` restores path printing) |
160
+ | `qrlkit set-dirhook <command>` | Choose the directory hook (`--clear` restores changing directory) |
161
+ | `qrlkit init` | Choose browser, shell, filehook, and dirhook interactively |
162
+ | `qrlkit init <shell>` | Print the directory wrapper for manual setup |
163
+ | `qrlkit nuke` | Reset imports, renames, browser selection, and hooks |
164
+ | `qrlkit --help` | Show help |
165
+
166
+ `nuke` keeps your original config files and installed shell integration.
167
+ State is stored in `$XDG_STATE_HOME/qrlkit/state.yaml` on Linux, falling back to
168
+ `~/.local/state/qrlkit/state.yaml`, or in
169
+ `~/Library/Application Support/qrlkit/state.yaml` on macOS. Use
170
+ `qrlkit --config <path> …` for separate state (usefull for debugging).
171
+
172
+ ## Config syntax
173
+
174
+ **URLs**
175
+
176
+ Urls open in the default browser set in `qrlkit init` or `qrlkit set-browser`.
177
+ Reserved key `browser` overrides it with options:
178
+
179
+ - `chrome`
180
+ - `firefox`
181
+ - `safari`
182
+ - `edge`
183
+ - `brave`
184
+ - `chromium`
185
+ - `arc`
186
+ - `vivaldi`
187
+ - `opera`
188
+
189
+ Executable paths are also supported.
190
+ Use `{}` to forward arguments to paths.
191
+
192
+ ```toml
193
+ [docs]
194
+ browser = "firefox"
195
+ fav = "https://some-docs-you-prefer-in-ff/{area}.com"
196
+ ```
197
+
198
+ **files**
199
+
200
+ Files use the default action set in `qrlkit init` or `qrlkit set-filehook`.
201
+ If neither is used they just otherwise print the file path.
202
+ Reserved key `filehook` overrides global behavior with a command using `$file` for the selected path.
203
+ Use `{}` in paths to forward arguments.
204
+
205
+ ```toml
206
+ [dotfiles]
207
+ filehook = "nvim $file"
208
+ edit = "~/.confg/{tool}/{file}"
209
+ ```
210
+
211
+ **dirs**
212
+
213
+ Dirs use the default action set in `qrlkit init` or `qrlkit set-dirhook`.
214
+ If neither is used they otherwise just `cd` into directory via shell integration.
215
+ Reserved key `dirhook` overrides global behavior with a command using `$dir` for the selected path.
216
+
217
+ ```toml
218
+ [dirs]
219
+ dirhook = "cd $dir && tree -L 1"
220
+ project = "~/dev/{repo}"
221
+ ```
222
+
223
+ **scripts**
224
+
225
+ Scripts run in Bash by default from the config's directory.
226
+ Reserved key `shell` overrides it with options `bash`, `sh`, and `zsh`.
227
+ Use `$` notation to pass arguments.
228
+
229
+ ```toml
230
+ [kube.logs]
231
+ run = '''
232
+ kubectl logs --namespace "$1" "$2" --follow
233
+ '''
234
+ shell = "zsh"
235
+ ```
236
+
237
+ ## Contributing
238
+
239
+ Contributions are welcome!
240
+ Either drop a PR or create an issue.
241
+
242
+
243
+ [MIT licensed](LICENSE).
package/package.json CHANGED
@@ -5,13 +5,14 @@
5
5
  "qrlkit": "bin/qrlkit.cjs"
6
6
  },
7
7
  "files": [
8
- "bin/qrlkit.cjs"
8
+ "bin/qrlkit.cjs",
9
+ "README.md"
9
10
  ],
10
11
  "optionalDependencies": {
11
- "qrlkit-darwin-arm64": "0.5.5",
12
- "qrlkit-darwin-x64": "0.5.5",
13
- "qrlkit-linux-arm64": "0.5.5",
14
- "qrlkit-linux-x64": "0.5.5"
12
+ "qrlkit-darwin-arm64": "0.6.1",
13
+ "qrlkit-darwin-x64": "0.6.1",
14
+ "qrlkit-linux-arm64": "0.6.1",
15
+ "qrlkit-linux-x64": "0.6.1"
15
16
  },
16
17
  "os": [
17
18
  "linux",
@@ -33,5 +34,5 @@
33
34
  "bugs": {
34
35
  "url": "https://github.com/qrlkit/qrlkit-rs/issues"
35
36
  },
36
- "version": "0.5.5"
37
+ "version": "0.6.1"
37
38
  }