{
  "schemaVersion": "1.0",
  "item": {
    "slug": "db-query",
    "name": "MYSQL QUERY",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/zenixp/db-query",
    "canonicalUrl": "https://clawhub.ai/zenixp/db-query",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/db-query",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=db-query",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/INSTALL.md",
      "scripts/db_query.py",
      "scripts/config.example.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/db-query"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/db-query",
    "agentPageUrl": "https://openagent3.xyz/skills/db-query/agent",
    "manifestUrl": "https://openagent3.xyz/skills/db-query/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/db-query/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "Query databases through a centralized configuration file with automatic SSH tunnel management. Handles connection details, SSH tunnel setup/teardown, and query execution."
      },
      {
        "title": "Security",
        "body": "Passwords are never exposed in process lists. The skill uses environment variables for credentials:\n\nMYSQL_PWD for database passwords (passed to mysql client)\nSSHPASS for SSH tunnel passwords (passed to sshpass)\n\nRecommended: Store credentials in environment variables instead of the config file for better security."
      },
      {
        "title": "Setup",
        "body": "Create config file at ~/.config/clawdbot/db-config.json:\nmkdir -p ~/.config/clawdbot\n# Copy example config and edit\ncp /usr/lib/node_modules/clawdbot/skills/db-query/scripts/config.example.json ~/.config/clawdbot/db-config.json\n\n\n\nAdd database entries with these fields:\n\nname: Description used to find the database (required)\nhost: Database host (required)\nport: Database port (default: 3306)\ndatabase: Database name (required)\nuser: Database user (required)\npassword: Database password (optional, can use env var)\nssh_tunnel: Optional SSH tunnel configuration\n\n\n\nSSH tunnel configuration (if needed):\n\nenabled: true/false\nssh_host: Remote SSH host\nssh_user: SSH username\nssh_port: SSH port (default: 22)\nlocal_port: Local port to forward (e.g., 3307)\nremote_host: Remote database host behind SSH (default: localhost)\nremote_port: Remote database port (default: 3306)"
      },
      {
        "title": "Environment Variables (Recommended)",
        "body": "Instead of storing passwords in the config file, use environment variables:\n\n# Format: DB_PASSWORD_<DATABASE_NAME> (spaces replaced with underscores, uppercase)\nexport DB_PASSWORD_PRODUCTION_USER_DB=\"your_db_password\"\n\n# Format: SSH_PASSWORD_<DATABASE_NAME> for SSH tunnel password\nexport SSH_PASSWORD_PRODUCTION_USER_DB=\"your_ssh_password\""
      },
      {
        "title": "Example Config",
        "body": "{\n  \"databases\": [\n    {\n      \"name\": \"Production User DB\",\n      \"host\": \"localhost\",\n      \"port\": 3306,\n      \"database\": \"user_db\",\n      \"user\": \"db_user\",\n      \"password\": \"\",\n      \"ssh_tunnel\": {\n        \"enabled\": true,\n        \"ssh_host\": \"prod.example.com\",\n        \"ssh_user\": \"deploy\",\n        \"local_port\": 3307\n      }\n    }\n  ]\n}\n\nSet environment variables (recommended):\n\nexport DB_PASSWORD_PRODUCTION_USER_DB=\"your_db_password\"\nexport SSH_PASSWORD_PRODUCTION_USER_DB=\"your_ssh_password\""
      },
      {
        "title": "List Databases",
        "body": "python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py --list"
      },
      {
        "title": "Query a Database",
        "body": "python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\\n  --database \"Production User DB\" \\\n  --query \"SELECT * FROM users LIMIT 10\"\n\nThe script will:\n\nFind database by matching description in config\nStart SSH tunnel (if configured)\nExecute query\nAutomatically close SSH tunnel (important for cleanup)"
      },
      {
        "title": "With Custom Config Path",
        "body": "python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\\n  --config /path/to/custom-config.json \\\n  --database \"test\" \\\n  --query \"SHOW TABLES\""
      },
      {
        "title": "Requirements",
        "body": "MySQL client: apt install mysql-client or equivalent\nSSH client: usually pre-installed on Linux/Mac\nPython 3.6+"
      },
      {
        "title": "Notes",
        "body": "SSH tunnels are automatically closed after query execution\nUse --list to see all configured databases and their descriptions\nDatabase search is case-insensitive partial match on name field\nLocal ports for SSH tunnels should be unique per database"
      }
    ],
    "body": "Database Query\nOverview\n\nQuery databases through a centralized configuration file with automatic SSH tunnel management. Handles connection details, SSH tunnel setup/teardown, and query execution.\n\nSecurity\n\nPasswords are never exposed in process lists. The skill uses environment variables for credentials:\n\nMYSQL_PWD for database passwords (passed to mysql client)\nSSHPASS for SSH tunnel passwords (passed to sshpass)\n\nRecommended: Store credentials in environment variables instead of the config file for better security.\n\nConfiguration\nSetup\n\nCreate config file at ~/.config/clawdbot/db-config.json:\n\nmkdir -p ~/.config/clawdbot\n# Copy example config and edit\ncp /usr/lib/node_modules/clawdbot/skills/db-query/scripts/config.example.json ~/.config/clawdbot/db-config.json\n\n\nAdd database entries with these fields:\n\nname: Description used to find the database (required)\nhost: Database host (required)\nport: Database port (default: 3306)\ndatabase: Database name (required)\nuser: Database user (required)\npassword: Database password (optional, can use env var)\nssh_tunnel: Optional SSH tunnel configuration\n\nSSH tunnel configuration (if needed):\n\nenabled: true/false\nssh_host: Remote SSH host\nssh_user: SSH username\nssh_port: SSH port (default: 22)\nlocal_port: Local port to forward (e.g., 3307)\nremote_host: Remote database host behind SSH (default: localhost)\nremote_port: Remote database port (default: 3306)\nEnvironment Variables (Recommended)\n\nInstead of storing passwords in the config file, use environment variables:\n\n# Format: DB_PASSWORD_<DATABASE_NAME> (spaces replaced with underscores, uppercase)\nexport DB_PASSWORD_PRODUCTION_USER_DB=\"your_db_password\"\n\n# Format: SSH_PASSWORD_<DATABASE_NAME> for SSH tunnel password\nexport SSH_PASSWORD_PRODUCTION_USER_DB=\"your_ssh_password\"\n\nExample Config\n{\n  \"databases\": [\n    {\n      \"name\": \"Production User DB\",\n      \"host\": \"localhost\",\n      \"port\": 3306,\n      \"database\": \"user_db\",\n      \"user\": \"db_user\",\n      \"password\": \"\",\n      \"ssh_tunnel\": {\n        \"enabled\": true,\n        \"ssh_host\": \"prod.example.com\",\n        \"ssh_user\": \"deploy\",\n        \"local_port\": 3307\n      }\n    }\n  ]\n}\n\n\nSet environment variables (recommended):\n\nexport DB_PASSWORD_PRODUCTION_USER_DB=\"your_db_password\"\nexport SSH_PASSWORD_PRODUCTION_USER_DB=\"your_ssh_password\"\n\nUsage\nList Databases\npython3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py --list\n\nQuery a Database\npython3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\\n  --database \"Production User DB\" \\\n  --query \"SELECT * FROM users LIMIT 10\"\n\n\nThe script will:\n\nFind database by matching description in config\nStart SSH tunnel (if configured)\nExecute query\nAutomatically close SSH tunnel (important for cleanup)\nWith Custom Config Path\npython3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \\\n  --config /path/to/custom-config.json \\\n  --database \"test\" \\\n  --query \"SHOW TABLES\"\n\nRequirements\nMySQL client: apt install mysql-client or equivalent\nSSH client: usually pre-installed on Linux/Mac\nPython 3.6+\nNotes\nSSH tunnels are automatically closed after query execution\nUse --list to see all configured databases and their descriptions\nDatabase search is case-insensitive partial match on name field\nLocal ports for SSH tunnels should be unique per database"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/zenixp/db-query",
    "publisherUrl": "https://clawhub.ai/zenixp/db-query",
    "owner": "zenixp",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/db-query",
    "downloadUrl": "https://openagent3.xyz/downloads/db-query",
    "agentUrl": "https://openagent3.xyz/skills/db-query/agent",
    "manifestUrl": "https://openagent3.xyz/skills/db-query/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/db-query/agent.md"
  }
}