MCPcopy Index your code
hub / github.com/cube2222/DuckGPT

github.com/cube2222/DuckGPT @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
3 symbols 11 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DuckGPT

DuckGPT lets you ask questions about your JSON and CSV files, then answers them by composing SQL queries using ChatGPT and executing them through DuckDB.

Disclaimer: This is a toy project. ChatGPT likes to hallucinate weird queries occasionally, but most of the time, it works surprisingly well! Including the way it's able to automatically respond to errors in queries it writes, and then rewrite them correctly.

Reviews Demo

Installation

You can install it using Homebrew:

brew tap cube2222/cube2222
brew install duckgpt

or download one of the static binaries from the releases page. If you're downloading a static binary, make sure to install DuckDB as well.

Usage

Provide your OpenAI platform key through the DUCKGPT_TOKEN environment variable. Then, you can run duckgpt in the directory that contains your JSON and/or CSV files.

Demo

You've seen one demo at the beginning of the README, now we can take a look at another example, where one of the queries DuckGPT writes is incorrect (at least in the DuckDB SQL dialect). It then rewrites it correctly, without any user interaction.

Logs Demo

Finally, we can turn on debug mode to see the raw messages being exchanged between DuckGPT and ChatGPT.

Logs Debug Demo

Closing Thoughts

Have fun!

Core symbols most depended-on inside this repo

Execute
called by 1
cmd/root.go
main
called by 0
main.go
init
called by 0
cmd/root.go

Shape

Function 3

Languages

Go100%

Modules by API surface

cmd/root.go2 symbols
main.go1 symbols

For agents

$ claude mcp add DuckGPT \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact