@kaynooo/cli-pick 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +20 -2
- package/dist/pick.js +1294 -0
- package/package.json +38 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kaynooo <contact@kaynooo.fr>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kaynooo/cli-pick
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`pick` is a fuzzy selector in the colours of the other @kaynooo CLIs: lines on stdin, the chosen one on stdout. It is for a person at a terminal, not for a Claude Code session, which has no terminal to answer it.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bun add -g @kaynooo/cli-pick
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
| Command | What it does |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `git branch --format='%(refname:short)' \| pick` | filters the lines as you type and prints the one you pick |
|
|
12
|
+
| `ls \| pick --multi` | tab marks lines, enter prints the marked ones (the highlighted one when none is marked) |
|
|
13
|
+
| `pick --prompt 'branch> ' --query main` | a custom prompt, a query to start with |
|
|
14
|
+
| `ls \| pick --preview 'head -20 {}'` | a pane on the right (terminal at least 80 columns) shows the command run for the highlighted line, `{}` shell-quoted |
|
|
15
|
+
| `--height 12`, `--height 60%` | lines or a share of the terminal to draw in (40%) |
|
|
16
|
+
|
|
17
|
+
Keys: type to filter, up and down or ctrl-p and ctrl-n to move, enter to pick, esc or ctrl-c to cancel (exit 1, nothing printed), ctrl-u clears the query, ctrl-w deletes a word.
|
|
18
|
+
|
|
19
|
+
The query matches as a subsequence, best first: a word start, a run of consecutive characters or a prefix scores higher, a lowercase query ignores case and an uppercase letter makes it exact. Keys come from `/dev/tty` and the selector is drawn on stderr, so a pipe or a command substitution takes only the choice. Without a terminal on stderr it exits 2.
|
|
20
|
+
|
|
21
|
+
Not a replacement for fzf where its other features are used (`--expect`, `--print-query`, `--bind` reloads, `--with-nth`): see [#127](https://git.kaynooo.fr/kaynooo/cli/issues/127).
|