xuanzhu 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/LICENSE +21 -0
- package/README.md +424 -0
- package/bin/xzh.js +3 -0
- package/dist/cli.js +5602 -0
- package/dist/cli.js.map +7 -0
- package/dist/skills/aws/SKILL.md +70 -0
- package/dist/skills/datadog/SKILL.md +261 -0
- package/dist/skills/elasticsearch/SKILL.md +88 -0
- package/dist/skills/elasticsearch/install.sh +91 -0
- package/dist/skills/email/SKILL.md +63 -0
- package/dist/skills/github/SKILL.md +69 -0
- package/dist/skills/gitlab/SKILL.md +68 -0
- package/dist/skills/gitlab/install.sh +74 -0
- package/dist/skills/gmail/README.md +139 -0
- package/dist/skills/gmail/SECURITY.md +552 -0
- package/dist/skills/gmail/SETUP.md +258 -0
- package/dist/skills/gmail/activate-gmail-cli.sh +15 -0
- package/dist/skills/gmail/generate-hashes.sh +82 -0
- package/dist/skills/gmail/gmail-cli-secure.py +599 -0
- package/dist/skills/gmail/install.sh +313 -0
- package/dist/skills/gmail/requirements.txt +38 -0
- package/dist/skills/gmail/skill.md +225 -0
- package/dist/skills/jira/SKILL.md +68 -0
- package/dist/skills/kubernetes/SKILL.md +70 -0
- package/dist/skills/linear/SKILL.md +48 -0
- package/dist/skills/mongodb/SKILL.md +53 -0
- package/dist/skills/mysql/SKILL.md +71 -0
- package/dist/skills/mysql/install.sh +74 -0
- package/dist/skills/officecli/SKILL.md +429 -0
- package/dist/skills/playwright/SKILL.md +171 -0
- package/dist/skills/postgres/SKILL.md +44 -0
- package/dist/skills/postgres/install.sh +73 -0
- package/dist/skills/redis/SKILL.md +58 -0
- package/dist/skills/redis/install.sh +39 -0
- package/dist/skills/sentry/SKILL.md +59 -0
- package/dist/skills/telegram/SKILL.md +151 -0
- package/package.json +46 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aws
|
|
3
|
+
description: Manage AWS resources via the aws CLI.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: AWS
|
|
6
|
+
icon: cloud
|
|
7
|
+
category: cloud
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: aws
|
|
11
|
+
checkCommand: aws --version
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
brew: awscli
|
|
15
|
+
scriptArch:
|
|
16
|
+
x64: curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && sudo installer -pkg AWSCLIV2.pkg -target /
|
|
17
|
+
arm64: curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" && sudo installer -pkg AWSCLIV2.pkg -target /
|
|
18
|
+
manual: Download installer from https://aws.amazon.com/cli/
|
|
19
|
+
linux:
|
|
20
|
+
scriptArch:
|
|
21
|
+
x64: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install
|
|
22
|
+
arm64: curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install
|
|
23
|
+
pip: awscli
|
|
24
|
+
windows:
|
|
25
|
+
winget: Amazon.AWSCLI
|
|
26
|
+
choco: awscli
|
|
27
|
+
scoop: aws
|
|
28
|
+
manual: Download MSI from https://aws.amazon.com/cli/
|
|
29
|
+
config:
|
|
30
|
+
- name: AWS_DEFAULT_REGION
|
|
31
|
+
label: Default Region
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
placeholder: us-east-1
|
|
35
|
+
- name: AWS_PROFILE
|
|
36
|
+
label: Profile
|
|
37
|
+
type: string
|
|
38
|
+
required: false
|
|
39
|
+
placeholder: default
|
|
40
|
+
auth:
|
|
41
|
+
type: api-key
|
|
42
|
+
setupCommand: aws configure
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
# AWS CLI
|
|
46
|
+
|
|
47
|
+
Use `aws` to interact with Amazon Web Services.
|
|
48
|
+
|
|
49
|
+
## Common Commands
|
|
50
|
+
|
|
51
|
+
### S3
|
|
52
|
+
|
|
53
|
+
- List buckets: `aws s3 ls`
|
|
54
|
+
- List objects: `aws s3 ls s3://<bucket-name>`
|
|
55
|
+
- Copy file: `aws s3 cp <source> <destination>`
|
|
56
|
+
|
|
57
|
+
### EC2
|
|
58
|
+
|
|
59
|
+
- List instances: `aws ec2 describe-instances`
|
|
60
|
+
- Start instance: `aws ec2 start-instances --instance-ids <id>`
|
|
61
|
+
- Stop instance: `aws ec2 stop-instances --instance-ids <id>`
|
|
62
|
+
|
|
63
|
+
### Lambda
|
|
64
|
+
|
|
65
|
+
- List functions: `aws lambda list-functions`
|
|
66
|
+
- Invoke function: `aws lambda invoke --function-name <name> output.json`
|
|
67
|
+
|
|
68
|
+
## Notes
|
|
69
|
+
|
|
70
|
+
- Requires `aws` CLI to be installed and configured (`aws configure`).
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: datadog
|
|
3
|
+
description: Query metrics, manage monitors, post events, and interact with Datadog via the dogshell CLI.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Datadog
|
|
6
|
+
icon: activity
|
|
7
|
+
category: monitoring
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: dog
|
|
11
|
+
checkCommand: dog --version
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
pip: datadog
|
|
15
|
+
linux:
|
|
16
|
+
pip: datadog
|
|
17
|
+
windows:
|
|
18
|
+
pip: datadog
|
|
19
|
+
config:
|
|
20
|
+
- name: DATADOG_API_KEY
|
|
21
|
+
label: API Key
|
|
22
|
+
type: secret
|
|
23
|
+
required: true
|
|
24
|
+
placeholder: Your Datadog API key
|
|
25
|
+
- name: DATADOG_APP_KEY
|
|
26
|
+
label: Application Key
|
|
27
|
+
type: secret
|
|
28
|
+
required: true
|
|
29
|
+
placeholder: Your Datadog Application key
|
|
30
|
+
- name: DATADOG_HOST
|
|
31
|
+
label: Datadog Host
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
placeholder: https://api.datadoghq.com
|
|
35
|
+
auth:
|
|
36
|
+
type: api-key
|
|
37
|
+
envVars:
|
|
38
|
+
- DATADOG_API_KEY
|
|
39
|
+
- DATADOG_APP_KEY
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# dogshell (Datadog CLI)
|
|
43
|
+
|
|
44
|
+
Use `dog` to interact with Datadog for metrics, monitors, events, dashboards, and more.
|
|
45
|
+
|
|
46
|
+
## Setup
|
|
47
|
+
|
|
48
|
+
Before using, set your Datadog API and Application keys:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export DATADOG_API_KEY="your_api_key"
|
|
52
|
+
export DATADOG_APP_KEY="your_app_key"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or create `~/.dogrc`:
|
|
56
|
+
|
|
57
|
+
```ini
|
|
58
|
+
[Connection]
|
|
59
|
+
apikey = your_api_key
|
|
60
|
+
appkey = your_app_key
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Secure the config file:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
chmod 600 ~/.dogrc
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Common Commands
|
|
70
|
+
|
|
71
|
+
### Query Metrics
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Query metric data (last hour)
|
|
75
|
+
dog metric query --query "avg:system.cpu.user{*}" --start $(date -v-1H +%s) --end $(date +%s)
|
|
76
|
+
|
|
77
|
+
# Query with specific host filter
|
|
78
|
+
dog metric query --query "avg:system.memory.used{host:myserver}" --start $(date -v-1H +%s) --end $(date +%s)
|
|
79
|
+
|
|
80
|
+
# Query multiple metrics
|
|
81
|
+
dog metric query --query "avg:system.cpu.user{*},avg:system.cpu.system{*}" --start $(date -v-1H +%s) --end $(date +%s)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Post Metrics
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Post a single metric
|
|
88
|
+
dog metric post my.custom.metric 42 --host myserver --tags env:prod,service:api
|
|
89
|
+
|
|
90
|
+
# Post metric with timestamp
|
|
91
|
+
dog metric post my.custom.metric 42 --timestamp $(date +%s)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Events
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Post an event
|
|
98
|
+
dog event post "Deployment Complete" "Deployed version 1.2.3 to production" --tags env:prod,service:api
|
|
99
|
+
|
|
100
|
+
# Post event with priority
|
|
101
|
+
dog event post "Alert" "High memory usage detected" --priority normal --alert_type warning
|
|
102
|
+
|
|
103
|
+
# Query events (last 24 hours)
|
|
104
|
+
dog event query --start $(date -v-1d +%s) --end $(date +%s)
|
|
105
|
+
|
|
106
|
+
# Query events with tags
|
|
107
|
+
dog event query --start $(date -v-1d +%s) --end $(date +%s) --tags env:prod
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Monitors
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# List all monitors
|
|
114
|
+
dog monitor list
|
|
115
|
+
|
|
116
|
+
# Get specific monitor
|
|
117
|
+
dog monitor show <monitor_id>
|
|
118
|
+
|
|
119
|
+
# Mute a monitor
|
|
120
|
+
dog monitor mute <monitor_id>
|
|
121
|
+
|
|
122
|
+
# Unmute a monitor
|
|
123
|
+
dog monitor unmute <monitor_id>
|
|
124
|
+
|
|
125
|
+
# Mute all monitors
|
|
126
|
+
dog monitor mute_all
|
|
127
|
+
|
|
128
|
+
# Create a metric monitor
|
|
129
|
+
dog monitor create "metric alert" "My Monitor" "avg(last_5m):avg:system.cpu.user{*} > 80" --message "CPU usage is high @slack-alerts"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Service Checks
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Post a service check
|
|
136
|
+
dog service_check post my.service.check 0 --host myserver --tags env:prod
|
|
137
|
+
# Status: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN
|
|
138
|
+
|
|
139
|
+
# Post check with message
|
|
140
|
+
dog service_check post my.health.check 0 --message "All systems operational"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Dashboards
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# List all dashboards
|
|
147
|
+
dog dashboard list
|
|
148
|
+
|
|
149
|
+
# Get dashboard details
|
|
150
|
+
dog dashboard show <dashboard_id>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Hosts
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Search hosts
|
|
157
|
+
dog host search --query "host:web*"
|
|
158
|
+
|
|
159
|
+
# Mute a host
|
|
160
|
+
dog host mute <hostname>
|
|
161
|
+
|
|
162
|
+
# Unmute a host
|
|
163
|
+
dog host unmute <hostname>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Tags
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# Get tags for a host
|
|
170
|
+
dog tag show <hostname>
|
|
171
|
+
|
|
172
|
+
# Add tags to a host
|
|
173
|
+
dog tag add <hostname> env:prod role:web
|
|
174
|
+
|
|
175
|
+
# Update tags for a host (replaces existing)
|
|
176
|
+
dog tag update <hostname> env:staging role:api
|
|
177
|
+
|
|
178
|
+
# Remove all tags from a host
|
|
179
|
+
dog tag detach <hostname>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Downtimes
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Schedule a downtime
|
|
186
|
+
dog downtime schedule --scope "host:myserver" --start $(date +%s) --end $(date -v+1H +%s) --message "Maintenance window"
|
|
187
|
+
|
|
188
|
+
# List active downtimes
|
|
189
|
+
dog downtime list
|
|
190
|
+
|
|
191
|
+
# Cancel a downtime
|
|
192
|
+
dog downtime cancel <downtime_id>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Environment Variables
|
|
196
|
+
|
|
197
|
+
| Variable | Description |
|
|
198
|
+
| ----------------- | --------------------------------------------------- |
|
|
199
|
+
| `DATADOG_API_KEY` | Your Datadog API key |
|
|
200
|
+
| `DATADOG_APP_KEY` | Your Datadog Application key |
|
|
201
|
+
| `DATADOG_HOST` | API endpoint (default: `https://api.datadoghq.com`) |
|
|
202
|
+
|
|
203
|
+
For EU region, set:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
export DATADOG_HOST="https://api.datadoghq.eu"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Security Notes
|
|
210
|
+
|
|
211
|
+
- Never commit API keys to version control
|
|
212
|
+
- Use Application keys with minimal required permissions
|
|
213
|
+
- Store credentials in `~/.dogrc` with `chmod 600`
|
|
214
|
+
- Rotate keys periodically
|
|
215
|
+
- Use separate keys for different environments
|
|
216
|
+
|
|
217
|
+
## Useful Queries
|
|
218
|
+
|
|
219
|
+
### System Metrics
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# CPU usage
|
|
223
|
+
dog metric query --query "avg:system.cpu.user{*} by {host}"
|
|
224
|
+
|
|
225
|
+
# Memory usage
|
|
226
|
+
dog metric query --query "avg:system.mem.used{*}/avg:system.mem.total{*}*100"
|
|
227
|
+
|
|
228
|
+
# Disk usage
|
|
229
|
+
dog metric query --query "avg:system.disk.in_use{*} by {device}"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Application Metrics
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Request rate
|
|
236
|
+
dog metric query --query "sum:trace.http.request.hits{service:my-app}.as_rate()"
|
|
237
|
+
|
|
238
|
+
# Error rate
|
|
239
|
+
dog metric query --query "sum:trace.http.request.errors{service:my-app}/sum:trace.http.request.hits{service:my-app}*100"
|
|
240
|
+
|
|
241
|
+
# Latency (p95)
|
|
242
|
+
dog metric query --query "p95:trace.http.request.duration{service:my-app}"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Alternative: datadog-ci
|
|
246
|
+
|
|
247
|
+
For CI/CD operations, use `datadog-ci`:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Install
|
|
251
|
+
npm install -g @datadog/datadog-ci
|
|
252
|
+
|
|
253
|
+
# Upload sourcemaps
|
|
254
|
+
datadog-ci sourcemaps upload ./dist --service my-app --release-version 1.0.0
|
|
255
|
+
|
|
256
|
+
# Upload test results
|
|
257
|
+
datadog-ci junit upload --service my-app ./test-results/*.xml
|
|
258
|
+
|
|
259
|
+
# Trigger Synthetic tests
|
|
260
|
+
datadog-ci synthetics run-tests --public-id abc-123
|
|
261
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: elasticsearch
|
|
3
|
+
description: Interact with Elasticsearch clusters via the API.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Elasticsearch
|
|
6
|
+
icon: search
|
|
7
|
+
category: databases
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: curl
|
|
11
|
+
checkCommand: curl --version
|
|
12
|
+
bundledInstall: skills/elasticsearch/install.sh
|
|
13
|
+
install:
|
|
14
|
+
darwin:
|
|
15
|
+
brew: curl
|
|
16
|
+
linux:
|
|
17
|
+
apt: curl
|
|
18
|
+
dnf: curl
|
|
19
|
+
windows:
|
|
20
|
+
scoop: curl
|
|
21
|
+
choco: curl
|
|
22
|
+
config:
|
|
23
|
+
- name: ES_URL
|
|
24
|
+
label: Base URL
|
|
25
|
+
type: string
|
|
26
|
+
required: false
|
|
27
|
+
placeholder: http://localhost:9200
|
|
28
|
+
auth:
|
|
29
|
+
type: api-key
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# Elasticsearch
|
|
33
|
+
|
|
34
|
+
Use the provided `es-cli` wrapper or direct REST API calls to manage indexes and search data.
|
|
35
|
+
|
|
36
|
+
## CLI Usage (Recommended)
|
|
37
|
+
|
|
38
|
+
An `es-cli` wrapper is available in `.codebuddy/bin`.
|
|
39
|
+
|
|
40
|
+
Base URL default: `http://localhost:9200` (Override with ES_URL env var)
|
|
41
|
+
|
|
42
|
+
### Examples
|
|
43
|
+
|
|
44
|
+
- Check Health: `es-cli GET /_cluster/health`
|
|
45
|
+
- List Indexes: `es-cli GET /_cat/indices`
|
|
46
|
+
- Search: `es-cli GET /my-index/_search`
|
|
47
|
+
|
|
48
|
+
## Manual Connection
|
|
49
|
+
|
|
50
|
+
Typically accessed via `curl`.
|
|
51
|
+
Base URL: `http://localhost:9200` (or your cluster URL)
|
|
52
|
+
|
|
53
|
+
## Common Commands
|
|
54
|
+
|
|
55
|
+
### Cluster Health
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
curl -X GET "localhost:9200/_cluster/health?pretty"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### List Indexes
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
curl -X GET "localhost:9200/_cat/indices?v"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Search
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
curl -X GET "localhost:9200/<index>/_search?q=*&pretty"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Create Index
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
curl -X PUT "localhost:9200/<index>"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Delete Index
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
curl -X DELETE "localhost:9200/<index>"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Setup
|
|
86
|
+
|
|
87
|
+
Ensure you have access to the Elasticsearch cluster and `curl` installed.
|
|
88
|
+
For authenticated clusters, use `-u username:password` or Authorization headers.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Elasticsearch Helpers Installation Script
|
|
5
|
+
# Installs 'jq' for JSON processing and creates an 'es-cli' wrapper.
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
9
|
+
BIN_DIR="$PROJECT_ROOT/.codebuddy/bin"
|
|
10
|
+
TEMP_DIR=$(mktemp -d)
|
|
11
|
+
mkdir -p "$BIN_DIR"
|
|
12
|
+
|
|
13
|
+
# 1. Install jq (Essential for reading ES output)
|
|
14
|
+
echo "🔍 Checking for jq..."
|
|
15
|
+
if [ ! -f "$BIN_DIR/jq" ]; then
|
|
16
|
+
echo "⬇️ Downloading jq..."
|
|
17
|
+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
18
|
+
ARCH=$(uname -m)
|
|
19
|
+
|
|
20
|
+
case "$OS" in
|
|
21
|
+
darwin)
|
|
22
|
+
case "$ARCH" in
|
|
23
|
+
arm64) JQ_URL="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-arm64" ;;
|
|
24
|
+
*) JQ_URL="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-macos-amd64" ;;
|
|
25
|
+
esac
|
|
26
|
+
;;
|
|
27
|
+
linux)
|
|
28
|
+
case "$ARCH" in
|
|
29
|
+
aarch64|arm64) JQ_URL="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-arm64" ;;
|
|
30
|
+
*) JQ_URL="https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64" ;;
|
|
31
|
+
esac
|
|
32
|
+
;;
|
|
33
|
+
*)
|
|
34
|
+
echo "❌ Unsupported OS: $OS — please install jq manually"
|
|
35
|
+
exit 1
|
|
36
|
+
;;
|
|
37
|
+
esac
|
|
38
|
+
|
|
39
|
+
curl -L -o "$BIN_DIR/jq" "$JQ_URL"
|
|
40
|
+
chmod +x "$BIN_DIR/jq"
|
|
41
|
+
echo "✅ jq installed to $BIN_DIR/jq"
|
|
42
|
+
else
|
|
43
|
+
echo "✅ jq already installed."
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# 2. Create es-cli wrapper
|
|
47
|
+
echo "🔗 Creating es-cli wrapper..."
|
|
48
|
+
ES_CLI_PATH="$BIN_DIR/es-cli"
|
|
49
|
+
|
|
50
|
+
cat > "$ES_CLI_PATH" <<EOF
|
|
51
|
+
#!/bin/bash
|
|
52
|
+
# Simple wrapper for Elasticsearch curl requests with pretty printing
|
|
53
|
+
# Usage: es-cli [method] [path] [data]
|
|
54
|
+
|
|
55
|
+
BASE_URL="\${ES_URL:-http://localhost:9200}"
|
|
56
|
+
BIN_DIR="\$(dirname "\$0")"
|
|
57
|
+
JQ="\$BIN_DIR/jq"
|
|
58
|
+
|
|
59
|
+
# Default to GET if first arg is a path (starts with /)
|
|
60
|
+
METHOD="GET"
|
|
61
|
+
PATH_ARG=""
|
|
62
|
+
DATA=""
|
|
63
|
+
|
|
64
|
+
if [[ "\$1" =~ ^[A-Z]+$ ]]; then
|
|
65
|
+
METHOD="\$1"
|
|
66
|
+
PATH_ARG="\$2"
|
|
67
|
+
DATA="\$3"
|
|
68
|
+
else
|
|
69
|
+
PATH_ARG="\$1"
|
|
70
|
+
DATA="\$2"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Strip leading slash for cleanliness with base url
|
|
74
|
+
# (Though curl usually handles double slash fine)
|
|
75
|
+
|
|
76
|
+
FULL_URL="\${BASE_URL}\${PATH_ARG}"
|
|
77
|
+
|
|
78
|
+
echo "📡 \$METHOD \$FULL_URL" >&2
|
|
79
|
+
|
|
80
|
+
if [ -n "\$DATA" ]; then
|
|
81
|
+
curl -s -X "\$METHOD" -H "Content-Type: application/json" -d "\$DATA" "\$FULL_URL" | "\$JQ" '.'
|
|
82
|
+
else
|
|
83
|
+
curl -s -X "\$METHOD" -H "Content-Type: application/json" "\$FULL_URL" | "\$JQ" '.'
|
|
84
|
+
fi
|
|
85
|
+
EOF
|
|
86
|
+
|
|
87
|
+
chmod +x "$ES_CLI_PATH"
|
|
88
|
+
echo "✅ es-cli wrapper created at $BIN_DIR/es-cli"
|
|
89
|
+
|
|
90
|
+
# Cleanup
|
|
91
|
+
rm -rf "$TEMP_DIR"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: email
|
|
3
|
+
description: Send emails using mailsend-go CLI
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Email (SMTP)
|
|
6
|
+
icon: mail
|
|
7
|
+
category: communication
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: mailsend
|
|
11
|
+
checkCommand: mailsend -V
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
brew: mailsend-go
|
|
15
|
+
go: github.com/muquit/mailsend-go@latest
|
|
16
|
+
linux:
|
|
17
|
+
go: github.com/muquit/mailsend-go@latest
|
|
18
|
+
windows:
|
|
19
|
+
go: github.com/muquit/mailsend-go@latest
|
|
20
|
+
config:
|
|
21
|
+
- name: SMTP_HOST
|
|
22
|
+
label: SMTP Host
|
|
23
|
+
type: string
|
|
24
|
+
required: false
|
|
25
|
+
placeholder: smtp.gmail.com
|
|
26
|
+
- name: SMTP_PORT
|
|
27
|
+
label: SMTP Port
|
|
28
|
+
type: string
|
|
29
|
+
required: false
|
|
30
|
+
placeholder: "587"
|
|
31
|
+
auth:
|
|
32
|
+
type: basic
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Email Skill
|
|
36
|
+
|
|
37
|
+
This skill allows sending emails via SMTP using the `mailsend` tool (mailsend-go).
|
|
38
|
+
|
|
39
|
+
## Prerequisites
|
|
40
|
+
|
|
41
|
+
- `mailsend` binary must be in `.codebuddy/bin/mailsend`
|
|
42
|
+
- SMTP credentials (host, port, user, password)
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Use `./.codebuddy/bin/mailsend` to send emails.
|
|
47
|
+
|
|
48
|
+
### Send a simple email
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
./.codebuddy/bin/mailsend -smtp <smtp_host> -port <smtp_port> -auth -user <username> -pass <password> -from <sender_email> -to <recipient_email> -sub "Subject" -body "Body text"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Send with SSL/TLS (Gmail example)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
./.codebuddy/bin/mailsend -smtp smtp.gmail.com -port 587 -starttls -auth -user <username> -pass <password> -from <sender_email> -to <recipient_email> -sub "Subject" -body "Body text"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Notes
|
|
61
|
+
|
|
62
|
+
- For Gmail, use App Passwords if 2FA is enabled.
|
|
63
|
+
- Always ask the user for SMTP credentials before sending if not provided.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: github
|
|
3
|
+
description: Manage GitHub repositories, issues, and pull requests via the gh CLI.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: GitHub
|
|
6
|
+
icon: github
|
|
7
|
+
category: version-control
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: gh
|
|
11
|
+
checkCommand: gh --version
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
brew: gh
|
|
15
|
+
scriptArch:
|
|
16
|
+
x64: curl -fsSL https://github.com/cli/cli/releases/latest/download/gh_*_macOS_amd64.tar.gz | tar xz && sudo mv gh_*/bin/gh /usr/local/bin/
|
|
17
|
+
arm64: curl -fsSL https://github.com/cli/cli/releases/latest/download/gh_*_macOS_arm64.tar.gz | tar xz && sudo mv gh_*/bin/gh /usr/local/bin/
|
|
18
|
+
manual: Download from https://github.com/cli/cli/releases and add to PATH
|
|
19
|
+
linux:
|
|
20
|
+
apt: gh
|
|
21
|
+
script: |
|
|
22
|
+
type -p curl >/dev/null || sudo apt install curl -y
|
|
23
|
+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
24
|
+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
|
25
|
+
sudo apt update && sudo apt install gh -y
|
|
26
|
+
windows:
|
|
27
|
+
winget: GitHub.cli
|
|
28
|
+
scoop: gh
|
|
29
|
+
auth:
|
|
30
|
+
type: oauth
|
|
31
|
+
setupCommand: gh auth login
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
# gh (GitHub CLI)
|
|
35
|
+
|
|
36
|
+
Use `./.codebuddy/bin/gh` to interact with GitHub.
|
|
37
|
+
This tool allows you to manage PRs, issues, and repositories directly from the chat.
|
|
38
|
+
|
|
39
|
+
## Setup
|
|
40
|
+
|
|
41
|
+
Before using, you must authenticate. Run the following command in the terminal:
|
|
42
|
+
`./.codebuddy/bin/gh auth login`
|
|
43
|
+
|
|
44
|
+
## Common Commands
|
|
45
|
+
|
|
46
|
+
### Pull Requests
|
|
47
|
+
|
|
48
|
+
- List PRs: `./.codebuddy/bin/gh pr list`
|
|
49
|
+
- View PR: `./.codebuddy/bin/gh pr view <PR-NUMBER>`
|
|
50
|
+
- Checkout PR: `./.codebuddy/bin/gh pr checkout <PR-NUMBER>`
|
|
51
|
+
- Create PR: `./.codebuddy/bin/gh pr create`
|
|
52
|
+
- Review PR: `./.codebuddy/bin/gh pr review <PR-NUMBER>`
|
|
53
|
+
- Merge PR: `./.codebuddy/bin/gh pr merge <PR-NUMBER>`
|
|
54
|
+
|
|
55
|
+
### Issues
|
|
56
|
+
|
|
57
|
+
- List issues: `./.codebuddy/bin/gh issue list`
|
|
58
|
+
- View issue: `./.codebuddy/bin/gh issue view <ISSUE-NUMBER>`
|
|
59
|
+
- Create issue: `./.codebuddy/bin/gh issue create`
|
|
60
|
+
|
|
61
|
+
### Repositories
|
|
62
|
+
|
|
63
|
+
- View repo info: `./.codebuddy/bin/gh repo view`
|
|
64
|
+
- Clone repo: `./.codebuddy/bin/gh repo clone <OWNER>/<REPO>`
|
|
65
|
+
|
|
66
|
+
## Notes
|
|
67
|
+
|
|
68
|
+
- Ensure you have a GitHub account and permissions for the repositories you want to access.
|
|
69
|
+
- Authentication token is stored securely by `gh`.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab
|
|
3
|
+
description: Manage GitLab issues and merge requests via the glab CLI.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: GitLab
|
|
6
|
+
icon: git-merge
|
|
7
|
+
category: version-control
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: glab
|
|
11
|
+
checkCommand: glab --version
|
|
12
|
+
bundledInstall: skills/gitlab/install.sh
|
|
13
|
+
install:
|
|
14
|
+
darwin:
|
|
15
|
+
brew: glab
|
|
16
|
+
scriptArch:
|
|
17
|
+
x64: curl -fsSL https://gitlab.com/gitlab-org/cli/-/releases/permalink/latest/downloads/glab_*_macOS_x86_64.tar.gz | tar xz && sudo mv bin/glab /usr/local/bin/
|
|
18
|
+
arm64: curl -fsSL https://gitlab.com/gitlab-org/cli/-/releases/permalink/latest/downloads/glab_*_macOS_arm64.tar.gz | tar xz && sudo mv bin/glab /usr/local/bin/
|
|
19
|
+
manual: Download from https://gitlab.com/gitlab-org/cli/-/releases
|
|
20
|
+
linux:
|
|
21
|
+
apt: glab
|
|
22
|
+
dnf: glab
|
|
23
|
+
snap: glab
|
|
24
|
+
script: curl -fsSL https://gitlab.com/gitlab-org/cli/-/releases/permalink/latest/downloads/glab_*_Linux_x86_64.tar.gz | tar xz && sudo mv bin/glab /usr/local/bin/
|
|
25
|
+
windows:
|
|
26
|
+
scoop: glab
|
|
27
|
+
choco: glab
|
|
28
|
+
winget: GLab.GLab
|
|
29
|
+
config:
|
|
30
|
+
- name: GITLAB_HOST
|
|
31
|
+
label: GitLab Host
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
placeholder: https://gitlab.com
|
|
35
|
+
auth:
|
|
36
|
+
type: oauth
|
|
37
|
+
setupCommand: glab auth login
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# glab
|
|
41
|
+
|
|
42
|
+
Use `glab` to interact with GitLab.
|
|
43
|
+
This tool allows you to view, create, and update GitLab issues and merge requests.
|
|
44
|
+
|
|
45
|
+
## Setup
|
|
46
|
+
|
|
47
|
+
Ensure `glab` is installed and authenticated.
|
|
48
|
+
If using the bundled version, run:
|
|
49
|
+
`./.codebuddy/bin/glab auth login`
|
|
50
|
+
|
|
51
|
+
## Common Commands
|
|
52
|
+
|
|
53
|
+
### Issues
|
|
54
|
+
|
|
55
|
+
- List issues: `glab issue list`
|
|
56
|
+
- View issue: `glab issue view <ID>`
|
|
57
|
+
- Create issue: `glab issue create`
|
|
58
|
+
- Assign: `glab issue update <ID> --assignee <USER>`
|
|
59
|
+
|
|
60
|
+
### Merge Requests
|
|
61
|
+
|
|
62
|
+
- List MRs: `glab mr list`
|
|
63
|
+
- Create MR: `glab mr create`
|
|
64
|
+
- View MR: `glab mr view <ID>`
|
|
65
|
+
|
|
66
|
+
## Notes
|
|
67
|
+
|
|
68
|
+
- Requires a GitLab personal access token.
|