# SQL Coder CLI

> Get accurate answers and validated code from your database just by asking questions in plain English.

SQL Coder CLI is a free AI agent skill on Agensi by asksql, in Data & Databases. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [asksql](https://www.agensi.io/creators/asksql)
- Category: [Data & Databases](https://www.agensi.io/skills/data-databases)
- Version: 1.0
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/sql-coder-cli
- Tags: api, database, research, project-management, mysql, data-analysis

## What it does

- Converts natural language questions into safe and auditable code for databases
- Scans your database to understand your specific tables and columns before starting
- Provides a step by step plan for your approval before running any complex query
- Requests clarification on business terms like revenue or active user to ensure accuracy
- Runs tests on small parts of the data first to verify the results are correct
- Keeps a history of every question and answer so you can track changes over time

## Who it's for

- **Founders tracking business metrics:** Get exact answers from your database without waiting for a data analyst. Try: "Show me our top 10 customers by revenue from the last 3 months."
- **Marketers analyzing campaign performance:** Turn your questions about ad spend and conversion into clear data tables. Try: "Which marketing channel had the highest return on spend in April?"
- **Shop owners managing inventory and sales:** Find out what is selling and what is sitting on the shelf using your own data. Try: "List all products that haven't sold in the last 30 days."

## About this skill

If you have a database but don't know how to write code to talk to it, this skill is for you. It acts as a bridge between your plain English questions and your data. Your AI agent uses this skill to look at how your database is set up, plan a safe way to find the answer, and then write the exact code needed to get that information. It focuses on being accurate and safe, meaning it only reads your data and never changes or deletes it.

**How it works**

1. You ask a question about your business data in plain English.
2. Your AI agent scans your database structure to understand what information is available.
3. It creates a plan for the query and asks you to confirm any business definitions it isn't sure about.
4. Once you approve, it writes and runs the code to find your answer.
5. You receive a clear summary of the data along with the specific code used to find it.

**What you get:** A validated data report and the exact code used to generate it for your records.

## Requires

- Python
- uv (Python tool runner)
- Git

## Known limitations

This skill only reads data. It cannot add, delete, or change any information in your database. It requires an initial setup to connect to your database.

## Technical details

This skill interfaces with the SQL Coder CLI (sql-coder-cli) to perform natural language to SQL translation. It requires a local installation of the asksql_coding_assistant repository and a configured coder.yaml and semantic.yaml for the target MySQL database. It operates in a read-only mode, using a multi-step process of scanning, planning with human-in-the-loop checkpoints (plan review and clarification), and segmented debugging to ensure query validity. It tracks state via session_id and sql_version within a local workspace.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the SQL Coder CLI skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does this skill actually do?

This skill lets you ask questions about your database in plain English. It handles the work of looking at your data structure, planning the search, and writing the specific code needed to get you an accurate answer.

### What do I need to have ready before I use this?

You need a MySQL database and its connection details. You also need to provide a configuration file and a file that explains your database structure so the skill knows how to read your information safely.

### Is it safe for my business data?

The skill is designed to only read information. It uses specific commands that prevent it from changing, adding, or deleting any of your actual business data.

### What exactly do I get back after I ask a question?

You receive a clear summary of the data you asked for, along with the exact, validated code used to find it. This code is saved with a version number so you can audit it or keep it for your records.

### When should I avoid using this skill?

It is not for making changes to your database or for asking general theory questions that do not need real data. It also requires a local setup of the coding assistant tool to be available to your agent.

### How do I tell my agent to start finding data for me?

You can start by asking a direct question about your data, such as asking for a sales report from last month. If the request is complex, the agent will show you a plan and ask you to confirm specific business definitions before it runs any code.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
