@hummingbot/skills 1.0.0 → 1.0.5

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.
Files changed (40) hide show
  1. package/README.md +15 -14
  2. package/package.json +5 -1
  3. package/skills/candles-feed/SKILL.md +2 -1
  4. package/skills/candles-feed/scripts/calculate_indicator.sh +2 -0
  5. package/skills/candles-feed/scripts/get_candles.sh +2 -0
  6. package/skills/candles-feed/scripts/get_funding_rate.sh +2 -0
  7. package/skills/candles-feed/scripts/get_price.sh +2 -0
  8. package/skills/candles-feed/scripts/list_candle_connectors.sh +2 -0
  9. package/skills/executor-creator/SKILL.md +48 -6
  10. package/skills/executor-creator/scripts/clear_position.sh +2 -0
  11. package/skills/executor-creator/scripts/create_executor.sh +11 -2
  12. package/skills/executor-creator/scripts/get_executor.sh +2 -0
  13. package/skills/executor-creator/scripts/get_executor_schema.sh +2 -0
  14. package/skills/executor-creator/scripts/get_executors_summary.sh +2 -0
  15. package/skills/executor-creator/scripts/get_position.sh +2 -0
  16. package/skills/executor-creator/scripts/get_positions.sh +2 -0
  17. package/skills/executor-creator/scripts/list_executor_types.sh +2 -0
  18. package/skills/executor-creator/scripts/list_executors.sh +2 -0
  19. package/skills/executor-creator/scripts/setup_executor.sh +23 -7
  20. package/skills/executor-creator/scripts/stop_executor.sh +2 -0
  21. package/skills/hummingbot-api-setup/SKILL.md +50 -258
  22. package/skills/hummingbot-api-setup/scripts/health_check.sh +2 -0
  23. package/skills/hummingbot-api-setup/{references/original_setup.sh → scripts/setup.sh} +76 -54
  24. package/skills/keys-manager/SKILL.md +2 -1
  25. package/skills/keys-manager/scripts/add_credentials.sh +2 -0
  26. package/skills/keys-manager/scripts/get_connector_config.sh +2 -0
  27. package/skills/keys-manager/scripts/list_account_credentials.sh +2 -0
  28. package/skills/keys-manager/scripts/list_connectors.sh +2 -0
  29. package/skills/keys-manager/scripts/remove_credentials.sh +2 -0
  30. package/skills/keys-manager/scripts/setup_connector.sh +2 -0
  31. package/skills/portfolio/SKILL.md +181 -0
  32. package/skills/portfolio/scripts/get_distribution.sh +52 -0
  33. package/skills/portfolio/scripts/get_history.sh +75 -0
  34. package/skills/portfolio/scripts/get_overview.sh +96 -0
  35. package/skills/portfolio/scripts/get_state.sh +96 -0
  36. package/skills.json +26 -6
  37. package/skills/hummingbot-api-setup/scripts/check_prerequisites.sh +0 -92
  38. package/skills/hummingbot-api-setup/scripts/deploy_full_stack.sh +0 -151
  39. package/skills/hummingbot-api-setup/scripts/step1_detect_system.sh +0 -88
  40. package/skills/hummingbot-api-setup/scripts/step2_check_dependencies.sh +0 -81
@@ -1,151 +0,0 @@
1
- #!/bin/bash
2
- # Deploy the complete Hummingbot stack
3
- # Usage: ./deploy_full_stack.sh [--with-gateway] [--api-user USERNAME] [--api-pass PASSWORD]
4
-
5
- set -e
6
-
7
- # Default values
8
- API_USER="${API_USER:-admin}"
9
- API_PASS="${API_PASS:-admin}"
10
- WITH_GATEWAY=false
11
- REPO_DIR="${HUMMINGBOT_API_DIR:-$HOME/hummingbot-api}"
12
-
13
- # Parse arguments
14
- while [[ $# -gt 0 ]]; do
15
- case $1 in
16
- --with-gateway)
17
- WITH_GATEWAY=true
18
- shift
19
- ;;
20
- --api-user)
21
- API_USER="$2"
22
- shift 2
23
- ;;
24
- --api-pass)
25
- API_PASS="$2"
26
- shift 2
27
- ;;
28
- --repo-dir)
29
- REPO_DIR="$2"
30
- shift 2
31
- ;;
32
- *)
33
- echo "Unknown option: $1"
34
- exit 1
35
- ;;
36
- esac
37
- done
38
-
39
- echo "=== Hummingbot Full Stack Deployment ==="
40
-
41
- # Step 1: Check prerequisites
42
- echo ""
43
- echo "Step 1: Checking prerequisites..."
44
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
45
- PREREQ_RESULT=$("$SCRIPT_DIR/check_prerequisites.sh")
46
- READY=$(echo "$PREREQ_RESULT" | grep -o '"ready": [^,]*' | cut -d' ' -f2)
47
-
48
- if [ "$READY" != "true" ]; then
49
- echo "Prerequisites not met:"
50
- echo "$PREREQ_RESULT"
51
- exit 1
52
- fi
53
- echo "All prerequisites met."
54
-
55
- # Step 2: Clone or update repository
56
- echo ""
57
- echo "Step 2: Setting up repository..."
58
- if [ -d "$REPO_DIR" ]; then
59
- echo "Repository exists at $REPO_DIR, pulling latest..."
60
- cd "$REPO_DIR"
61
- git pull origin main || echo "Warning: Could not pull latest changes"
62
- else
63
- echo "Cloning hummingbot-api repository..."
64
- git clone https://github.com/hummingbot/hummingbot-api.git "$REPO_DIR"
65
- cd "$REPO_DIR"
66
- fi
67
-
68
- # Step 3: Configure environment
69
- echo ""
70
- echo "Step 3: Configuring environment..."
71
- if [ -f .env.example ] && [ ! -f .env ]; then
72
- cp .env.example .env
73
- fi
74
-
75
- # Update credentials in .env if it exists
76
- if [ -f .env ]; then
77
- # Use sed to update or add credentials
78
- if grep -q "^API_USERNAME=" .env; then
79
- sed -i.bak "s/^API_USERNAME=.*/API_USERNAME=$API_USER/" .env
80
- else
81
- echo "API_USERNAME=$API_USER" >> .env
82
- fi
83
-
84
- if grep -q "^API_PASSWORD=" .env; then
85
- sed -i.bak "s/^API_PASSWORD=.*/API_PASSWORD=$API_PASS/" .env
86
- else
87
- echo "API_PASSWORD=$API_PASS" >> .env
88
- fi
89
- rm -f .env.bak
90
- fi
91
-
92
- # Step 4: Pull Docker images
93
- echo ""
94
- echo "Step 4: Pulling Docker images..."
95
- docker compose pull
96
-
97
- # Step 5: Start services
98
- echo ""
99
- echo "Step 5: Starting services..."
100
- if [ "$WITH_GATEWAY" = true ]; then
101
- docker compose --profile gateway up -d
102
- else
103
- docker compose up -d
104
- fi
105
-
106
- # Step 6: Wait for services to be healthy
107
- echo ""
108
- echo "Step 6: Waiting for services to be healthy..."
109
- MAX_RETRIES=30
110
- RETRY_COUNT=0
111
-
112
- while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
113
- if curl -s -u "$API_USER:$API_PASS" http://localhost:8000/health > /dev/null 2>&1; then
114
- echo "API server is healthy!"
115
- break
116
- fi
117
- echo "Waiting for API server... (attempt $((RETRY_COUNT + 1))/$MAX_RETRIES)"
118
- sleep 2
119
- RETRY_COUNT=$((RETRY_COUNT + 1))
120
- done
121
-
122
- if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then
123
- echo "Warning: API server health check timed out"
124
- fi
125
-
126
- # Step 7: Output status
127
- echo ""
128
- echo "=== Deployment Complete ==="
129
- echo ""
130
-
131
- # Get container status
132
- CONTAINERS=$(docker compose ps --format json 2>/dev/null || docker compose ps)
133
-
134
- cat << EOF
135
- {
136
- "status": "deployed",
137
- "api_url": "http://localhost:8000",
138
- "api_docs": "http://localhost:8000/docs",
139
- "credentials": {
140
- "username": "$API_USER",
141
- "password": "$API_PASS"
142
- },
143
- "gateway_enabled": $WITH_GATEWAY,
144
- "repo_dir": "$REPO_DIR",
145
- "next_steps": [
146
- "Add exchange API keys using the keys skill",
147
- "Create a controller configuration",
148
- "Deploy your first trading bot"
149
- ]
150
- }
151
- EOF
@@ -1,88 +0,0 @@
1
- #!/bin/bash
2
- # Step 1: Detect operating system and architecture
3
- # Returns JSON with system information
4
-
5
- set -e
6
-
7
- # Detect OS
8
- OS=$(uname -s | tr '[:upper:]' '[:lower:]')
9
-
10
- # Detect architecture
11
- ARCH=$(uname -m)
12
- case "$ARCH" in
13
- x86_64|amd64) ARCH="amd64" ;;
14
- aarch64|arm64) ARCH="arm64" ;;
15
- armv7*|armv8*) ARCH="arm" ;;
16
- armv*) ARCH="arm" ;;
17
- *) ARCH="unknown" ;;
18
- esac
19
-
20
- # Check disk space (need 2GB minimum)
21
- REQUIRED_MB=2048
22
- if [[ "$OS" == "linux" ]] || [[ "$OS" == "darwin" ]]; then
23
- AVAILABLE_MB=$(df -m . 2>/dev/null | tail -1 | awk '{print $4}')
24
- else
25
- AVAILABLE_MB=0
26
- fi
27
-
28
- if [[ -n "$AVAILABLE_MB" ]] && [[ $AVAILABLE_MB -ge $REQUIRED_MB ]]; then
29
- DISK_OK="true"
30
- else
31
- DISK_OK="false"
32
- fi
33
-
34
- # Check if running in container
35
- if [ -f /.dockerenv ] || grep -q docker /proc/1/cgroup 2>/dev/null; then
36
- IN_CONTAINER="true"
37
- else
38
- IN_CONTAINER="false"
39
- fi
40
-
41
- # Determine if supported
42
- if [[ "$OS" == "linux" ]] || [[ "$OS" == "darwin" ]]; then
43
- SUPPORTED="true"
44
- else
45
- SUPPORTED="false"
46
- fi
47
-
48
- # Detect package manager (Linux only)
49
- PKG_MANAGER="none"
50
- if [[ "$OS" == "linux" ]]; then
51
- if command -v apt-get &> /dev/null; then
52
- PKG_MANAGER="apt-get"
53
- elif command -v yum &> /dev/null; then
54
- PKG_MANAGER="yum"
55
- elif command -v dnf &> /dev/null; then
56
- PKG_MANAGER="dnf"
57
- elif command -v apk &> /dev/null; then
58
- PKG_MANAGER="apk"
59
- elif command -v pacman &> /dev/null; then
60
- PKG_MANAGER="pacman"
61
- fi
62
- elif [[ "$OS" == "darwin" ]]; then
63
- if command -v brew &> /dev/null; then
64
- PKG_MANAGER="homebrew"
65
- fi
66
- fi
67
-
68
- cat << EOF
69
- {
70
- "os": "$OS",
71
- "arch": "$ARCH",
72
- "supported": $SUPPORTED,
73
- "disk_space_mb": ${AVAILABLE_MB:-0},
74
- "disk_space_ok": $DISK_OK,
75
- "required_disk_mb": $REQUIRED_MB,
76
- "in_container": $IN_CONTAINER,
77
- "package_manager": "$PKG_MANAGER",
78
- "messages": [
79
- "Operating System: $OS",
80
- "Architecture: $ARCH",
81
- "Disk Space: ${AVAILABLE_MB:-unknown}MB available (${REQUIRED_MB}MB required)",
82
- $([ "$DISK_OK" = "false" ] && echo "\"WARNING: Insufficient disk space\"," || echo "")
83
- $([ "$SUPPORTED" = "false" ] && echo "\"WARNING: Unsupported operating system\"," || echo "")
84
- $([ "$IN_CONTAINER" = "true" ] && echo "\"NOTE: Running inside a container\"," || echo "")
85
- "Package Manager: $PKG_MANAGER"
86
- ]
87
- }
88
- EOF
@@ -1,81 +0,0 @@
1
- #!/bin/bash
2
- # Step 2: Check for required dependencies
3
- # Returns JSON with dependency status
4
-
5
- set -e
6
-
7
- check_command() {
8
- if command -v "$1" &> /dev/null; then
9
- echo "true"
10
- else
11
- echo "false"
12
- fi
13
- }
14
-
15
- # Check each dependency
16
- GIT_OK=$(check_command git)
17
- CURL_OK=$(check_command curl)
18
- DOCKER_OK=$(check_command docker)
19
- MAKE_OK=$(check_command make)
20
-
21
- # Check docker-compose (either plugin or standalone)
22
- if docker compose version &> /dev/null 2>&1; then
23
- DOCKER_COMPOSE_OK="true"
24
- DOCKER_COMPOSE_TYPE="plugin"
25
- elif command -v docker-compose &> /dev/null; then
26
- DOCKER_COMPOSE_OK="true"
27
- DOCKER_COMPOSE_TYPE="standalone"
28
- else
29
- DOCKER_COMPOSE_OK="false"
30
- DOCKER_COMPOSE_TYPE="none"
31
- fi
32
-
33
- # Build missing list
34
- MISSING=()
35
- [ "$GIT_OK" = "false" ] && MISSING+=("git")
36
- [ "$CURL_OK" = "false" ] && MISSING+=("curl")
37
- [ "$DOCKER_OK" = "false" ] && MISSING+=("docker")
38
- [ "$DOCKER_COMPOSE_OK" = "false" ] && MISSING+=("docker-compose")
39
- [ "$MAKE_OK" = "false" ] && MISSING+=("make")
40
-
41
- # Determine overall status
42
- if [ ${#MISSING[@]} -eq 0 ]; then
43
- ALL_OK="true"
44
- else
45
- ALL_OK="false"
46
- fi
47
-
48
- # Convert missing array to JSON
49
- MISSING_JSON=$(printf '%s\n' "${MISSING[@]}" | jq -R . | jq -s .)
50
-
51
- cat << EOF
52
- {
53
- "all_dependencies_met": $ALL_OK,
54
- "dependencies": {
55
- "git": {
56
- "installed": $GIT_OK,
57
- "purpose": "Clone repositories"
58
- },
59
- "curl": {
60
- "installed": $CURL_OK,
61
- "purpose": "Download files and make API calls"
62
- },
63
- "docker": {
64
- "installed": $DOCKER_OK,
65
- "purpose": "Run containerized services"
66
- },
67
- "docker_compose": {
68
- "installed": $DOCKER_COMPOSE_OK,
69
- "type": "$DOCKER_COMPOSE_TYPE",
70
- "purpose": "Orchestrate multi-container deployments"
71
- },
72
- "make": {
73
- "installed": $MAKE_OK,
74
- "purpose": "Run build and setup commands"
75
- }
76
- },
77
- "missing": $MISSING_JSON,
78
- "missing_count": ${#MISSING[@]},
79
- "next_step": $([ "$ALL_OK" = "true" ] && echo '"All dependencies installed. Proceed to step 4 (check Docker status)."' || echo '"Install missing dependencies using step3_install_dependency.sh"')
80
- }
81
- EOF