caroushell 0.1.14 → 0.1.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.
package/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # Caroushell
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/caroushell.svg)](https://www.npmjs.com/package/caroushell)
4
+ [![npm downloads](https://img.shields.io/npm/dm/caroushell.svg)](https://www.npmjs.com/package/caroushell)
5
+
3
6
  Caroushell is an interactive terminal carousel that suggests commands from your
4
7
  history, and AI suggestions as you type.
5
8
 
6
9
  ## Features
7
10
 
8
- - The top panel of the carousel shows history
11
+ - The top panel of the carousel shows history.
9
12
  - The bottom panel of the carousel shows AI-generated command suggestions.
10
13
  - Go up and down the carousel with arrow keys.
11
14
  - Press `Enter` to run the highlighted command.
@@ -13,6 +16,32 @@ history, and AI suggestions as you type.
13
16
  - Extensible config file (`~/.caroushell/config.toml`) so you can point the CLI
14
17
  at different AI providers.
15
18
 
19
+ ## UI
20
+
21
+ The UI layout looks like this:
22
+
23
+ ```
24
+ ⌛history2
25
+ ⌛history1
26
+ $> YOU TYPE YOUR SHELL COMMANDS HERE
27
+ 🤖ai suggestion1
28
+ 🤖ai suggestion2
29
+ ```
30
+
31
+ Here's an example using a comment to get AI autocompletion for ffmpeg:
32
+
33
+ ```
34
+ ⌛echo 123
35
+ ⌛cd
36
+ $> ffmpeg -i myvideo.mp4 # slowmo 50%
37
+ 🤖ffmpeg -i myvideo.mp4 -filter:v "setpts=2.0*PTS" output_slow.mp4
38
+ 🤖ffmpeg -i myvideo.mp4 -vf "setpts=0.5*PTS" output_fast.mp4
39
+ ```
40
+
41
+ It would look like this:
42
+
43
+ ![Caroushell ai suggestion for ffmpeg slowmo](docs/assets/demo.gif)
44
+
16
45
  ## Requirements
17
46
 
18
47
  - Node.js 18 or newer.
@@ -46,7 +75,7 @@ npm install -g caroushell
46
75
  caroushell
47
76
  ```
48
77
 
49
- Or run it ad-hoc with NPX once it is published:
78
+ Or run it with NPX:
50
79
 
51
80
  ```bash
52
81
  npx caroushell
@@ -61,6 +90,8 @@ Caroushell opens an interactive prompt:
61
90
  - Use arrow keys to move between suggestions in the carousel.
62
91
  - Press `Enter` to run the highlighted command.
63
92
  - Press `Ctrl+C` to exit. `Ctrl+D` exits when the current row is empty.
93
+ - Press `Tab` to autocomplete a file suggestion or browse files and folders with
94
+ the arrow keys.
64
95
 
65
96
  Logs are written to `~/.caroushell/logs/MM-DD.txt`. Inspect these files if you
66
97
  need to debug AI suggestions or the terminal renderer. Configuration lives at
@@ -69,9 +100,8 @@ need to debug AI suggestions or the terminal renderer. Configuration lives at
69
100
  ## Development
70
101
 
71
102
  ```bash
72
- npm install
73
- npm run dev
74
- npm run build
103
+ npm install # install dependencies
104
+ npm run dev # run the shell
75
105
  npm run test:generate # tests ai text generation
76
106
  npm publish --dry-run # verify package contents before publishing
77
107
  ```
package/dist/spawner.js CHANGED
@@ -54,8 +54,11 @@ async function runUserCommand(command) {
54
54
  if (typeof args[0] === "string" && builtInCommands[args[0]]) {
55
55
  return await builtInCommands[args[0]](args);
56
56
  }
57
+ // "shell: true" to prevent the bug of `echo "asdf"` outputting
58
+ // \"Asdf\" instead of "Asdf"
57
59
  const proc = (0, child_process_1.spawn)(shellBinary, [...shellArgs, command], {
58
60
  stdio: "inherit",
61
+ // shell: true,
59
62
  });
60
63
  await new Promise((resolve, reject) => {
61
64
  proc.on("error", reject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caroushell",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Terminal carousel that suggests commands from history, config, and AI.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/main.js",