ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 3/5

db-query

Query project databases with automatic SSH tunnel management. Use when you need to execute SQL queries against configured databases, especially those accessible only via SSH tunnels. Automatically manages SSH connection lifecycle (establishes tunnel before query, closes after). Supports multiple databases distinguished by description/name from config file.

Why use this skill?

Efficiently query remote SQL databases using OpenClaw with automatic SSH tunnel management. Simplify production data access and automate your database workflows securely.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/zenixp/db-query
Or

What This Skill Does

The db-query skill provides a robust interface for interacting with remote or local SQL databases directly through your OpenClaw agent. Its primary value proposition is the seamless management of SSH tunnels, allowing users to safely query production databases that are not directly exposed to the public internet. The skill acts as an intelligent wrapper around standard MySQL client operations, handling the entire lifecycle of a database connection—including the complex setup of SSH port forwarding—so that you can focus on data retrieval rather than infrastructure orchestration.

Installation

To begin, ensure you have Python 3.6+ and the necessary MySQL client installed on your system. You can install the skill by running clawhub install openclaw/skills/skills/zenixp/db-query. Once installed, create your configuration file at ~/.config/clawdbot/db-config.json by referencing the example provided in the package documentation. It is critical to define clear, descriptive names for your databases, as these serve as the identifiers the AI agent uses to locate specific connections. Once the configuration is saved, the agent can immediately parse these settings to execute queries.

Use Cases

  • Production Debugging: Quickly fetch user records or application logs from a secure, isolated database server.
  • Data Analysis: Run complex analytical SQL queries directly from your terminal to generate reports without exporting data to external tools.
  • Automated Auditing: Use the agent to run periodic health checks on databases and return summary statistics or count records in specific tables.
  • Schema Inspection: Rapidly verify table structures or indices across multiple environments to ensure configuration parity.

Example Prompts

  1. "Query the production user database to find the top 5 most active users who signed up in the last 24 hours."
  2. "List all currently configured databases to see which environments I can access."
  3. "Run a query on the staging database to count how many records exist in the orders table where the status is 'pending'."

Tips & Limitations

When configuring your SSH tunnels, ensure that the local_port assigned to each database entry is unique to avoid port collisions during parallel executions. Because this tool performs automated SSH tunneling, it requires appropriate private key access on the host machine. Remember that the database search feature is case-insensitive, but accuracy improves with specific naming conventions. Always verify that your database user has the necessary read-only permissions if you intend to use this strictly for data analysis, as a best practice for security.

Metadata

Author@zenixp
Stars879
Views4
Updated2026-02-11
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-zenixp-db-query": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#database#ssh#mysql#data-access#infrastructure
Safety Score: 3/5

Flags: network-access, file-read, file-write