@enjoys/context-engine 1.0.4 → 1.0.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.
@@ -1,88 +1,225 @@
1
1
  {
2
2
  "name": "journalctl",
3
- "description": "Query and display systemd journal logs",
4
- "category": "Linux Coreutils",
5
- "platforms": ["linux"],
6
- "shells": ["bash", "zsh", "fish"],
3
+ "description": "Query and display messages from the systemd journal",
4
+ "category": "system",
5
+ "platforms": [
6
+ "linux"
7
+ ],
8
+ "shells": [
9
+ "bash",
10
+ "zsh",
11
+ "fish"
12
+ ],
7
13
  "subcommands": [],
8
14
  "globalOptions": [
9
- { "name": "--unit", "shorthand": "-u", "description": "Filter by systemd unit", "takesValue": true },
10
- { "name": "--user-unit", "description": "Filter by user unit", "takesValue": true },
11
- { "name": "--follow", "shorthand": "-f", "description": "Follow log output (like tail -f)" },
12
- { "name": "--lines", "shorthand": "-n", "description": "Number of lines to show", "takesValue": true },
13
- { "name": "--reverse", "shorthand": "-r", "description": "Reverse output (newest first)" },
14
- { "name": "--output", "shorthand": "-o", "description": "Output format (short, json, cat, verbose, export)", "takesValue": true },
15
- { "name": "--priority", "shorthand": "-p", "description": "Filter by priority (emerg, alert, crit, err, warning, notice, info, debug)", "takesValue": true },
16
- { "name": "--since", "shorthand": "-S", "description": "Show entries since time", "takesValue": true },
17
- { "name": "--until", "shorthand": "-U", "description": "Show entries until time", "takesValue": true },
18
- { "name": "--boot", "shorthand": "-b", "description": "Show messages from specific boot", "takesValue": true },
19
- { "name": "--kernel", "shorthand": "-k", "description": "Show kernel messages" },
20
- { "name": "--dmesg", "description": "Show kernel ring buffer" },
21
- { "name": "--identifier", "shorthand": "-t", "description": "Filter by syslog identifier", "takesValue": true },
22
- { "name": "--grep", "shorthand": "-g", "description": "Filter by regex pattern", "takesValue": true },
23
- { "name": "--case-sensitive", "description": "Case sensitive grep", "takesValue": true },
24
- { "name": "--catalog", "shorthand": "-x", "description": "Add message explanations" },
25
- { "name": "--no-pager", "description": "Don't pipe through pager" },
26
- { "name": "--all", "shorthand": "-a", "description": "Show all fields" },
27
- { "name": "--disk-usage", "description": "Show journal disk usage" },
28
- { "name": "--list-boots", "description": "List boot entries" },
29
- { "name": "--vacuum-size", "description": "Reduce journal size to limit", "takesValue": true },
30
- { "name": "--vacuum-time", "description": "Remove journal older than", "takesValue": true },
31
- { "name": "--vacuum-files", "description": "Keep only N journal files", "takesValue": true },
32
- { "name": "--verify", "description": "Verify journal file consistency" },
33
- { "name": "--field", "shorthand": "-F", "description": "List unique values of field", "takesValue": true },
34
- { "name": "--header", "description": "Show journal header" },
35
- { "name": "_PID", "description": "Filter by PID", "takesValue": true },
36
- { "name": "_UID", "description": "Filter by UID", "takesValue": true },
37
- { "name": "_COMM", "description": "Filter by command name", "takesValue": true }
15
+ {
16
+ "name": "-u",
17
+ "description": "Show logs for a specific unit",
18
+ "type": "string"
19
+ },
20
+ {
21
+ "name": "-f",
22
+ "description": "Follow show new log entries as they appear"
23
+ },
24
+ {
25
+ "name": "-n",
26
+ "description": "Number of lines to show (default: 10)",
27
+ "type": "number"
28
+ },
29
+ {
30
+ "name": "-b",
31
+ "description": "Show logs from a specific boot (0=current, -1=previous)",
32
+ "type": "string"
33
+ },
34
+ {
35
+ "name": "-p",
36
+ "description": "Priority filter: emerg, alert, crit, err, warning, notice, info, debug",
37
+ "type": "string"
38
+ },
39
+ {
40
+ "name": "--since",
41
+ "description": "Start time (YYYY-MM-DD HH:MM:SS or relative: '1 hour ago')",
42
+ "type": "string"
43
+ },
44
+ {
45
+ "name": "--until",
46
+ "description": "End time",
47
+ "type": "string"
48
+ },
49
+ {
50
+ "name": "-o",
51
+ "description": "Output format: short, short-iso, json, json-pretty, cat, verbose",
52
+ "type": "string"
53
+ },
54
+ {
55
+ "name": "-r",
56
+ "description": "Reverse output (newest first)"
57
+ },
58
+ {
59
+ "name": "-e",
60
+ "description": "Jump to end of journal"
61
+ },
62
+ {
63
+ "name": "-x",
64
+ "description": "Add explanatory text from message catalog"
65
+ },
66
+ {
67
+ "name": "-k",
68
+ "description": "Show only kernel messages (dmesg equivalent)"
69
+ },
70
+ {
71
+ "name": "-t",
72
+ "description": "Filter by syslog identifier (tag)",
73
+ "type": "string"
74
+ },
75
+ {
76
+ "name": "--no-pager",
77
+ "description": "Don't pipe through pager"
78
+ },
79
+ {
80
+ "name": "--no-hostname",
81
+ "description": "Don't show hostname field"
82
+ },
83
+ {
84
+ "name": "--no-full",
85
+ "description": "Ellipsize long lines"
86
+ },
87
+ {
88
+ "name": "--disk-usage",
89
+ "description": "Show journal disk usage"
90
+ },
91
+ {
92
+ "name": "--vacuum-size",
93
+ "description": "Reduce journal to this size",
94
+ "type": "string"
95
+ },
96
+ {
97
+ "name": "--vacuum-time",
98
+ "description": "Remove entries older than this",
99
+ "type": "string"
100
+ },
101
+ {
102
+ "name": "--vacuum-files",
103
+ "description": "Limit number of journal files",
104
+ "type": "number"
105
+ },
106
+ {
107
+ "name": "--list-boots",
108
+ "description": "List recorded boots"
109
+ },
110
+ {
111
+ "name": "--grep",
112
+ "short": "-g",
113
+ "description": "Filter by regex pattern in message",
114
+ "type": "string"
115
+ },
116
+ {
117
+ "name": "--case-sensitive",
118
+ "description": "Case-sensitive grep (default: no)",
119
+ "type": "string"
120
+ },
121
+ {
122
+ "name": "_PID",
123
+ "description": "Filter by process ID",
124
+ "type": "number"
125
+ },
126
+ {
127
+ "name": "_UID",
128
+ "description": "Filter by user ID",
129
+ "type": "number"
130
+ },
131
+ {
132
+ "name": "_COMM",
133
+ "description": "Filter by process name",
134
+ "type": "string"
135
+ },
136
+ {
137
+ "name": "--user",
138
+ "description": "Show user journal entries"
139
+ },
140
+ {
141
+ "name": "--system",
142
+ "description": "Show system journal entries (default)"
143
+ },
144
+ {
145
+ "name": "--header",
146
+ "description": "Show journal header information"
147
+ },
148
+ {
149
+ "name": "--verify",
150
+ "description": "Verify journal file consistency"
151
+ },
152
+ {
153
+ "name": "-q",
154
+ "description": "Quiet — suppress info messages"
155
+ },
156
+ {
157
+ "name": "-a",
158
+ "description": "Show all fields including unprintable"
159
+ }
38
160
  ],
39
161
  "examples": [
40
- { "command": "journalctl -u nginx", "description": "Show nginx logs" },
41
- { "command": "journalctl -u nginx -f", "description": "Follow nginx logs" },
42
- { "command": "journalctl -u nginx --since '1 hour ago'", "description": "Last hour of logs" },
43
- { "command": "journalctl -p err", "description": "Show only errors" },
44
- { "command": "journalctl -k", "description": "Kernel messages" },
45
- { "command": "journalctl -b -1", "description": "Previous boot logs" },
46
- { "command": "journalctl --disk-usage", "description": "Show disk usage" },
47
- { "command": "journalctl -o json-pretty -n 10", "description": "JSON output" },
48
- { "command": "journalctl --vacuum-time=7d", "description": "Clean logs older than 7 days" },
49
- { "command": "journalctl -u docker -g 'error|fail' --since today", "description": "Docker errors today" }
162
+ "journalctl",
163
+ "journalctl -u nginx",
164
+ "journalctl -u nginx -f",
165
+ "journalctl -u nginx -n 100",
166
+ "journalctl -u nginx -b",
167
+ "journalctl -u nginx -b -1",
168
+ "journalctl -u nginx --since '1 hour ago'",
169
+ "journalctl -u nginx --since '2024-01-01' --until '2024-01-02'",
170
+ "journalctl -u nginx -p err",
171
+ "journalctl -u nginx -p warning",
172
+ "journalctl -u nginx -o json",
173
+ "journalctl -u nginx -o json-pretty",
174
+ "journalctl -u nginx -o short-iso",
175
+ "journalctl -u nginx -o cat",
176
+ "journalctl -u nginx --grep 'error|failed'",
177
+ "journalctl -u nginx -r -n 50",
178
+ "journalctl -k",
179
+ "journalctl -k -b -1",
180
+ "journalctl _PID=1234",
181
+ "journalctl _COMM=sshd",
182
+ "journalctl -p err -b --no-pager",
183
+ "journalctl --list-boots",
184
+ "journalctl --disk-usage",
185
+ "journalctl --vacuum-size=500M",
186
+ "journalctl --vacuum-time=30d",
187
+ "journalctl -u nginx -u php-fpm --since today",
188
+ "journalctl --since '5 minutes ago' -p err..emerg",
189
+ "journalctl -xe"
190
+ ],
191
+ "relatedCommands": [
192
+ "systemctl",
193
+ "systemd-analyze",
194
+ "dmesg",
195
+ "syslog"
50
196
  ],
51
- "relatedCommands": ["systemctl", "dmesg"],
52
197
  "contextEngine": {
53
198
  "detectors": [
54
199
  {
55
- "name": "units",
56
- "description": "Active systemd units",
57
- "command": "systemctl list-units --type=service --state=running --no-pager --plain 2>/dev/null | awk '{print $1}' | head -30",
58
- "parser": "lines",
59
- "cacheFor": 30,
60
- "requiresCmd": "systemctl"
61
- },
62
- {
63
- "name": "boots",
64
- "description": "Boot entries",
65
- "command": "journalctl --list-boots --no-pager 2>/dev/null | head -10",
66
- "parser": "lines",
67
- "cacheFor": 120,
68
- "requiresCmd": "journalctl"
69
- },
70
- {
71
- "name": "disk_usage",
200
+ "name": "journal_size",
72
201
  "description": "Journal disk usage",
73
- "command": "journalctl --disk-usage 2>/dev/null",
202
+ "command": "journalctl --disk-usage 2>/dev/null | awk '{print $NF}'",
74
203
  "parser": "text",
75
- "cacheFor": 60,
204
+ "cacheFor": 120,
76
205
  "requiresCmd": "journalctl"
77
206
  },
78
207
  {
79
208
  "name": "recent_errors",
80
- "description": "Recent error messages",
81
- "command": "journalctl -p err --no-pager -n 5 2>/dev/null",
209
+ "description": "Recent error-level journal entries",
210
+ "command": "journalctl -p err --since '1 hour ago' --no-pager -q 2>/dev/null | tail -10",
82
211
  "parser": "lines",
83
212
  "cacheFor": 15,
84
213
  "requiresCmd": "journalctl"
214
+ },
215
+ {
216
+ "name": "boot_count",
217
+ "description": "Number of recorded boots",
218
+ "command": "journalctl --list-boots --no-pager -q 2>/dev/null | wc -l",
219
+ "parser": "text",
220
+ "cacheFor": 300,
221
+ "requiresCmd": "journalctl"
85
222
  }
86
223
  ]
87
224
  }
88
- }
225
+ }
@@ -137,6 +137,7 @@
137
137
  "supabase.json",
138
138
  "svn.json",
139
139
  "systemctl.json",
140
+ "systemd-analyze.json",
140
141
  "tar.json",
141
142
  "tcpdump.json",
142
143
  "terraform.json",
@@ -160,7 +161,8 @@
160
161
  "yarn.json",
161
162
  "yq.json",
162
163
  "yum.json",
163
- "zip.json"
164
+ "zip.json",
165
+ "zsh.json"
164
166
  ],
165
167
  "context": [
166
168
  {
@@ -405,6 +407,7 @@
405
407
  "scp.json",
406
408
  "rsync.json",
407
409
  "systemctl.json",
410
+ "systemd-analyze.json",
408
411
  "journalctl.json",
409
412
  "ufw.json",
410
413
  "iptables.json",
@@ -413,7 +416,8 @@
413
416
  "ps.json",
414
417
  "sudo.json",
415
418
  "ssh-keygen.json",
416
- "linux.json"
419
+ "linux.json",
420
+ "zsh.json"
417
421
  ]
418
422
  },
419
423
  {