@maudecode/cowtail-cli 0.1.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 +163 -0
- package/dist/cowtail.js +18440 -0
- package/docs/config.example.json +5 -0
- package/install.sh +58 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# cowtail-cli
|
|
2
|
+
|
|
3
|
+
Cowtail CLI for Cowtail backend actions.
|
|
4
|
+
|
|
5
|
+
## Goals
|
|
6
|
+
- Ship a real macOS arm64 executable binary
|
|
7
|
+
- Keep the codebase in TypeScript
|
|
8
|
+
- Use Bun for local development and compilation
|
|
9
|
+
- Give alertmanager-related automation a thin, standard interface into Cowtail
|
|
10
|
+
|
|
11
|
+
## Current status
|
|
12
|
+
Phase 1 is implemented:
|
|
13
|
+
- `cowtail version`
|
|
14
|
+
- `cowtail update`
|
|
15
|
+
- `cowtail alert create`
|
|
16
|
+
- `cowtail alert list`
|
|
17
|
+
- `cowtail alert show`
|
|
18
|
+
- `cowtail alert delete`
|
|
19
|
+
- `cowtail config validate`
|
|
20
|
+
- `cowtail config doctor`
|
|
21
|
+
- `cowtail config show`
|
|
22
|
+
- `cowtail fix create`
|
|
23
|
+
- `cowtail fix list`
|
|
24
|
+
- `cowtail fix show`
|
|
25
|
+
- `cowtail fix delete`
|
|
26
|
+
- `cowtail roundup test`
|
|
27
|
+
- `cowtail health show`
|
|
28
|
+
- `cowtail realtime health`
|
|
29
|
+
- `cowtail push send`
|
|
30
|
+
- `cowtail push test`
|
|
31
|
+
- `cowtail users devices`
|
|
32
|
+
- `cowtail users list`
|
|
33
|
+
- `cowtail help`
|
|
34
|
+
|
|
35
|
+
## Layout
|
|
36
|
+
- `src/cli.ts` - entrypoint
|
|
37
|
+
- `src/commands/` - command handlers
|
|
38
|
+
- `src/lib/` - config and HTTP helpers
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
```bash
|
|
42
|
+
cd ..
|
|
43
|
+
bun install
|
|
44
|
+
cd cli
|
|
45
|
+
bun install
|
|
46
|
+
bun run check
|
|
47
|
+
bun run dev -- help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Build executable
|
|
51
|
+
```bash
|
|
52
|
+
cd cli
|
|
53
|
+
bun run build
|
|
54
|
+
./dist/cowtail help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Install From A Release
|
|
58
|
+
```bash
|
|
59
|
+
curl -fsSL https://raw.githubusercontent.com/MaudeCode/cowtail/main/cli/install.sh | sh
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Set `COWTAIL_VERSION=vX.Y.Z` to pin a specific release tag. Set `INSTALL_DIR=/your/bin` to override the install location.
|
|
63
|
+
|
|
64
|
+
## Install From npm
|
|
65
|
+
```bash
|
|
66
|
+
npm install -g @maudecode/cowtail-cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The npm package exposes the `cowtail` command. Tagged releases publish the package through the root release workflow, with the npm version derived from the Git tag by removing the leading `v`.
|
|
70
|
+
|
|
71
|
+
## Config
|
|
72
|
+
The CLI reads runtime settings from a JSON config file.
|
|
73
|
+
|
|
74
|
+
Default lookup path:
|
|
75
|
+
- `~/.config/cowtail/config.json`
|
|
76
|
+
|
|
77
|
+
Optional path override:
|
|
78
|
+
- `COWTAIL_CONFIG_PATH`
|
|
79
|
+
|
|
80
|
+
Example config:
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"baseUrl": "https://your-cowtail.example/actions",
|
|
84
|
+
"pushBearerToken": "replace-me",
|
|
85
|
+
"timeoutMs": 10000
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`baseUrl` is required. Realtime health diagnostics use the same origin as `baseUrl` and check `/healthz`. `pushBearerToken` is only required for authenticated commands such as `users list`, `users devices`, `push send`, `push test`, and `roundup test`.
|
|
90
|
+
|
|
91
|
+
`cowtail config show` reports the resolved config path, whether the file was found, whether a base URL is configured, and whether a push token is configured without printing secret values.
|
|
92
|
+
|
|
93
|
+
Tagged release builds embed the Git tag as the canonical CLI version. Local builds default to `dev` unless `COWTAIL_VERSION` is set.
|
|
94
|
+
|
|
95
|
+
## Planned command shape
|
|
96
|
+
- `cowtail version`
|
|
97
|
+
- `cowtail update`
|
|
98
|
+
- `cowtail alert create`
|
|
99
|
+
- `cowtail alert list`
|
|
100
|
+
- `cowtail alert show`
|
|
101
|
+
- `cowtail alert delete`
|
|
102
|
+
- `cowtail config validate`
|
|
103
|
+
- `cowtail config doctor`
|
|
104
|
+
- `cowtail config show`
|
|
105
|
+
- `cowtail fix create`
|
|
106
|
+
- `cowtail fix list`
|
|
107
|
+
- `cowtail fix show`
|
|
108
|
+
- `cowtail fix delete`
|
|
109
|
+
- `cowtail roundup test`
|
|
110
|
+
- `cowtail health show`
|
|
111
|
+
- `cowtail realtime health`
|
|
112
|
+
- `cowtail push send`
|
|
113
|
+
- `cowtail push test`
|
|
114
|
+
- `cowtail users devices`
|
|
115
|
+
- `cowtail users list`
|
|
116
|
+
|
|
117
|
+
## Examples
|
|
118
|
+
```bash
|
|
119
|
+
cowtail version
|
|
120
|
+
|
|
121
|
+
cowtail update --check
|
|
122
|
+
|
|
123
|
+
cowtail config show
|
|
124
|
+
|
|
125
|
+
cowtail config validate
|
|
126
|
+
|
|
127
|
+
cowtail config doctor
|
|
128
|
+
|
|
129
|
+
cowtail roundup test \
|
|
130
|
+
--user-id '001612.bb9a2ce6d90341d880c8e6065c232aae.2317' \
|
|
131
|
+
--from 2026-04-14 \
|
|
132
|
+
--to 2026-04-14
|
|
133
|
+
|
|
134
|
+
cowtail health show
|
|
135
|
+
|
|
136
|
+
cowtail realtime health
|
|
137
|
+
|
|
138
|
+
cowtail users list
|
|
139
|
+
|
|
140
|
+
cowtail users devices --user-id 001612.bb9a2ce6d90341d880c8e6065c232aae.2317
|
|
141
|
+
|
|
142
|
+
cowtail alert list --severity critical
|
|
143
|
+
|
|
144
|
+
cowtail fix list --scope reactive
|
|
145
|
+
|
|
146
|
+
cowtail alert create \
|
|
147
|
+
--alertname KubePodCrashLooping \
|
|
148
|
+
--severity warning \
|
|
149
|
+
--namespace default \
|
|
150
|
+
--status firing \
|
|
151
|
+
--outcome fixed \
|
|
152
|
+
--summary 'Deployment was crashlooping due to missing secret' \
|
|
153
|
+
--action 'Patched secret reference and restarted deployment'
|
|
154
|
+
|
|
155
|
+
cowtail fix create \
|
|
156
|
+
--alert-id abc123 \
|
|
157
|
+
--description 'Patched RBAC and reconciled deployment' \
|
|
158
|
+
--root-cause 'Missing ClusterRole rule' \
|
|
159
|
+
--scope reactive
|
|
160
|
+
|
|
161
|
+
cowtail push test \
|
|
162
|
+
--user-id '001612.bb9a2ce6d90341d880c8e6065c232aae.2317'
|
|
163
|
+
```
|