@enjoys/context-engine 1.0.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 +213 -0
- package/data/commands/air.json +59 -0
- package/data/commands/ansible.json +24 -0
- package/data/commands/apachectl.json +87 -0
- package/data/commands/apt-get.json +81 -0
- package/data/commands/apt.json +91 -0
- package/data/commands/awk.json +26 -0
- package/data/commands/aws-vault.json +140 -0
- package/data/commands/aws.json +229 -0
- package/data/commands/az.json +36 -0
- package/data/commands/bazel.json +103 -0
- package/data/commands/brew.json +140 -0
- package/data/commands/bun.json +230 -0
- package/data/commands/caddy.json +194 -0
- package/data/commands/cargo.json +1048 -0
- package/data/commands/cat.json +18 -0
- package/data/commands/cd.json +48 -0
- package/data/commands/certbot.json +148 -0
- package/data/commands/chmod.json +97 -0
- package/data/commands/choco.json +134 -0
- package/data/commands/chown.json +59 -0
- package/data/commands/clickhouse-client.json +74 -0
- package/data/commands/cloudflare.json +226 -0
- package/data/commands/cmake.json +110 -0
- package/data/commands/cockroach.json +92 -0
- package/data/commands/conda.json +94 -0
- package/data/commands/consul.json +125 -0
- package/data/commands/cp.json +86 -0
- package/data/commands/curl.json +44 -0
- package/data/commands/cypress.json +100 -0
- package/data/commands/deno.json +29 -0
- package/data/commands/django-admin.json +86 -0
- package/data/commands/dnf.json +137 -0
- package/data/commands/docker.json +1100 -0
- package/data/commands/doctl.json +156 -0
- package/data/commands/eslint.json +69 -0
- package/data/commands/find.json +44 -0
- package/data/commands/firebase.json +97 -0
- package/data/commands/flask.json +79 -0
- package/data/commands/flyctl.json +148 -0
- package/data/commands/gcloud.json +227 -0
- package/data/commands/gh.json +39 -0
- package/data/commands/git.json +527 -0
- package/data/commands/glab.json +116 -0
- package/data/commands/go.json +161 -0
- package/data/commands/gofmt.json +51 -0
- package/data/commands/golangci-lint.json +89 -0
- package/data/commands/gradle.json +44 -0
- package/data/commands/grep.json +47 -0
- package/data/commands/gunicorn.json +83 -0
- package/data/commands/helm.json +1104 -0
- package/data/commands/hg.json +92 -0
- package/data/commands/httpd.json +147 -0
- package/data/commands/influx.json +119 -0
- package/data/commands/iptables.json +86 -0
- package/data/commands/java.json +31 -0
- package/data/commands/jest.json +82 -0
- package/data/commands/journalctl.json +88 -0
- package/data/commands/just.json +93 -0
- package/data/commands/k6.json +84 -0
- package/data/commands/kubectl.json +1277 -0
- package/data/commands/linode-cli.json +117 -0
- package/data/commands/locust.json +83 -0
- package/data/commands/ls.json +115 -0
- package/data/commands/make.json +86 -0
- package/data/commands/mocha.json +75 -0
- package/data/commands/mongosh.json +73 -0
- package/data/commands/mv.json +68 -0
- package/data/commands/mvn.json +45 -0
- package/data/commands/mysql.json +81 -0
- package/data/commands/nest.json +69 -0
- package/data/commands/netlify.json +92 -0
- package/data/commands/next.json +71 -0
- package/data/commands/nft.json +105 -0
- package/data/commands/nginx.json +146 -0
- package/data/commands/nmap.json +92 -0
- package/data/commands/node.json +43 -0
- package/data/commands/nomad.json +139 -0
- package/data/commands/npm.json +1265 -0
- package/data/commands/npx.json +58 -0
- package/data/commands/nx.json +82 -0
- package/data/commands/openssl.json +288 -0
- package/data/commands/packer.json +92 -0
- package/data/commands/pacman.json +82 -0
- package/data/commands/pg_dump.json +83 -0
- package/data/commands/pg_restore.json +74 -0
- package/data/commands/pip.json +95 -0
- package/data/commands/pipenv.json +79 -0
- package/data/commands/pipx.json +53 -0
- package/data/commands/playwright.json +97 -0
- package/data/commands/pnpm.json +29 -0
- package/data/commands/poetry.json +96 -0
- package/data/commands/prettier.json +71 -0
- package/data/commands/ps.json +31 -0
- package/data/commands/psql.json +124 -0
- package/data/commands/pulumi.json +130 -0
- package/data/commands/pytest.json +92 -0
- package/data/commands/python.json +30 -0
- package/data/commands/railway.json +91 -0
- package/data/commands/redis-cli.json +148 -0
- package/data/commands/render.json +72 -0
- package/data/commands/rm.json +79 -0
- package/data/commands/rsync.json +36 -0
- package/data/commands/rust.json +35 -0
- package/data/commands/rustup.json +103 -0
- package/data/commands/scp.json +60 -0
- package/data/commands/sed.json +28 -0
- package/data/commands/sqlite3.json +68 -0
- package/data/commands/ssh-keygen.json +112 -0
- package/data/commands/ssh.json +37 -0
- package/data/commands/sudo.json +147 -0
- package/data/commands/supabase.json +108 -0
- package/data/commands/svn.json +75 -0
- package/data/commands/systemctl.json +31 -0
- package/data/commands/tar.json +35 -0
- package/data/commands/tcpdump.json +77 -0
- package/data/commands/terraform.json +824 -0
- package/data/commands/terragrunt.json +83 -0
- package/data/commands/tsc.json +85 -0
- package/data/commands/turbo.json +72 -0
- package/data/commands/ufw.json +76 -0
- package/data/commands/unzip.json +59 -0
- package/data/commands/uvicorn.json +73 -0
- package/data/commands/vault.json +144 -0
- package/data/commands/vercel.json +98 -0
- package/data/commands/vite.json +63 -0
- package/data/commands/vitest.json +88 -0
- package/data/commands/wasm-pack.json +90 -0
- package/data/commands/wget.json +38 -0
- package/data/commands/winget.json +131 -0
- package/data/commands/wireshark.json +81 -0
- package/data/commands/yarn.json +28 -0
- package/data/commands/yum.json +98 -0
- package/data/commands/zip.json +59 -0
- package/index.d.ts +131 -0
- package/index.js +189 -0
- package/index.mjs +21 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# @enjoys/context-engine
|
|
2
|
+
|
|
3
|
+
Comprehensive CLI command context engine with **133 tools** — subcommands, options, examples, and runtime context detectors for intelligent terminal autocomplete.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @enjoys/context-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### CommonJS
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
const {
|
|
17
|
+
getCommand,
|
|
18
|
+
getAllCommands,
|
|
19
|
+
listCommandNames,
|
|
20
|
+
searchCommands,
|
|
21
|
+
getCommandsByCategory,
|
|
22
|
+
getCommandsByPlatform,
|
|
23
|
+
getCategories,
|
|
24
|
+
getContextEngine,
|
|
25
|
+
getSubcommands,
|
|
26
|
+
getGlobalOptions,
|
|
27
|
+
getExamples,
|
|
28
|
+
count,
|
|
29
|
+
} = require("@enjoys/context-engine");
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### ESM
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import {
|
|
36
|
+
getCommand,
|
|
37
|
+
getAllCommands,
|
|
38
|
+
searchCommands,
|
|
39
|
+
count,
|
|
40
|
+
} from "@enjoys/context-engine";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## API
|
|
44
|
+
|
|
45
|
+
### `getCommand(name)`
|
|
46
|
+
|
|
47
|
+
Get a single command definition by name.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const git = getCommand("git");
|
|
51
|
+
console.log(git.subcommands.map((s) => s.name));
|
|
52
|
+
// ['init', 'clone', 'add', 'commit', 'push', ...]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### `getAllCommands()`
|
|
56
|
+
|
|
57
|
+
Return all 133 command objects as an array.
|
|
58
|
+
|
|
59
|
+
### `listCommandNames()`
|
|
60
|
+
|
|
61
|
+
Return sorted array of all command names.
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
listCommandNames();
|
|
65
|
+
// ['air', 'ansible', 'apachectl', 'apt', 'apt-get', 'awk', 'aws', ...]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### `searchCommands(query)`
|
|
69
|
+
|
|
70
|
+
Search commands by name, description, or category (case-insensitive).
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
searchCommands("docker");
|
|
74
|
+
// [{ name: 'docker', ... }]
|
|
75
|
+
|
|
76
|
+
searchCommands("testing");
|
|
77
|
+
// [{ name: 'jest', ... }, { name: 'vitest', ... }, ...]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `getCommandsByCategory(category)`
|
|
81
|
+
|
|
82
|
+
Filter by category (case-insensitive partial match).
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
getCommandsByCategory("database");
|
|
86
|
+
// [psql, mysql, mongosh, sqlite3, redis-cli, ...]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### `getCommandsByPlatform(platform)`
|
|
90
|
+
|
|
91
|
+
Filter by platform: `"linux"` | `"macos"` | `"windows"`.
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
getCommandsByPlatform("windows");
|
|
95
|
+
// [choco, winget, ...]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### `getCategories()`
|
|
99
|
+
|
|
100
|
+
Return all unique category names.
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
getCategories();
|
|
104
|
+
// ['Build Tools', 'Cloud CLIs', 'Database', ...]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### `getContextEngine(name)`
|
|
108
|
+
|
|
109
|
+
Get runtime context detectors for a command.
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
const ctx = getContextEngine("docker");
|
|
113
|
+
// { detectors: [{ name: 'containers', command: 'docker ps ...', parser: 'lines', ... }] }
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### `getSubcommands(name)`
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
getSubcommands("git");
|
|
120
|
+
// [{ name: 'init', description: '...', options: [...] }, ...]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `getGlobalOptions(name)`
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
getGlobalOptions("curl");
|
|
127
|
+
// [{ name: '-X', description: 'HTTP method', ... }, ...]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `getExamples(name)`
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
getExamples("docker");
|
|
134
|
+
// [{ command: 'docker run -d nginx', description: 'Run nginx in background' }, ...]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### `count()`
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
count(); // 133
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `resolveCommandPath(name)`
|
|
144
|
+
|
|
145
|
+
Get absolute filesystem path to a command's JSON file.
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
resolveCommandPath("git");
|
|
149
|
+
// '/path/to/node_modules/@enjoys/context-engine/data/commands/git.json'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### `dataDir`
|
|
153
|
+
|
|
154
|
+
Absolute path to the commands directory.
|
|
155
|
+
|
|
156
|
+
### `clearCache()`
|
|
157
|
+
|
|
158
|
+
Clear the in-memory cache (useful in tests).
|
|
159
|
+
|
|
160
|
+
## Direct JSON Import
|
|
161
|
+
|
|
162
|
+
Access raw JSON files directly:
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
const git = require("@enjoys/context-engine/commands/git.json");
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Covered Tools (133)
|
|
169
|
+
|
|
170
|
+
| Category | Tools |
|
|
171
|
+
|----------|-------|
|
|
172
|
+
| **Cloud CLIs** | aws, az, gcloud, doctl, linode-cli, vercel, netlify, firebase, supabase, railway, render, flyctl, cloudflare, aws-vault |
|
|
173
|
+
| **Container & Orchestration** | docker, kubectl, helm |
|
|
174
|
+
| **Version Control** | git, gh, glab, svn, hg |
|
|
175
|
+
| **Node.js Ecosystem** | node, npm, npx, yarn, pnpm, bun, deno, turbo, nx, vite, next, nest, tsc, eslint, prettier |
|
|
176
|
+
| **Python Ecosystem** | python, pip, pipx, poetry, pipenv, conda, pytest, uvicorn, gunicorn, django-admin, flask |
|
|
177
|
+
| **Rust & Go** | cargo, rust, rustup, wasm-pack, go, gofmt, golangci-lint, air |
|
|
178
|
+
| **Java/JVM** | java, gradle, mvn |
|
|
179
|
+
| **Database** | psql, pg_dump, pg_restore, mysql, mongosh, redis-cli, sqlite3, cockroach, influx, clickhouse-client |
|
|
180
|
+
| **DevOps & Infrastructure** | terraform, terragrunt, pulumi, packer, vault, consul, nomad, ansible |
|
|
181
|
+
| **Web Servers** | nginx, caddy, httpd, apachectl |
|
|
182
|
+
| **Build Tools** | make, cmake, bazel, just |
|
|
183
|
+
| **Linux Core** | ls, cp, mv, rm, cat, grep, find, sed, awk, tar, chmod, chown, ps, sudo, ssh, ssh-keygen, rsync, curl, wget, systemctl, cd, zip, unzip, scp, journalctl, ufw, iptables, nft |
|
|
184
|
+
| **Testing** | jest, vitest, mocha, playwright, cypress, k6, locust |
|
|
185
|
+
| **Network & Security** | nmap, tcpdump, wireshark, openssl, certbot |
|
|
186
|
+
| **Package Managers** | apt, apt-get, yum, dnf, pacman, brew, choco, winget |
|
|
187
|
+
|
|
188
|
+
## Context Engine
|
|
189
|
+
|
|
190
|
+
Each command includes a `contextEngine` with runtime `detectors` — shell commands that gather live context (running containers, git branches, installed packages, etc.) for intelligent autocomplete:
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"contextEngine": {
|
|
195
|
+
"detectors": [
|
|
196
|
+
{
|
|
197
|
+
"name": "branches",
|
|
198
|
+
"description": "Local git branches",
|
|
199
|
+
"command": "git branch --format='%(refname:short)'",
|
|
200
|
+
"parser": "lines",
|
|
201
|
+
"cacheFor": 30,
|
|
202
|
+
"requiresCmd": "git"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Parser types:** `text` | `lines` | `json` | `csv` | `keyvalue` | `regex` | `table`
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
MIT © Enjoys Inc
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "air",
|
|
3
|
+
"description": "Live reload for Go applications during development",
|
|
4
|
+
"category": "Go Ecosystem",
|
|
5
|
+
"platforms": ["linux", "macos", "windows"],
|
|
6
|
+
"shells": ["bash", "zsh", "powershell", "fish"],
|
|
7
|
+
"subcommands": [
|
|
8
|
+
{ "name": "init", "description": "Generate default .air.toml config file" }
|
|
9
|
+
],
|
|
10
|
+
"globalOptions": [
|
|
11
|
+
{ "name": "-c", "description": "Config file path", "takesValue": true },
|
|
12
|
+
{ "name": "-d", "description": "Debug mode" },
|
|
13
|
+
{ "name": "--build.cmd", "description": "Build command", "takesValue": true },
|
|
14
|
+
{ "name": "--build.bin", "description": "Binary output path", "takesValue": true },
|
|
15
|
+
{ "name": "--build.include_ext", "description": "File extensions to watch", "takesValue": true },
|
|
16
|
+
{ "name": "--build.exclude_dir", "description": "Directories to exclude", "takesValue": true },
|
|
17
|
+
{ "name": "--build.delay", "description": "Delay before rebuild (ms)", "takesValue": true }
|
|
18
|
+
],
|
|
19
|
+
"examples": [
|
|
20
|
+
{ "command": "air", "description": "Start live reload with default config" },
|
|
21
|
+
{ "command": "air init", "description": "Generate .air.toml config" },
|
|
22
|
+
{ "command": "air -c .air.toml", "description": "Use specific config" },
|
|
23
|
+
{ "command": "air -d", "description": "Run with debug output" },
|
|
24
|
+
{ "command": "air --build.cmd 'go build -o ./tmp/main ./cmd/api'", "description": "Custom build command" }
|
|
25
|
+
],
|
|
26
|
+
"relatedCommands": ["go", "gofmt", "golangci-lint"],
|
|
27
|
+
"contextEngine": {
|
|
28
|
+
"detectors": [
|
|
29
|
+
{
|
|
30
|
+
"name": "air_config",
|
|
31
|
+
"description": "Air configuration file",
|
|
32
|
+
"command": "cat .air.toml 2>/dev/null || cat .air.conf 2>/dev/null || echo 'no config found'",
|
|
33
|
+
"parser": "text",
|
|
34
|
+
"cacheFor": 30
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "go_module",
|
|
38
|
+
"description": "Go module name",
|
|
39
|
+
"command": "head -1 go.mod 2>/dev/null",
|
|
40
|
+
"parser": "text",
|
|
41
|
+
"cacheFor": 120
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "main_packages",
|
|
45
|
+
"description": "Go main packages",
|
|
46
|
+
"command": "grep -rl 'func main()' --include='*.go' . 2>/dev/null | head -5",
|
|
47
|
+
"parser": "lines",
|
|
48
|
+
"cacheFor": 30
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "tmp_dir",
|
|
52
|
+
"description": "Air temp build output",
|
|
53
|
+
"command": "ls tmp/ 2>/dev/null",
|
|
54
|
+
"parser": "lines",
|
|
55
|
+
"cacheFor": 15
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ansible",
|
|
3
|
+
"description": "IT automation tool for configuration management, deployment, and orchestration",
|
|
4
|
+
"category": "infrastructure",
|
|
5
|
+
"platforms": ["linux", "macos"],
|
|
6
|
+
"shells": ["bash", "zsh", "fish"],
|
|
7
|
+
"subcommands": [
|
|
8
|
+
{ "name": "ansible-playbook", "description": "Run Ansible playbooks", "args": [{ "name": "<playbook>", "type": "file", "required": true, "description": "Playbook YAML file" }], "options": [{ "name": "--inventory", "short": "-i", "description": "Inventory file or host list", "type": "file" }, { "name": "--extra-vars", "short": "-e", "description": "Set additional variables", "type": "string" }, { "name": "--tags", "short": "-t", "description": "Only run tagged tasks", "type": "string" }, { "name": "--skip-tags", "description": "Skip tagged tasks", "type": "string" }, { "name": "--limit", "short": "-l", "description": "Limit to hosts", "type": "string" }, { "name": "--check", "short": "-C", "description": "Dry run" }, { "name": "--diff", "short": "-D", "description": "Show file diffs" }, { "name": "--verbose", "short": "-v", "description": "Verbose mode" }, { "name": "--become", "short": "-b", "description": "Run with elevated privileges" }, { "name": "--ask-become-pass", "short": "-K", "description": "Prompt for privilege escalation password" }, { "name": "--vault-password-file", "description": "Vault password file", "type": "file" }, { "name": "--forks", "short": "-f", "description": "Number of parallel processes", "type": "number" }], "examples": ["ansible-playbook site.yml", "ansible-playbook -i inventory.ini deploy.yml --tags deploy", "ansible-playbook site.yml --check --diff", "ansible-playbook -i hosts.yml playbook.yml -e 'env=production'"] },
|
|
9
|
+
{ "name": "ansible", "description": "Run ad-hoc commands", "args": [{ "name": "<pattern>", "type": "string", "required": true, "description": "Host pattern" }], "options": [{ "name": "--module-name", "short": "-m", "description": "Module name", "type": "string" }, { "name": "--args", "short": "-a", "description": "Module arguments", "type": "string" }, { "name": "--inventory", "short": "-i", "description": "Inventory", "type": "file" }, { "name": "--become", "short": "-b", "description": "Become root" }], "examples": ["ansible all -m ping", "ansible webservers -m shell -a 'uptime'", "ansible all -m apt -a 'name=nginx state=present' -b"] },
|
|
10
|
+
{ "name": "ansible-galaxy", "description": "Manage Ansible roles and collections", "options": [{ "name": "install", "description": "Install role or collection" }, { "name": "init", "description": "Create a new role" }, { "name": "list", "description": "List installed roles" }], "examples": ["ansible-galaxy install geerlingguy.docker", "ansible-galaxy collection install community.general", "ansible-galaxy init my_role"] },
|
|
11
|
+
{ "name": "ansible-vault", "description": "Manage encrypted files", "options": [{ "name": "create", "description": "Create encrypted file" }, { "name": "edit", "description": "Edit encrypted file" }, { "name": "encrypt", "description": "Encrypt a file" }, { "name": "decrypt", "description": "Decrypt a file" }, { "name": "view", "description": "View encrypted file" }], "examples": ["ansible-vault create secrets.yml", "ansible-vault edit secrets.yml", "ansible-vault encrypt vars.yml", "ansible-vault decrypt vars.yml"] },
|
|
12
|
+
{ "name": "ansible-lint", "description": "Lint Ansible playbooks", "args": [{ "name": "<file>", "type": "file", "required": false, "description": "Playbook file" }], "examples": ["ansible-lint", "ansible-lint playbook.yml"] }
|
|
13
|
+
],
|
|
14
|
+
"globalOptions": [
|
|
15
|
+
{ "name": "--help", "short": "-h", "description": "Show help" },
|
|
16
|
+
{ "name": "--version", "description": "Show version" }
|
|
17
|
+
],
|
|
18
|
+
"examples": [
|
|
19
|
+
"ansible-playbook -i inventory.ini site.yml",
|
|
20
|
+
"ansible all -m ping -i hosts",
|
|
21
|
+
"ansible-vault encrypt secrets.yml"
|
|
22
|
+
],
|
|
23
|
+
"relatedCommands": ["terraform", "puppet", "chef", "salt"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apachectl",
|
|
3
|
+
"description": "Apache HTTP Server control interface",
|
|
4
|
+
"category": "Network/Security",
|
|
5
|
+
"platforms": ["linux", "macos"],
|
|
6
|
+
"shells": ["bash", "zsh", "fish"],
|
|
7
|
+
"subcommands": [
|
|
8
|
+
{ "name": "start", "description": "Start Apache" },
|
|
9
|
+
{ "name": "stop", "description": "Stop Apache" },
|
|
10
|
+
{ "name": "restart", "description": "Restart Apache" },
|
|
11
|
+
{ "name": "graceful", "description": "Graceful restart (no dropped connections)" },
|
|
12
|
+
{ "name": "graceful-stop", "description": "Graceful stop" },
|
|
13
|
+
{ "name": "status", "description": "Display server status (requires mod_status)" },
|
|
14
|
+
{ "name": "fullstatus", "description": "Full server status" },
|
|
15
|
+
{ "name": "configtest", "description": "Test configuration syntax" }
|
|
16
|
+
],
|
|
17
|
+
"globalOptions": [
|
|
18
|
+
{ "name": "-d", "description": "Server root directory", "takesValue": true },
|
|
19
|
+
{ "name": "-f", "description": "Config file path", "takesValue": true },
|
|
20
|
+
{ "name": "-C", "description": "directive processed before config", "takesValue": true },
|
|
21
|
+
{ "name": "-c", "description": "directive processed after config", "takesValue": true },
|
|
22
|
+
{ "name": "-D", "description": "Define a parameter", "takesValue": true },
|
|
23
|
+
{ "name": "-e", "description": "Log level for startup", "takesValue": true },
|
|
24
|
+
{ "name": "-E", "description": "Log startup errors to file", "takesValue": true },
|
|
25
|
+
{ "name": "-k", "description": "Signal (start, restart, graceful, graceful-stop, stop)", "takesValue": true },
|
|
26
|
+
{ "name": "-R", "description": "Server root for SHARED_CORE", "takesValue": true },
|
|
27
|
+
{ "name": "-n", "description": "Service name (Windows)", "takesValue": true },
|
|
28
|
+
{ "name": "-t", "description": "Test config and dump parsed settings" },
|
|
29
|
+
{ "name": "-v", "description": "Show version" },
|
|
30
|
+
{ "name": "-V", "description": "Show version and build options" },
|
|
31
|
+
{ "name": "-h", "description": "Show help" },
|
|
32
|
+
{ "name": "-l", "description": "List compiled-in modules" },
|
|
33
|
+
{ "name": "-L", "description": "List available directives" },
|
|
34
|
+
{ "name": "-M", "description": "List loaded modules" },
|
|
35
|
+
{ "name": "-S", "description": "Show parsed VirtualHost settings" },
|
|
36
|
+
{ "name": "-T", "description": "Start without DocumentRoot check" },
|
|
37
|
+
{ "name": "-t", "description": "Syntax check" },
|
|
38
|
+
{ "name": "-X", "description": "Debug mode (single process)" }
|
|
39
|
+
],
|
|
40
|
+
"examples": [
|
|
41
|
+
{ "command": "apachectl start", "description": "Start Apache" },
|
|
42
|
+
{ "command": "apachectl stop", "description": "Stop Apache" },
|
|
43
|
+
{ "command": "apachectl graceful", "description": "Graceful restart" },
|
|
44
|
+
{ "command": "apachectl configtest", "description": "Test configuration" },
|
|
45
|
+
{ "command": "apachectl -M", "description": "List loaded modules" },
|
|
46
|
+
{ "command": "apachectl -S", "description": "Parsed VirtualHost settings" },
|
|
47
|
+
{ "command": "apachectl -V", "description": "Version and compile settings" },
|
|
48
|
+
{ "command": "apachectl -t -D DUMP_VHOSTS", "description": "Dump VirtualHosts" },
|
|
49
|
+
{ "command": "apachectl -t -D DUMP_MODULES", "description": "Dump loaded modules" }
|
|
50
|
+
],
|
|
51
|
+
"relatedCommands": ["nginx", "certbot", "httpd"],
|
|
52
|
+
"contextEngine": {
|
|
53
|
+
"detectors": [
|
|
54
|
+
{
|
|
55
|
+
"name": "modules",
|
|
56
|
+
"description": "Loaded Apache modules",
|
|
57
|
+
"command": "apachectl -M 2>/dev/null | tail -30",
|
|
58
|
+
"parser": "lines",
|
|
59
|
+
"cacheFor": 120,
|
|
60
|
+
"requiresCmd": "apachectl"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "vhosts",
|
|
64
|
+
"description": "Virtual host configuration",
|
|
65
|
+
"command": "apachectl -S 2>/dev/null | head -20",
|
|
66
|
+
"parser": "text",
|
|
67
|
+
"cacheFor": 60,
|
|
68
|
+
"requiresCmd": "apachectl"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "config_files",
|
|
72
|
+
"description": "Apache config files",
|
|
73
|
+
"command": "ls /etc/apache2/sites-enabled/ 2>/dev/null || ls /etc/httpd/conf.d/ 2>/dev/null | head -15",
|
|
74
|
+
"parser": "lines",
|
|
75
|
+
"cacheFor": 60
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "status",
|
|
79
|
+
"description": "Apache status",
|
|
80
|
+
"command": "apachectl status 2>/dev/null | head -10 || systemctl status apache2 2>/dev/null | head -5 || systemctl status httpd 2>/dev/null | head -5",
|
|
81
|
+
"parser": "text",
|
|
82
|
+
"cacheFor": 30,
|
|
83
|
+
"requiresCmd": "apachectl"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apt-get",
|
|
3
|
+
"description": "Low-level APT package management tool for Debian/Ubuntu",
|
|
4
|
+
"category": "Package Managers",
|
|
5
|
+
"platforms": ["linux"],
|
|
6
|
+
"shells": ["bash", "zsh", "fish"],
|
|
7
|
+
"subcommands": [
|
|
8
|
+
{ "name": "install", "description": "Install packages", "args": [{ "name": "packages", "description": "Package names", "required": true }], "options": [
|
|
9
|
+
{ "name": "-y", "description": "Assume yes" },
|
|
10
|
+
{ "name": "--no-install-recommends", "description": "Skip recommended packages" },
|
|
11
|
+
{ "name": "--reinstall", "description": "Reinstall" },
|
|
12
|
+
{ "name": "-d", "description": "Download only" },
|
|
13
|
+
{ "name": "--allow-unauthenticated", "description": "Allow unauthenticated packages" },
|
|
14
|
+
{ "name": "--allow-downgrades", "description": "Allow downgrade" }
|
|
15
|
+
]},
|
|
16
|
+
{ "name": "remove", "description": "Remove packages", "args": [{ "name": "packages", "description": "Package names", "required": true }] },
|
|
17
|
+
{ "name": "purge", "description": "Remove packages with config files" },
|
|
18
|
+
{ "name": "update", "description": "Update package index" },
|
|
19
|
+
{ "name": "upgrade", "description": "Upgrade packages" },
|
|
20
|
+
{ "name": "dist-upgrade", "description": "Distribution upgrade" },
|
|
21
|
+
{ "name": "autoremove", "description": "Remove unneeded packages" },
|
|
22
|
+
{ "name": "autoclean", "description": "Clean old package archives" },
|
|
23
|
+
{ "name": "clean", "description": "Clear local repository" },
|
|
24
|
+
{ "name": "download", "description": "Download package .deb", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
25
|
+
{ "name": "source", "description": "Download source package" },
|
|
26
|
+
{ "name": "build-dep", "description": "Install build dependencies", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
27
|
+
{ "name": "check", "description": "Verify no broken dependencies" },
|
|
28
|
+
{ "name": "changelog", "description": "Download and display changelog" },
|
|
29
|
+
{ "name": "indextargets", "description": "List index targets" }
|
|
30
|
+
],
|
|
31
|
+
"globalOptions": [
|
|
32
|
+
{ "name": "-y", "description": "Assume yes" },
|
|
33
|
+
{ "name": "-q", "description": "Quiet" },
|
|
34
|
+
{ "name": "-qq", "description": "Very quiet" },
|
|
35
|
+
{ "name": "-s", "description": "Simulate (dry run)" },
|
|
36
|
+
{ "name": "-d", "description": "Download only" },
|
|
37
|
+
{ "name": "-f", "description": "Fix broken dependencies" },
|
|
38
|
+
{ "name": "-o", "description": "Set config option", "takesValue": true },
|
|
39
|
+
{ "name": "-t", "description": "Target release", "takesValue": true },
|
|
40
|
+
{ "name": "--force-yes", "description": "Force yes (deprecated)" },
|
|
41
|
+
{ "name": "--print-uris", "description": "Print URIs instead of downloading" }
|
|
42
|
+
],
|
|
43
|
+
"examples": [
|
|
44
|
+
{ "command": "sudo apt-get update", "description": "Update package index" },
|
|
45
|
+
{ "command": "sudo apt-get upgrade -y", "description": "Upgrade all packages" },
|
|
46
|
+
{ "command": "sudo apt-get install -y curl wget", "description": "Install packages" },
|
|
47
|
+
{ "command": "sudo apt-get install --no-install-recommends nginx", "description": "Minimal install" },
|
|
48
|
+
{ "command": "sudo apt-get remove nginx", "description": "Remove package" },
|
|
49
|
+
{ "command": "sudo apt-get purge nginx", "description": "Remove with config" },
|
|
50
|
+
{ "command": "sudo apt-get autoremove", "description": "Remove unused" },
|
|
51
|
+
{ "command": "sudo apt-get dist-upgrade", "description": "Distribution upgrade" },
|
|
52
|
+
{ "command": "sudo apt-get build-dep python3", "description": "Install build deps" },
|
|
53
|
+
{ "command": "apt-get -s install nginx", "description": "Simulate install" }
|
|
54
|
+
],
|
|
55
|
+
"relatedCommands": ["apt", "dpkg"],
|
|
56
|
+
"contextEngine": {
|
|
57
|
+
"detectors": [
|
|
58
|
+
{
|
|
59
|
+
"name": "installed",
|
|
60
|
+
"description": "Installed packages",
|
|
61
|
+
"command": "dpkg -l 2>/dev/null | grep '^ii' | tail -20",
|
|
62
|
+
"parser": "lines",
|
|
63
|
+
"cacheFor": 120
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "broken",
|
|
67
|
+
"description": "Broken packages",
|
|
68
|
+
"command": "dpkg -l 2>/dev/null | grep -v '^ii' | grep -v '^||' | grep -v '^Desired' | grep -v '^+' | head -10",
|
|
69
|
+
"parser": "lines",
|
|
70
|
+
"cacheFor": 60
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "sources",
|
|
74
|
+
"description": "Repository sources",
|
|
75
|
+
"command": "cat /etc/apt/sources.list 2>/dev/null | grep -v '^#' | grep -v '^$' | head -10",
|
|
76
|
+
"parser": "lines",
|
|
77
|
+
"cacheFor": 300
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apt",
|
|
3
|
+
"description": "High-level package management tool for Debian/Ubuntu",
|
|
4
|
+
"category": "Package Managers",
|
|
5
|
+
"platforms": ["linux"],
|
|
6
|
+
"shells": ["bash", "zsh", "fish"],
|
|
7
|
+
"subcommands": [
|
|
8
|
+
{ "name": "install", "description": "Install packages", "args": [{ "name": "packages", "description": "Package names", "required": true }], "options": [
|
|
9
|
+
{ "name": "-y", "description": "Assume yes" },
|
|
10
|
+
{ "name": "--no-install-recommends", "description": "Skip recommended packages" },
|
|
11
|
+
{ "name": "--reinstall", "description": "Reinstall package" },
|
|
12
|
+
{ "name": "--fix-broken", "description": "Fix broken dependencies" },
|
|
13
|
+
{ "name": "-d", "description": "Download only" }
|
|
14
|
+
]},
|
|
15
|
+
{ "name": "remove", "description": "Remove packages", "args": [{ "name": "packages", "description": "Package names", "required": true }], "options": [
|
|
16
|
+
{ "name": "-y", "description": "Assume yes" },
|
|
17
|
+
{ "name": "--purge", "description": "Remove config files too" }
|
|
18
|
+
]},
|
|
19
|
+
{ "name": "purge", "description": "Remove packages and config files" },
|
|
20
|
+
{ "name": "update", "description": "Update package index" },
|
|
21
|
+
{ "name": "upgrade", "description": "Upgrade installed packages", "options": [
|
|
22
|
+
{ "name": "-y", "description": "Assume yes" }
|
|
23
|
+
]},
|
|
24
|
+
{ "name": "full-upgrade", "description": "Full upgrade (may remove packages)" },
|
|
25
|
+
{ "name": "dist-upgrade", "description": "Distribution upgrade" },
|
|
26
|
+
{ "name": "autoremove", "description": "Remove unneeded packages" },
|
|
27
|
+
{ "name": "autoclean", "description": "Clean old downloaded packages" },
|
|
28
|
+
{ "name": "clean", "description": "Clean local package cache" },
|
|
29
|
+
{ "name": "search", "description": "Search package names and descriptions", "args": [{ "name": "query", "description": "Search term", "required": true }] },
|
|
30
|
+
{ "name": "show", "description": "Show package details", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
31
|
+
{ "name": "list", "description": "List packages", "options": [
|
|
32
|
+
{ "name": "--installed", "description": "Show installed" },
|
|
33
|
+
{ "name": "--upgradable", "description": "Show upgradable" },
|
|
34
|
+
{ "name": "--all-versions", "description": "Show all versions" }
|
|
35
|
+
]},
|
|
36
|
+
{ "name": "depends", "description": "Show package dependencies", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
37
|
+
{ "name": "rdepends", "description": "Show reverse dependencies", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
38
|
+
{ "name": "policy", "description": "Show package policy/versions", "args": [{ "name": "package", "description": "Package name", "required": true }] },
|
|
39
|
+
{ "name": "edit-sources", "description": "Edit sources.list" },
|
|
40
|
+
{ "name": "satisfy", "description": "Satisfy dependency strings" }
|
|
41
|
+
],
|
|
42
|
+
"globalOptions": [
|
|
43
|
+
{ "name": "-y", "description": "Automatic yes" },
|
|
44
|
+
{ "name": "-q", "description": "Quiet output" },
|
|
45
|
+
{ "name": "-s", "description": "Dry run / simulate" },
|
|
46
|
+
{ "name": "-d", "description": "Download only" },
|
|
47
|
+
{ "name": "--fix-broken", "shorthand": "-f", "description": "Fix broken dependencies" },
|
|
48
|
+
{ "name": "-o", "description": "Set config option", "takesValue": true },
|
|
49
|
+
{ "name": "-t", "description": "Target release", "takesValue": true }
|
|
50
|
+
],
|
|
51
|
+
"examples": [
|
|
52
|
+
{ "command": "sudo apt update", "description": "Update package index" },
|
|
53
|
+
{ "command": "sudo apt upgrade -y", "description": "Upgrade all packages" },
|
|
54
|
+
{ "command": "sudo apt install nginx", "description": "Install nginx" },
|
|
55
|
+
{ "command": "sudo apt install -y --no-install-recommends curl git", "description": "Install minimal" },
|
|
56
|
+
{ "command": "apt search redis", "description": "Search for Redis" },
|
|
57
|
+
{ "command": "apt show nginx", "description": "Show package details" },
|
|
58
|
+
{ "command": "apt list --installed", "description": "List installed packages" },
|
|
59
|
+
{ "command": "apt list --upgradable", "description": "List upgradable" },
|
|
60
|
+
{ "command": "sudo apt remove --purge nginx", "description": "Complete removal" },
|
|
61
|
+
{ "command": "sudo apt autoremove", "description": "Remove unused packages" }
|
|
62
|
+
],
|
|
63
|
+
"relatedCommands": ["apt-get", "dpkg"],
|
|
64
|
+
"contextEngine": {
|
|
65
|
+
"detectors": [
|
|
66
|
+
{
|
|
67
|
+
"name": "installed",
|
|
68
|
+
"description": "Installed packages",
|
|
69
|
+
"command": "apt list --installed 2>/dev/null | tail -20",
|
|
70
|
+
"parser": "lines",
|
|
71
|
+
"cacheFor": 120,
|
|
72
|
+
"requiresCmd": "apt"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "upgradable",
|
|
76
|
+
"description": "Upgradable packages",
|
|
77
|
+
"command": "apt list --upgradable 2>/dev/null | tail -20",
|
|
78
|
+
"parser": "lines",
|
|
79
|
+
"cacheFor": 120,
|
|
80
|
+
"requiresCmd": "apt"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "sources",
|
|
84
|
+
"description": "Configured repositories",
|
|
85
|
+
"command": "cat /etc/apt/sources.list 2>/dev/null | grep -v '^#' | grep -v '^$' | head -10",
|
|
86
|
+
"parser": "lines",
|
|
87
|
+
"cacheFor": 300
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "awk",
|
|
3
|
+
"description": "Pattern scanning and text processing language",
|
|
4
|
+
"category": "text-processing",
|
|
5
|
+
"platforms": ["linux", "macos"],
|
|
6
|
+
"shells": ["bash", "zsh", "fish"],
|
|
7
|
+
"subcommands": [],
|
|
8
|
+
"globalOptions": [
|
|
9
|
+
{ "name": "-F", "description": "Field separator", "type": "string" },
|
|
10
|
+
{ "name": "-v", "description": "Assign variable", "type": "string" },
|
|
11
|
+
{ "name": "-f", "description": "Program file", "type": "file" }
|
|
12
|
+
],
|
|
13
|
+
"examples": [
|
|
14
|
+
"awk '{print $1}' file.txt",
|
|
15
|
+
"awk -F: '{print $1, $3}' /etc/passwd",
|
|
16
|
+
"awk '/pattern/ {print}' file.txt",
|
|
17
|
+
"awk '{sum += $1} END {print sum}' numbers.txt",
|
|
18
|
+
"awk 'NR==10,NR==20' file.txt",
|
|
19
|
+
"awk '{print NR, $0}' file.txt",
|
|
20
|
+
"awk -F, '{print $2}' data.csv",
|
|
21
|
+
"awk 'length > 80' file.txt",
|
|
22
|
+
"awk '!seen[$0]++' file.txt",
|
|
23
|
+
"ps aux | awk '{print $2, $11}'"
|
|
24
|
+
],
|
|
25
|
+
"relatedCommands": ["sed", "grep", "cut", "sort", "uniq", "perl"]
|
|
26
|
+
}
|