zammy 1.2.0 → 1.3.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/README.md +328 -214
- package/SECURITY.md +57 -0
- package/assets/zammy.gif +0 -0
- package/dist/index.js +3257 -450
- package/package.json +10 -3
- package/packages/plugins/docker/README.md +141 -0
- package/packages/plugins/docker/dist/index.d.ts +46 -0
- package/packages/plugins/docker/dist/index.d.ts.map +1 -0
- package/packages/plugins/docker/dist/index.js +402 -0
- package/packages/plugins/docker/dist/index.js.map +1 -0
- package/packages/plugins/docker/package.json +28 -0
- package/packages/plugins/docker/zammy-plugin.json +16 -0
- package/packages/plugins/faker/README.md +65 -0
- package/packages/plugins/faker/dist/index.d.ts +43 -0
- package/packages/plugins/faker/dist/index.d.ts.map +1 -0
- package/packages/plugins/faker/dist/index.js +349 -0
- package/packages/plugins/faker/dist/index.js.map +1 -0
- package/packages/plugins/faker/package.json +28 -0
- package/packages/plugins/faker/zammy-plugin.json +14 -0
- package/packages/plugins/network/README.md +126 -0
- package/packages/plugins/network/dist/index.d.ts +45 -0
- package/packages/plugins/network/dist/index.d.ts.map +1 -0
- package/packages/plugins/network/dist/index.js +406 -0
- package/packages/plugins/network/dist/index.js.map +1 -0
- package/packages/plugins/network/package.json +28 -0
- package/packages/plugins/network/zammy-plugin.json +17 -0
- package/packages/plugins/port/README.md +74 -0
- package/packages/plugins/port/dist/index.d.ts +47 -0
- package/packages/plugins/port/dist/index.d.ts.map +1 -0
- package/packages/plugins/port/dist/index.js +331 -0
- package/packages/plugins/port/dist/index.js.map +1 -0
- package/packages/plugins/port/package.json +28 -0
- package/packages/plugins/port/zammy-plugin.json +16 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# zammy-plugin-port
|
|
2
|
+
|
|
3
|
+
Manage ports and processes from your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
/plugin install zammy-plugin-port
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
### `/port list`
|
|
14
|
+
|
|
15
|
+
Show all listening ports on your system.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
PORT PID PROCESS
|
|
19
|
+
────────────────────────────────────────
|
|
20
|
+
3000 12345 node
|
|
21
|
+
5432 6789 postgres
|
|
22
|
+
8080 11111 java
|
|
23
|
+
|
|
24
|
+
Total: 3 ports
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### `/port check <port>`
|
|
28
|
+
|
|
29
|
+
Check if a specific port is in use.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
/port check 3000
|
|
33
|
+
# Port 3000 is in use
|
|
34
|
+
# PID: 12345
|
|
35
|
+
# Process: node
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### `/port kill <port>`
|
|
39
|
+
|
|
40
|
+
Kill the process running on a specific port.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
/port kill 3000
|
|
44
|
+
# Process killed (PID: 12345)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Note:** May require administrator/root privileges for some processes.
|
|
48
|
+
|
|
49
|
+
### `/port find <name>`
|
|
50
|
+
|
|
51
|
+
Find all ports used by processes matching a name.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
/port find node
|
|
55
|
+
# PORTS FOR "NODE"
|
|
56
|
+
# PORT PID PROCESS
|
|
57
|
+
# 3000 12345 node
|
|
58
|
+
# 3001 12346 node
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Cross-Platform Support
|
|
62
|
+
|
|
63
|
+
This plugin works on:
|
|
64
|
+
- **Windows** - Uses `netstat` and `taskkill`
|
|
65
|
+
- **macOS** - Uses `lsof` and `kill`
|
|
66
|
+
- **Linux** - Uses `lsof`/`netstat` and `kill`
|
|
67
|
+
|
|
68
|
+
## Permissions
|
|
69
|
+
|
|
70
|
+
This plugin requires shell access to run system commands.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
interface PluginAPI {
|
|
2
|
+
registerCommand(command: Command): void;
|
|
3
|
+
ui: {
|
|
4
|
+
theme: {
|
|
5
|
+
primary: (text: string) => string;
|
|
6
|
+
secondary: (text: string) => string;
|
|
7
|
+
success: (text: string) => string;
|
|
8
|
+
warning: (text: string) => string;
|
|
9
|
+
error: (text: string) => string;
|
|
10
|
+
dim: (text: string) => string;
|
|
11
|
+
gradient: (text: string) => string;
|
|
12
|
+
};
|
|
13
|
+
symbols: {
|
|
14
|
+
check: string;
|
|
15
|
+
cross: string;
|
|
16
|
+
warning: string;
|
|
17
|
+
info: string;
|
|
18
|
+
sparkles: string;
|
|
19
|
+
arrow: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
log: {
|
|
23
|
+
info: (message: string) => void;
|
|
24
|
+
error: (message: string) => void;
|
|
25
|
+
};
|
|
26
|
+
shell?: {
|
|
27
|
+
exec: (command: string, options?: {
|
|
28
|
+
timeout?: number;
|
|
29
|
+
}) => string;
|
|
30
|
+
spawn: (command: string, args?: string[]) => Promise<{
|
|
31
|
+
stdout: string;
|
|
32
|
+
stderr: string;
|
|
33
|
+
code: number;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface Command {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
usage: string;
|
|
41
|
+
execute: (args: string[]) => Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
declare const plugin: {
|
|
44
|
+
activate(api: PluginAPI): void;
|
|
45
|
+
};
|
|
46
|
+
export default plugin;
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,UAAU,SAAS;IACjB,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;KACxG,CAAC;CACH;AAED,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAsND,QAAA,MAAM,MAAM;kBACI,SAAS;CAwJxB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// Zammy Plugin: Port Manager
|
|
2
|
+
// Manage ports and processes
|
|
3
|
+
import { platform } from 'os';
|
|
4
|
+
const isWindows = platform() === 'win32';
|
|
5
|
+
const isMac = platform() === 'darwin';
|
|
6
|
+
// ============ CROSS-PLATFORM HELPERS ============
|
|
7
|
+
async function getListeningPorts(shell) {
|
|
8
|
+
const ports = [];
|
|
9
|
+
try {
|
|
10
|
+
if (isWindows) {
|
|
11
|
+
// Windows: Use netstat
|
|
12
|
+
const result = await shell.spawn('netstat', ['-ano']);
|
|
13
|
+
if (result.code !== 0)
|
|
14
|
+
return ports;
|
|
15
|
+
const lines = result.stdout.split('\n');
|
|
16
|
+
for (const line of lines) {
|
|
17
|
+
if (!line.includes('LISTENING'))
|
|
18
|
+
continue;
|
|
19
|
+
// TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 12345
|
|
20
|
+
const parts = line.trim().split(/\s+/);
|
|
21
|
+
if (parts.length >= 5) {
|
|
22
|
+
const localAddr = parts[1];
|
|
23
|
+
const portMatch = localAddr.match(/:(\d+)$/);
|
|
24
|
+
if (portMatch) {
|
|
25
|
+
const pid = parseInt(parts[parts.length - 1]);
|
|
26
|
+
ports.push({
|
|
27
|
+
port: parseInt(portMatch[1]),
|
|
28
|
+
pid,
|
|
29
|
+
process: await getProcessName(shell, pid),
|
|
30
|
+
protocol: parts[0],
|
|
31
|
+
state: 'LISTENING'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// Unix (macOS/Linux): Use lsof
|
|
39
|
+
const result = await shell.spawn('lsof', ['-i', '-P', '-n']);
|
|
40
|
+
if (result.code !== 0) {
|
|
41
|
+
// Try netstat as fallback (Linux only, macOS netstat has different format)
|
|
42
|
+
if (!isMac) {
|
|
43
|
+
const netstatResult = await shell.spawn('netstat', ['-tlnp']);
|
|
44
|
+
if (netstatResult.code === 0) {
|
|
45
|
+
const lines = netstatResult.stdout.split('\n');
|
|
46
|
+
for (const line of lines) {
|
|
47
|
+
if (!line.includes('LISTEN'))
|
|
48
|
+
continue;
|
|
49
|
+
// tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 12345/node
|
|
50
|
+
const parts = line.trim().split(/\s+/);
|
|
51
|
+
if (parts.length >= 7) {
|
|
52
|
+
const localAddr = parts[3];
|
|
53
|
+
const portMatch = localAddr.match(/:(\d+)$/);
|
|
54
|
+
const pidProcess = parts[6];
|
|
55
|
+
const [pidStr, procName] = pidProcess.split('/');
|
|
56
|
+
if (portMatch) {
|
|
57
|
+
ports.push({
|
|
58
|
+
port: parseInt(portMatch[1]),
|
|
59
|
+
pid: parseInt(pidStr) || 0,
|
|
60
|
+
process: procName || 'unknown',
|
|
61
|
+
protocol: parts[0].toUpperCase(),
|
|
62
|
+
state: 'LISTEN'
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
// macOS: Try netstat -an (no PID available without lsof)
|
|
71
|
+
const netstatResult = await shell.spawn('netstat', ['-an']);
|
|
72
|
+
if (netstatResult.code === 0) {
|
|
73
|
+
const lines = netstatResult.stdout.split('\n');
|
|
74
|
+
for (const line of lines) {
|
|
75
|
+
if (!line.includes('LISTEN'))
|
|
76
|
+
continue;
|
|
77
|
+
// tcp4 0 0 *.3000 *.* LISTEN
|
|
78
|
+
const parts = line.trim().split(/\s+/);
|
|
79
|
+
if (parts.length >= 4) {
|
|
80
|
+
const localAddr = parts[3];
|
|
81
|
+
const portMatch = localAddr.match(/[.*:](\d+)$/);
|
|
82
|
+
if (portMatch) {
|
|
83
|
+
ports.push({
|
|
84
|
+
port: parseInt(portMatch[1]),
|
|
85
|
+
pid: 0, // Not available without lsof on macOS
|
|
86
|
+
process: 'unknown',
|
|
87
|
+
protocol: parts[0].toUpperCase().replace(/[46]/, ''),
|
|
88
|
+
state: 'LISTEN'
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return ports;
|
|
96
|
+
}
|
|
97
|
+
const lines = result.stdout.split('\n');
|
|
98
|
+
for (const line of lines) {
|
|
99
|
+
if (!line.includes('LISTEN') && !line.includes('(LISTEN)'))
|
|
100
|
+
continue;
|
|
101
|
+
// node 12345 user 3u IPv4 ... TCP *:3000 (LISTEN)
|
|
102
|
+
const parts = line.trim().split(/\s+/);
|
|
103
|
+
if (parts.length >= 9) {
|
|
104
|
+
const process = parts[0];
|
|
105
|
+
const pid = parseInt(parts[1]);
|
|
106
|
+
const addrPart = parts.find(p => p.includes(':'));
|
|
107
|
+
if (addrPart) {
|
|
108
|
+
const portMatch = addrPart.match(/:(\d+)/);
|
|
109
|
+
if (portMatch) {
|
|
110
|
+
ports.push({
|
|
111
|
+
port: parseInt(portMatch[1]),
|
|
112
|
+
pid,
|
|
113
|
+
process,
|
|
114
|
+
protocol: 'TCP',
|
|
115
|
+
state: 'LISTEN'
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// Ignore errors
|
|
125
|
+
}
|
|
126
|
+
// Remove duplicates and sort by port
|
|
127
|
+
const unique = new Map();
|
|
128
|
+
for (const p of ports) {
|
|
129
|
+
if (!unique.has(p.port)) {
|
|
130
|
+
unique.set(p.port, p);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return Array.from(unique.values()).sort((a, b) => a.port - b.port);
|
|
134
|
+
}
|
|
135
|
+
async function getProcessName(shell, pid) {
|
|
136
|
+
try {
|
|
137
|
+
if (isWindows) {
|
|
138
|
+
const result = await shell.spawn('tasklist', ['/FI', `PID eq ${pid}`, '/FO', 'CSV', '/NH']);
|
|
139
|
+
if (result.code === 0 && result.stdout.trim()) {
|
|
140
|
+
// "name.exe","12345","Console","1","12,345 K"
|
|
141
|
+
const match = result.stdout.match(/"([^"]+)"/);
|
|
142
|
+
if (match)
|
|
143
|
+
return match[1].replace('.exe', '');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
const result = await shell.spawn('ps', ['-p', pid.toString(), '-o', 'comm=']);
|
|
148
|
+
if (result.code === 0 && result.stdout.trim()) {
|
|
149
|
+
return result.stdout.trim().split('/').pop() || 'unknown';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// Ignore
|
|
155
|
+
}
|
|
156
|
+
return 'unknown';
|
|
157
|
+
}
|
|
158
|
+
async function checkPort(shell, port) {
|
|
159
|
+
const ports = await getListeningPorts(shell);
|
|
160
|
+
return ports.find(p => p.port === port) || null;
|
|
161
|
+
}
|
|
162
|
+
async function killPort(shell, port) {
|
|
163
|
+
const portInfo = await checkPort(shell, port);
|
|
164
|
+
if (!portInfo) {
|
|
165
|
+
return { success: false, error: `No process found on port ${port}` };
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
let result;
|
|
169
|
+
if (isWindows) {
|
|
170
|
+
result = await shell.spawn('taskkill', ['/F', '/PID', portInfo.pid.toString()]);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
result = await shell.spawn('kill', ['-9', portInfo.pid.toString()]);
|
|
174
|
+
}
|
|
175
|
+
if (result.code !== 0) {
|
|
176
|
+
const stderr = result.stderr.toLowerCase();
|
|
177
|
+
if (stderr.includes('access') || stderr.includes('denied') || stderr.includes('permission') || stderr.includes('operation not permitted')) {
|
|
178
|
+
return {
|
|
179
|
+
success: false,
|
|
180
|
+
pid: portInfo.pid,
|
|
181
|
+
error: 'Permission denied',
|
|
182
|
+
requiresAdmin: true
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return { success: false, pid: portInfo.pid, error: result.stderr || 'Failed to kill process' };
|
|
186
|
+
}
|
|
187
|
+
return { success: true, pid: portInfo.pid };
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
return { success: false, error: String(error) };
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async function findPortsByProcess(shell, name) {
|
|
194
|
+
const ports = await getListeningPorts(shell);
|
|
195
|
+
const lowerName = name.toLowerCase();
|
|
196
|
+
return ports.filter(p => p.process.toLowerCase().includes(lowerName));
|
|
197
|
+
}
|
|
198
|
+
// ============ PLUGIN ============
|
|
199
|
+
const plugin = {
|
|
200
|
+
activate(api) {
|
|
201
|
+
const { theme, symbols } = api.ui;
|
|
202
|
+
if (!api.shell) {
|
|
203
|
+
api.log.error('Port plugin requires shell permission');
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const shell = api.shell;
|
|
207
|
+
api.registerCommand({
|
|
208
|
+
name: 'port',
|
|
209
|
+
description: 'Manage ports and processes',
|
|
210
|
+
usage: '/port <action> [args]\n\n Actions: list, check, kill, find',
|
|
211
|
+
async execute(args) {
|
|
212
|
+
const action = args[0]?.toLowerCase();
|
|
213
|
+
if (!action) {
|
|
214
|
+
console.log('');
|
|
215
|
+
console.log(` ${symbols.sparkles} ${theme.gradient('PORT MANAGER')}`);
|
|
216
|
+
console.log('');
|
|
217
|
+
console.log(` ${theme.dim('Usage:')} /port <action> [args]`);
|
|
218
|
+
console.log('');
|
|
219
|
+
console.log(` ${theme.dim('Actions:')}`);
|
|
220
|
+
console.log(` ${theme.primary('list')} ${theme.dim('Show all listening ports')}`);
|
|
221
|
+
console.log(` ${theme.primary('check <port>')} ${theme.dim('Check if port is in use')}`);
|
|
222
|
+
console.log(` ${theme.primary('kill <port>')} ${theme.dim('Kill process on port')}`);
|
|
223
|
+
console.log(` ${theme.primary('find <name>')} ${theme.dim('Find ports by process name')}`);
|
|
224
|
+
console.log('');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
console.log('');
|
|
228
|
+
switch (action) {
|
|
229
|
+
case 'list': {
|
|
230
|
+
console.log(` ${symbols.sparkles} ${theme.gradient('LISTENING PORTS')}`);
|
|
231
|
+
console.log('');
|
|
232
|
+
const ports = await getListeningPorts(shell);
|
|
233
|
+
if (ports.length === 0) {
|
|
234
|
+
console.log(` ${theme.dim('No listening ports found')}`);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
console.log(` ${theme.dim('PORT'.padEnd(8))}${theme.dim('PID'.padEnd(10))}${theme.dim('PROCESS')}`);
|
|
238
|
+
console.log(` ${theme.dim('─'.repeat(40))}`);
|
|
239
|
+
for (const p of ports) {
|
|
240
|
+
console.log(` ${theme.primary(p.port.toString().padEnd(8))}` +
|
|
241
|
+
`${theme.secondary(p.pid.toString().padEnd(10))}` +
|
|
242
|
+
`${p.process}`);
|
|
243
|
+
}
|
|
244
|
+
console.log('');
|
|
245
|
+
console.log(` ${theme.dim(`Total: ${ports.length} ports`)}`);
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
case 'check': {
|
|
250
|
+
const port = parseInt(args[1]);
|
|
251
|
+
if (isNaN(port)) {
|
|
252
|
+
console.log(` ${symbols.warning} ${theme.warning('Usage:')} /port check <port>`);
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
const portInfo = await checkPort(shell, port);
|
|
256
|
+
if (portInfo) {
|
|
257
|
+
console.log(` ${symbols.cross} ${theme.error(`Port ${port} is in use`)}`);
|
|
258
|
+
console.log('');
|
|
259
|
+
console.log(` ${theme.dim('PID:')} ${theme.primary(portInfo.pid.toString())}`);
|
|
260
|
+
console.log(` ${theme.dim('Process:')} ${theme.secondary(portInfo.process)}`);
|
|
261
|
+
console.log('');
|
|
262
|
+
console.log(` ${theme.dim('Kill with:')} /port kill ${port}`);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
console.log(` ${symbols.check} ${theme.success(`Port ${port} is available`)}`);
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
case 'kill': {
|
|
270
|
+
const port = parseInt(args[1]);
|
|
271
|
+
if (isNaN(port)) {
|
|
272
|
+
console.log(` ${symbols.warning} ${theme.warning('Usage:')} /port kill <port>`);
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
console.log(` ${theme.dim('Killing process on port')} ${theme.primary(port.toString())}...`);
|
|
276
|
+
const result = await killPort(shell, port);
|
|
277
|
+
if (result.success) {
|
|
278
|
+
console.log(` ${symbols.check} ${theme.success('Process killed')} ${theme.dim(`(PID: ${result.pid})`)}`);
|
|
279
|
+
}
|
|
280
|
+
else if (result.requiresAdmin) {
|
|
281
|
+
console.log(` ${symbols.cross} ${theme.error('Permission denied')}`);
|
|
282
|
+
console.log('');
|
|
283
|
+
if (isWindows) {
|
|
284
|
+
console.log(` ${theme.dim('Run terminal as Administrator and try again')}`);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
console.log(` ${theme.dim('Try:')} sudo zammy, then /port kill ${port}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
console.log(` ${symbols.cross} ${theme.error(result.error || 'Failed to kill process')}`);
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
case 'find': {
|
|
296
|
+
const name = args.slice(1).join(' ');
|
|
297
|
+
if (!name) {
|
|
298
|
+
console.log(` ${symbols.warning} ${theme.warning('Usage:')} /port find <process-name>`);
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
const ports = await findPortsByProcess(shell, name);
|
|
302
|
+
if (ports.length === 0) {
|
|
303
|
+
console.log(` ${theme.dim(`No ports found for "${name}"`)}`);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
console.log(` ${symbols.sparkles} ${theme.gradient(`PORTS FOR "${name.toUpperCase()}"`)}`);
|
|
307
|
+
console.log('');
|
|
308
|
+
console.log(` ${theme.dim('PORT'.padEnd(8))}${theme.dim('PID'.padEnd(10))}${theme.dim('PROCESS')}`);
|
|
309
|
+
console.log(` ${theme.dim('─'.repeat(40))}`);
|
|
310
|
+
for (const p of ports) {
|
|
311
|
+
console.log(` ${theme.primary(p.port.toString().padEnd(8))}` +
|
|
312
|
+
`${theme.secondary(p.pid.toString().padEnd(10))}` +
|
|
313
|
+
`${p.process}`);
|
|
314
|
+
}
|
|
315
|
+
console.log('');
|
|
316
|
+
console.log(` ${theme.dim(`Found: ${ports.length} ports`)}`);
|
|
317
|
+
}
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
default:
|
|
321
|
+
console.log(` ${symbols.cross} ${theme.error(`Unknown action: ${action}`)}`);
|
|
322
|
+
console.log(` ${theme.dim('Run /port to see available actions')}`);
|
|
323
|
+
}
|
|
324
|
+
console.log('');
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
api.log.info('Port Manager plugin activated');
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
export default plugin;
|
|
331
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,6BAA6B;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAgD9B,MAAM,SAAS,GAAG,QAAQ,EAAE,KAAK,OAAO,CAAC;AACzC,MAAM,KAAK,GAAG,QAAQ,EAAE,KAAK,QAAQ,CA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K,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;wBAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC,EAAE,CAAC,CAAC;gBACxE,CAAC;gBAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;QAEH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAChD,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zammy-plugin-port",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Manage ports and processes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": ["dist", "zammy-plugin.json", "README.md"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["zammy-plugin", "zammy", "cli", "port", "process", "network", "kill-port"],
|
|
14
|
+
"author": "Aayush Adhikari",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/aayushadhikari7/zammy-cli.git",
|
|
19
|
+
"directory": "packages/plugins/port"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/aayushadhikari7/zammy-cli/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/aayushadhikari7/zammy-cli/tree/main/packages/plugins/port#readme",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "^5.3.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zammy-plugin-port",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"displayName": "Port Manager",
|
|
5
|
+
"description": "Manage ports and processes",
|
|
6
|
+
"author": "Zammy CLI",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"commands": ["port"],
|
|
10
|
+
"zammy": {
|
|
11
|
+
"minVersion": "1.2.0"
|
|
12
|
+
},
|
|
13
|
+
"permissions": {
|
|
14
|
+
"shell": true
|
|
15
|
+
}
|
|
16
|
+
}
|