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,73 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# PostgreSQL Installation Script
|
|
5
|
+
# Installs psql client from EnterpriseDB (Official Installer provider) binaries
|
|
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
|
+
LIB_DIR="$PROJECT_ROOT/.codebuddy/lib/postgres"
|
|
11
|
+
TEMP_DIR=$(mktemp -d)
|
|
12
|
+
|
|
13
|
+
# EDB binaries version
|
|
14
|
+
# Note: Changing versions might break if URL schema changes
|
|
15
|
+
# Using a known stable URL for macOS (checking architecture)
|
|
16
|
+
ARCH=$(uname -m)
|
|
17
|
+
OS=$(uname -s)
|
|
18
|
+
|
|
19
|
+
if [ "$OS" != "Darwin" ]; then
|
|
20
|
+
echo "❌ This script currently supports macOS only."
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Fallback to brew if available?
|
|
25
|
+
if command -v brew >/dev/null 2>&1; then
|
|
26
|
+
echo "🍺 Homebrew detected. Preferring 'brew install libpq' for stability..."
|
|
27
|
+
echo " Running: brew install libpq"
|
|
28
|
+
brew install libpq
|
|
29
|
+
|
|
30
|
+
# Symlink to bin
|
|
31
|
+
BREW_PREFIX=$(brew --prefix)
|
|
32
|
+
mkdir -p "$BIN_DIR"
|
|
33
|
+
ln -sf "$BREW_PREFIX/opt/libpq/bin/psql" "$BIN_DIR/psql"
|
|
34
|
+
ln -sf "$BREW_PREFIX/opt/libpq/bin/pg_dump" "$BIN_DIR/pg_dump"
|
|
35
|
+
ln -sf "$BREW_PREFIX/opt/libpq/bin/pg_restore" "$BIN_DIR/pg_restore"
|
|
36
|
+
|
|
37
|
+
echo "✅ Postgres binaries linked from Homebrew to $BIN_DIR"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Manual Install Process (Fallback)
|
|
42
|
+
echo "⬇️ Downloading PostgreSQL binaries from EnterpriseDB..."
|
|
43
|
+
# Warning: EDB links often expire or change.
|
|
44
|
+
# Using a specific version 15.3 which is commonly available.
|
|
45
|
+
DOWNLOAD_URL="https://get.enterprisedb.com/postgresql/postgresql-15.3-1-osx-binaries.zip"
|
|
46
|
+
|
|
47
|
+
cd "$TEMP_DIR"
|
|
48
|
+
curl -L -o postgres.zip "$DOWNLOAD_URL"
|
|
49
|
+
|
|
50
|
+
echo "📦 Extracting..."
|
|
51
|
+
unzip -q postgres.zip
|
|
52
|
+
|
|
53
|
+
echo "📂 Installing to $LIB_DIR..."
|
|
54
|
+
mkdir -p "$LIB_DIR"
|
|
55
|
+
# Copy contents
|
|
56
|
+
cp -r pgsql/* "$LIB_DIR/"
|
|
57
|
+
|
|
58
|
+
echo "🔗 Creating wrappers in $BIN_DIR..."
|
|
59
|
+
mkdir -p "$BIN_DIR"
|
|
60
|
+
|
|
61
|
+
# Create a wrapper script to handle dynamic libraries if needed
|
|
62
|
+
cat > "$BIN_DIR/psql" <<EOF
|
|
63
|
+
#!/bin/bash
|
|
64
|
+
export DYLD_LIBRARY_PATH="$LIB_DIR/lib:\$DYLD_LIBRARY_PATH"
|
|
65
|
+
exec "$LIB_DIR/bin/psql" "\$@"
|
|
66
|
+
EOF
|
|
67
|
+
chmod +x "$BIN_DIR/psql"
|
|
68
|
+
|
|
69
|
+
echo "✅ psql installed successfully (Standalone)!"
|
|
70
|
+
"$BIN_DIR/psql" --version
|
|
71
|
+
|
|
72
|
+
# Cleanup
|
|
73
|
+
rm -rf "$TEMP_DIR"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: redis
|
|
3
|
+
description: Manage Redis databases via the redis-cli tool.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Redis
|
|
6
|
+
icon: database
|
|
7
|
+
category: databases
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: redis-cli
|
|
11
|
+
checkCommand: redis-cli --version
|
|
12
|
+
bundledInstall: skills/redis/install.sh
|
|
13
|
+
install:
|
|
14
|
+
darwin:
|
|
15
|
+
brew: redis
|
|
16
|
+
linux:
|
|
17
|
+
apt: redis-tools
|
|
18
|
+
dnf: redis
|
|
19
|
+
windows:
|
|
20
|
+
choco: redis-64
|
|
21
|
+
scoop: redis
|
|
22
|
+
config:
|
|
23
|
+
- name: REDIS_HOST
|
|
24
|
+
label: Host
|
|
25
|
+
type: string
|
|
26
|
+
required: false
|
|
27
|
+
placeholder: localhost
|
|
28
|
+
- name: REDIS_PORT
|
|
29
|
+
label: Port
|
|
30
|
+
type: string
|
|
31
|
+
required: false
|
|
32
|
+
placeholder: "6379"
|
|
33
|
+
auth:
|
|
34
|
+
type: basic
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# redis-cli
|
|
38
|
+
|
|
39
|
+
Use `redis-cli` to interact with Redis instances.
|
|
40
|
+
|
|
41
|
+
## Common Commands
|
|
42
|
+
|
|
43
|
+
### Connection
|
|
44
|
+
|
|
45
|
+
- Connect: `redis-cli -h <host> -p <port> -a <password>`
|
|
46
|
+
|
|
47
|
+
### Operations
|
|
48
|
+
|
|
49
|
+
- Set key: `SET key value`
|
|
50
|
+
- Get key: `GET key`
|
|
51
|
+
- List keys: `KEYS pattern`
|
|
52
|
+
- Delete key: `DEL key`
|
|
53
|
+
- Check info: `INFO`
|
|
54
|
+
- Quit: `exit`
|
|
55
|
+
|
|
56
|
+
## Notes
|
|
57
|
+
|
|
58
|
+
- Requires `redis-cli` to be installed in the environment.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Redis Installation Script
|
|
5
|
+
# Downloads source from official redis.io, builds redis-cli, and installs to .codebuddy/bin
|
|
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
|
+
|
|
12
|
+
REDIS_VERSION="stable"
|
|
13
|
+
DOWNLOAD_URL="https://download.redis.io/redis-${REDIS_VERSION}.tar.gz"
|
|
14
|
+
|
|
15
|
+
echo "Using temp directory: $TEMP_DIR"
|
|
16
|
+
cd "$TEMP_DIR"
|
|
17
|
+
|
|
18
|
+
echo "📥 Downloading Redis ($REDIS_VERSION)..."
|
|
19
|
+
curl -fsSL "$DOWNLOAD_URL" -o redis.tar.gz
|
|
20
|
+
|
|
21
|
+
echo "📦 Extracting..."
|
|
22
|
+
tar xzf redis.tar.gz
|
|
23
|
+
cd redis-*
|
|
24
|
+
|
|
25
|
+
echo "🔨 Building redis-cli (this may take a moment)..."
|
|
26
|
+
# Build only redis-cli to save time
|
|
27
|
+
make redis-cli
|
|
28
|
+
|
|
29
|
+
echo "📂 Installing to $BIN_DIR..."
|
|
30
|
+
mkdir -p "$BIN_DIR"
|
|
31
|
+
cp src/redis-cli "$BIN_DIR/"
|
|
32
|
+
chmod +x "$BIN_DIR/redis-cli"
|
|
33
|
+
|
|
34
|
+
# Cleanup
|
|
35
|
+
cd "$PROJECT_ROOT"
|
|
36
|
+
rm -rf "$TEMP_DIR"
|
|
37
|
+
|
|
38
|
+
echo "✅ Redis CLI installed successfully!"
|
|
39
|
+
"$BIN_DIR/redis-cli" --version
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sentry
|
|
3
|
+
description: Manage Sentry projects and releases via the sentry-cli.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Sentry
|
|
6
|
+
icon: alert-circle
|
|
7
|
+
category: monitoring
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: sentry-cli
|
|
11
|
+
checkCommand: sentry-cli --version
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
brew: getsentry/tools/sentry-cli
|
|
15
|
+
script: curl -sL https://sentry.io/get-cli/ | bash
|
|
16
|
+
linux:
|
|
17
|
+
script: curl -sL https://sentry.io/get-cli/ | bash
|
|
18
|
+
windows:
|
|
19
|
+
scoop: sentry-cli
|
|
20
|
+
npm: "@sentry/cli"
|
|
21
|
+
config:
|
|
22
|
+
- name: SENTRY_ORG
|
|
23
|
+
label: Organization
|
|
24
|
+
type: string
|
|
25
|
+
required: true
|
|
26
|
+
placeholder: your-org-slug
|
|
27
|
+
- name: SENTRY_PROJECT
|
|
28
|
+
label: Project
|
|
29
|
+
type: string
|
|
30
|
+
required: true
|
|
31
|
+
placeholder: your-project-slug
|
|
32
|
+
- name: SENTRY_AUTH_TOKEN
|
|
33
|
+
label: Auth Token
|
|
34
|
+
type: secret
|
|
35
|
+
required: true
|
|
36
|
+
auth:
|
|
37
|
+
type: api-key
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# sentry-cli
|
|
41
|
+
|
|
42
|
+
Use `sentry-cli` to interact with Sentry.
|
|
43
|
+
|
|
44
|
+
## Common Commands
|
|
45
|
+
|
|
46
|
+
### Releases
|
|
47
|
+
|
|
48
|
+
- List releases: `sentry-cli releases list`
|
|
49
|
+
- New release: `sentry-cli releases new <version>`
|
|
50
|
+
- Finalize release: `sentry-cli releases finalize <version>`
|
|
51
|
+
|
|
52
|
+
### Issues
|
|
53
|
+
|
|
54
|
+
- List issues: `sentry-cli issues list`
|
|
55
|
+
|
|
56
|
+
## Notes
|
|
57
|
+
|
|
58
|
+
- Requires `sentry-cli` to be installed.
|
|
59
|
+
- Requires `SENTRY_AUTH_TOKEN` and `SENTRY_ORG` environment variables or configuration.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telegram
|
|
3
|
+
description: Send Telegram messages, files, and interact with Telegram bots via the telegram-send CLI tool.
|
|
4
|
+
metadata:
|
|
5
|
+
displayName: Telegram
|
|
6
|
+
icon: send
|
|
7
|
+
category: communication
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
dependencies:
|
|
10
|
+
cli: telegram-send
|
|
11
|
+
checkCommand: telegram-send --version
|
|
12
|
+
install:
|
|
13
|
+
darwin:
|
|
14
|
+
pip: telegram-send
|
|
15
|
+
linux:
|
|
16
|
+
pip: telegram-send
|
|
17
|
+
windows:
|
|
18
|
+
pip: telegram-send
|
|
19
|
+
config:
|
|
20
|
+
- name: TELEGRAM_CONFIG
|
|
21
|
+
label: Config Path
|
|
22
|
+
type: string
|
|
23
|
+
required: false
|
|
24
|
+
placeholder: ~/.config/telegram-send.conf
|
|
25
|
+
auth:
|
|
26
|
+
type: bot-token
|
|
27
|
+
setupCommand: telegram-send --configure
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# telegram-send
|
|
31
|
+
|
|
32
|
+
Use `telegram-send` to send messages, files, and media to Telegram chats.
|
|
33
|
+
This tool requires initial configuration with a Telegram bot token.
|
|
34
|
+
|
|
35
|
+
## Setup
|
|
36
|
+
|
|
37
|
+
Before using, configure telegram-send with your bot token:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
telegram-send --configure
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This will prompt you to:
|
|
44
|
+
|
|
45
|
+
1. Create a bot via [@BotFather](https://t.me/botfather) on Telegram
|
|
46
|
+
2. Enter the bot token
|
|
47
|
+
3. Send `/start` to your bot to enable messaging
|
|
48
|
+
|
|
49
|
+
For group chats, use `--configure-group` instead:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
telegram-send --configure-group
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common Commands
|
|
56
|
+
|
|
57
|
+
### Send Text Message
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
telegram-send "Hello from CodeBuddy!"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Send with Formatting
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Markdown formatting
|
|
67
|
+
telegram-send --format markdown "**Bold** and _italic_ text"
|
|
68
|
+
|
|
69
|
+
# HTML formatting
|
|
70
|
+
telegram-send --format html "<b>Bold</b> and <i>italic</i> text"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Send Files
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Send a document
|
|
77
|
+
telegram-send --file /path/to/document.pdf
|
|
78
|
+
|
|
79
|
+
# Send with caption
|
|
80
|
+
telegram-send --file /path/to/document.pdf --caption "Here's the report"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Send Images
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Send image
|
|
87
|
+
telegram-send --image /path/to/image.png
|
|
88
|
+
|
|
89
|
+
# Send image with caption
|
|
90
|
+
telegram-send --image /path/to/screenshot.png --caption "Screenshot attached"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Send to Specific Config (Multiple Bots/Chats)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Use a specific config file
|
|
97
|
+
telegram-send --config /path/to/custom.conf "Message to specific chat"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Send Code Blocks
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Send pre-formatted code
|
|
104
|
+
telegram-send --format markdown "\`\`\`python
|
|
105
|
+
def hello():
|
|
106
|
+
print('Hello, World!')
|
|
107
|
+
\`\`\`"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Silent Messages (No Notification)
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
telegram-send --silent "This won't trigger a notification"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Send Location
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
telegram-send --location 37.7749 -122.4194
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Configuration Files
|
|
123
|
+
|
|
124
|
+
Default config location: `~/.config/telegram-send.conf`
|
|
125
|
+
|
|
126
|
+
You can have multiple configs for different bots/chats:
|
|
127
|
+
|
|
128
|
+
- `~/.config/telegram-send.conf` - default
|
|
129
|
+
- `~/.config/telegram-send-group.conf` - for group chats
|
|
130
|
+
- Custom paths with `--config`
|
|
131
|
+
|
|
132
|
+
## Security Notes
|
|
133
|
+
|
|
134
|
+
- Bot tokens are stored in the config file - ensure proper file permissions
|
|
135
|
+
- Run `chmod 600 ~/.config/telegram-send.conf` to secure credentials
|
|
136
|
+
- Never commit config files to version control
|
|
137
|
+
- Use separate bots for different purposes (personal, work, etc.)
|
|
138
|
+
|
|
139
|
+
## Error Handling
|
|
140
|
+
|
|
141
|
+
If you get "Unauthorized" errors:
|
|
142
|
+
|
|
143
|
+
1. Verify your bot token with @BotFather
|
|
144
|
+
2. Ensure you've sent `/start` to the bot
|
|
145
|
+
3. Re-run `telegram-send --configure`
|
|
146
|
+
|
|
147
|
+
## Limitations
|
|
148
|
+
|
|
149
|
+
- Can only send to users/groups that have started the bot
|
|
150
|
+
- Rate limits apply (avoid spamming)
|
|
151
|
+
- File size limits: 50MB for documents, 10MB for photos
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "xuanzhu",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "玄猪(XuanZhu)— 专为终端打造的 AI 编码 Agent",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"agent",
|
|
8
|
+
"terminal",
|
|
9
|
+
"tui",
|
|
10
|
+
"cli",
|
|
11
|
+
"coding-assistant"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "amble311",
|
|
15
|
+
"main": "./dist/cli.js",
|
|
16
|
+
"bin": {
|
|
17
|
+
"xzh": "bin/xzh.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "node esbuild.js",
|
|
30
|
+
"dev": "node esbuild.js --watch",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"start": "node bin/xzh.js",
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"prepare": "node esbuild.js"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@anthropic-ai/sdk": "^0.52.0",
|
|
38
|
+
"@google/generative-ai": "^0.21.0",
|
|
39
|
+
"openai": "^4.28.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.2.5",
|
|
43
|
+
"esbuild": "^0.25.8",
|
|
44
|
+
"typescript": "^5.4.3"
|
|
45
|
+
}
|
|
46
|
+
}
|