@indah_sekar/os-t 1.0.0 → 1.0.2
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 +3 -2
- package/bin/cli.js +29 -25
- package/package.json +3 -2
- package/src/data/commands.js +678 -792
- package/src/data/commands.json +114 -114
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Available as a **web app** and a **CLI tool**.
|
|
|
7
7
|
## Install (CLI)
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm
|
|
10
|
+
npm i -g @indah_sekar/os-t
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## CLI Usage
|
|
@@ -57,7 +57,7 @@ npm run preview
|
|
|
57
57
|
## Programmatic Usage (import as module)
|
|
58
58
|
|
|
59
59
|
```js
|
|
60
|
-
import commands from "os-t";
|
|
60
|
+
import commands from "@indah-sekar/os-t";
|
|
61
61
|
|
|
62
62
|
// commands.windows, commands.linux, commands.macos
|
|
63
63
|
```
|
|
@@ -74,3 +74,4 @@ import commands from "os-t";
|
|
|
74
74
|
- **Export History** — Download terminal history as a text file
|
|
75
75
|
- **Difficulty Indicators** — See at a glance whether a command is easy, medium, or hard
|
|
76
76
|
- **CLI Tool** — Use from the command line after `npm install -g`
|
|
77
|
+
"# os-t"
|
package/bin/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ function printHelp() {
|
|
|
24
24
|
OS Troubleshooter - Quick troubleshooting commands for Windows, Linux & macOS
|
|
25
25
|
|
|
26
26
|
Usage:
|
|
27
|
-
os-
|
|
27
|
+
os-t [options] [command-name]
|
|
28
28
|
|
|
29
29
|
Options:
|
|
30
30
|
--help, -h Show this help message
|
|
@@ -35,13 +35,13 @@ function printHelp() {
|
|
|
35
35
|
--copy Copy command to clipboard (requires xclip/xsel/pbcopy)
|
|
36
36
|
|
|
37
37
|
Examples:
|
|
38
|
-
os-
|
|
39
|
-
os-
|
|
40
|
-
os-
|
|
41
|
-
os-
|
|
42
|
-
os-
|
|
43
|
-
os-
|
|
44
|
-
os-
|
|
38
|
+
os-t --list
|
|
39
|
+
os-t --os linux --list
|
|
40
|
+
os-t "Flush DNS Cache"
|
|
41
|
+
os-t --os windows "System File Checker"
|
|
42
|
+
os-t --search ping
|
|
43
|
+
os-t --category Network --os linux
|
|
44
|
+
os-t --copy "Flush DNS Cache"
|
|
45
45
|
`);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -57,6 +57,7 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
59
|
const categories = commands[os];
|
|
60
|
+
let osHeaderPrinted = false;
|
|
60
61
|
for (const cat of categories) {
|
|
61
62
|
if (
|
|
62
63
|
categoryFilter &&
|
|
@@ -75,18 +76,21 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
if (cmds.length === 0) continue;
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
if (!osHeaderPrinted) {
|
|
80
|
+
console.log(`\n ${os}`);
|
|
81
|
+
osHeaderPrinted = true;
|
|
82
|
+
}
|
|
83
|
+
const maxNameLen = Math.max(...cmds.map((c) => c.name.length), 4);
|
|
84
|
+
console.log(
|
|
85
|
+
` ${"name".padEnd(maxNameLen)} description`,
|
|
86
|
+
);
|
|
80
87
|
for (const cmd of cmds) {
|
|
81
|
-
console.log(` ${cmd.name}`);
|
|
82
|
-
console.log(` ${cmd.description}`);
|
|
83
|
-
console.log(` $ ${cmd.command}`);
|
|
84
|
-
console.log();
|
|
88
|
+
console.log(` ${cmd.name.padEnd(maxNameLen)} ${cmd.description}`);
|
|
85
89
|
total++;
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
|
-
console.log(
|
|
93
|
+
console.log(`\n Total: ${total} command(s)`);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
function findCommand(query) {
|
|
@@ -141,17 +145,17 @@ function prepareCommand(cmd, os) {
|
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
function printResults(results) {
|
|
148
|
+
let currentOs = null;
|
|
149
|
+
const maxNameLen = Math.max(...results.map((r) => r.name.length), 4);
|
|
144
150
|
for (const r of results) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
console.log(`
|
|
151
|
-
console.log(` $ ${finalCmd}`);
|
|
152
|
-
console.log();
|
|
151
|
+
if (r.os !== currentOs) {
|
|
152
|
+
console.log(`\n ${r.os}`);
|
|
153
|
+
console.log(` ${"name".padEnd(maxNameLen)} description`);
|
|
154
|
+
currentOs = r.os;
|
|
155
|
+
}
|
|
156
|
+
console.log(` ${r.name.padEnd(maxNameLen)} ${r.description}`);
|
|
153
157
|
}
|
|
154
|
-
console.log(
|
|
158
|
+
console.log(`\n Found: ${results.length} command(s)`);
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
function main() {
|
|
@@ -204,7 +208,7 @@ function main() {
|
|
|
204
208
|
if (results.length === 0) {
|
|
205
209
|
console.log(`\n No commands found matching "${finalQuery}"`);
|
|
206
210
|
console.log(
|
|
207
|
-
" Try: os-
|
|
211
|
+
" Try: os-t --list to see all available commands\n",
|
|
208
212
|
);
|
|
209
213
|
return;
|
|
210
214
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indah_sekar/os-t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Quick troubleshooting commands for Windows, Linux & macOS. CLI tool + web app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"troubleshooting",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"main": "./src/data/commands.json",
|
|
32
32
|
"bin": {
|
|
33
|
-
"os-
|
|
33
|
+
"os-t": "bin/cli.js"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"bin/",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"preview": "vite preview"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"@indah_sekar/os-t": "^1.0.0",
|
|
48
49
|
"react": "^19.2.7",
|
|
49
50
|
"react-dom": "^19.2.7"
|
|
50
51
|
},
|