shellwise 0.2.5 → 0.2.6
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 +25 -3
- package/package.json +1 -1
- package/src/cli/add.ts +1 -6
- package/src/daemon/server.ts +0 -4
- package/src/utils/constants.ts +0 -1
package/README.md
CHANGED
|
@@ -34,10 +34,13 @@ Tab/Shift+Tab to navigate, Enter to select, Esc to dismiss
|
|
|
34
34
|
> **Important:** This is a CLI tool — install it **globally**.
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
#
|
|
37
|
+
# Homebrew
|
|
38
|
+
brew install kurovu146/tap/shellwise
|
|
39
|
+
|
|
40
|
+
# Bun
|
|
38
41
|
bun install -g shellwise
|
|
39
42
|
|
|
40
|
-
#
|
|
43
|
+
# npm
|
|
41
44
|
npm install -g shellwise
|
|
42
45
|
```
|
|
43
46
|
|
|
@@ -55,6 +58,19 @@ eval "$(shellwise init zsh)"
|
|
|
55
58
|
eval "$(shellwise init bash)"
|
|
56
59
|
```
|
|
57
60
|
|
|
61
|
+
## Update
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Homebrew
|
|
65
|
+
brew upgrade shellwise
|
|
66
|
+
|
|
67
|
+
# Bun
|
|
68
|
+
bun install -g shellwise@latest
|
|
69
|
+
|
|
70
|
+
# npm
|
|
71
|
+
npm install -g shellwise@latest
|
|
72
|
+
```
|
|
73
|
+
|
|
58
74
|
## Usage
|
|
59
75
|
|
|
60
76
|
### Auto-suggest (while typing)
|
|
@@ -139,8 +155,14 @@ shellwise import bash # Import from ~/.bash_history
|
|
|
139
155
|
## Uninstall
|
|
140
156
|
|
|
141
157
|
```bash
|
|
158
|
+
# Homebrew
|
|
159
|
+
brew uninstall shellwise
|
|
160
|
+
|
|
161
|
+
# Bun
|
|
142
162
|
bun remove -g shellwise
|
|
143
|
-
|
|
163
|
+
|
|
164
|
+
# npm
|
|
165
|
+
npm uninstall -g shellwise
|
|
144
166
|
```
|
|
145
167
|
|
|
146
168
|
Shell integration is automatically removed on uninstall. If you still see errors after uninstalling, manually remove these lines from your `~/.zshrc` (or `~/.bashrc`):
|
package/package.json
CHANGED
package/src/cli/add.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { insertCommand } from "../db/queries";
|
|
2
2
|
import { getHostname } from "../utils/platform";
|
|
3
|
-
import { IGNORED_COMMANDS } from "../utils/constants";
|
|
4
3
|
|
|
5
4
|
interface AddOptions {
|
|
6
5
|
command: string;
|
|
@@ -14,7 +13,7 @@ interface AddOptions {
|
|
|
14
13
|
export function runAdd(opts: AddOptions): void {
|
|
15
14
|
const cmd = opts.command.trim();
|
|
16
15
|
|
|
17
|
-
// Skip empty
|
|
16
|
+
// Skip empty or very short commands
|
|
18
17
|
if (!cmd || cmd.length < 2) return;
|
|
19
18
|
|
|
20
19
|
// Skip commands starting with space (convention)
|
|
@@ -23,10 +22,6 @@ export function runAdd(opts: AddOptions): void {
|
|
|
23
22
|
// Only save successful commands (exit code 0)
|
|
24
23
|
if (opts.exitCode !== undefined && opts.exitCode !== 0) return;
|
|
25
24
|
|
|
26
|
-
// Skip ignored commands (only the base command, not arguments)
|
|
27
|
-
const baseCmd = cmd.split(/\s+/)[0];
|
|
28
|
-
if (IGNORED_COMMANDS.has(baseCmd)) return;
|
|
29
|
-
|
|
30
25
|
insertCommand({
|
|
31
26
|
command: cmd,
|
|
32
27
|
cwd: opts.cwd,
|
package/src/daemon/server.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { getDb, closeDb } from "../db/connection";
|
|
|
2
2
|
import { insertCommand } from "../db/queries";
|
|
3
3
|
import { getHostname } from "../utils/platform";
|
|
4
4
|
import { getCommonSuggestions } from "../data/common-commands";
|
|
5
|
-
import { IGNORED_COMMANDS } from "../utils/constants";
|
|
6
5
|
import { parseRequest, getSocketPath, getPidPath, getDaemonPort } from "./protocol";
|
|
7
6
|
import { unlinkSync, writeFileSync, existsSync } from "fs";
|
|
8
7
|
import type { Socket } from "bun";
|
|
@@ -95,9 +94,6 @@ function handleRequest(raw: string): string {
|
|
|
95
94
|
const cmd = req.command.trim();
|
|
96
95
|
if (!cmd || cmd.length < 2 || cmd.startsWith(" ")) return "OK\n\n";
|
|
97
96
|
if (req.exitCode !== 0) return "OK\n\n"; // Only save successful commands
|
|
98
|
-
const baseCmd = cmd.split(/\s+/)[0];
|
|
99
|
-
if (IGNORED_COMMANDS.has(baseCmd)) return "OK\n\n";
|
|
100
|
-
|
|
101
97
|
insertCommand({
|
|
102
98
|
command: cmd,
|
|
103
99
|
cwd: req.cwd || undefined,
|
package/src/utils/constants.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const IGNORED_COMMANDS = new Set(["ls", "cd", "pwd", "exit", "clear", "sw"]);
|