{"id":51494783,"url":"https://github.com/erphq/clickr","last_synced_at":"2026-07-13T06:00:57.471Z","repository":{"id":311760286,"uuid":"1044919199","full_name":"erphq/clickr","owner":"erphq","description":"Natural-language CLI for ClickHouse®. Text-to-SQL with local or cloud LLMs. Not affiliated with ClickHouse, Inc.","archived":false,"fork":false,"pushed_at":"2026-05-29T17:43:39.000Z","size":61920,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-07T14:23:00.335Z","etag":null,"topics":["analytics-cli","cli","clickhouse","clickr","data-analytics","natural-language-query","python","sql-generation","text-to-sql","text2sql"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erphq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-26T11:49:28.000Z","updated_at":"2026-05-29T17:43:45.000Z","dependencies_parsed_at":"2025-08-26T14:34:47.377Z","dependency_job_id":"44739df6-8a82-491d-8df9-eac661043036","html_url":"https://github.com/erphq/clickr","commit_stats":null,"previous_names":["vishprometa/proto","erphq/proto","erphq/clickr","erpdotai/proto"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/erphq/clickr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erphq%2Fclickr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erphq%2Fclickr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erphq%2Fclickr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erphq%2Fclickr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erphq","download_url":"https://codeload.github.com/erphq/clickr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erphq%2Fclickr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35313756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics-cli","cli","clickhouse","clickr","data-analytics","natural-language-query","python","sql-generation","text-to-sql","text2sql"],"created_at":"2026-07-07T14:00:33.620Z","updated_at":"2026-07-13T06:00:57.128Z","avatar_url":"https://github.com/erphq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# `clickr`\n\n### natural-language CLI for ClickHouse\n\nAsk in English. Get SQL, results, charts. No syntax to memorize.\n\n![tests](https://img.shields.io/badge/tests-46%20passing-yellow)\n\n[![pypi](https://img.shields.io/pypi/v/clickr.svg)](https://pypi.org/project/clickr/)\n[![python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](#requirements)\n[![license](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)\n\n\u003c/div\u003e\n\n```text\n$ clickr\nclickr · connected to events.prod.clickhouse:9000\n\n❯ which 10 users had the most activity last week?\n\n  generated SQL ────────────────────────────────────────────\n  SELECT user_id, count() AS events\n  FROM events\n  WHERE event_time \u003e= now() - INTERVAL 7 DAY\n  GROUP BY user_id\n  ORDER BY events DESC\n  LIMIT 10\n\n  results ──────────────────────────────────────────────────\n  user_id          events\n  ──────────────   ──────\n  u_4f3a91         18,422\n  u_8c1e02         12,805\n  ...\n\n  84 ms · 12 GB scanned · cached\n```\n\n`clickr` is a CLI for ClickHouse® that translates plain English into SQL, runs it, and shows you the answer. Works with **local LLMs** (Ollama, llama.cpp, the bundled small model) and **cloud LLMs** (OpenAI, Anthropic). Your queries and schema never leave the machine on the local path.\n\n## ✦ Install\n\n```bash\npipx install clickr        # recommended — keeps deps isolated\npip  install clickr        # if you don't have pipx\ncurl -fsSL https://clickr.dev/install.sh | sh    # one-liner (downloads the standalone binary)\n```\n\nFirst run drops you into an interactive setup: ClickHouse connection, model choice, optional API keys.\n\n## ✦ What it does\n\n| Want to | Run |\n|---|---|\n| Ask a one-shot question | `clickr query \"top 10 users by activity\"` |\n| Pull up a table summary | `clickr analyze users` |\n| Drop into an interactive REPL | `clickr` |\n| Bulk-load a CSV | `clickr load-data users.csv users` |\n| Render a chart from a query | `clickr query \"...\" --chart bar` |\n\n`clickr --help` for the full surface. Every subcommand emits the SQL it generated and the timing — no black box.\n\n## ✦ How it works\n\n```text\nyour question\n     ↓\n[ schema introspection ]   reads CREATE TABLE, top values, row counts\n     ↓\n[ LLM (local or cloud) ]   prompts include the schema + few-shot SQL\n     ↓\n[ generated SQL ]          shown to you before execution\n     ↓\n[ ClickHouse ]             clickhouse-connect over TCP/HTTP\n     ↓\n[ formatted results ]      table, chart, or JSON\n```\n\nThe LLM only sees your schema and the question, never your data rows. Local-only mode (`--provider ollama` or the bundled engine) keeps the whole loop on the machine.\n\n## ✦ Requirements\n\n- Python 3.9 or newer\n- A reachable ClickHouse instance (local or cloud)\n- One of: Ollama / llama.cpp running locally, an OpenAI API key, or an Anthropic API key\n- ~3.5 GB free for the bundled local model (first run only)\n\n## ✦ Configuration\n\nLives in `~/.config/clickr/clickr-config.json`. Contains the ClickHouse DSN, the active model provider, and any API tokens. Edit by hand or rerun `clickr login` for the wizard.\n\nProvider matrix:\n\n| Provider | Latency | Cost | Privacy |\n|---|---|---|---|\n| Local (Ollama / llama.cpp / bundled) | medium | free | data never leaves the machine |\n| OpenAI | fast | per-token | schema sent to OpenAI |\n| Anthropic | fast | per-token | schema sent to Anthropic |\n\n## ✦ Develop\n\n```bash\ngit clone https://github.com/erphq/clickr.git\ncd clickr\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -e \".[dev]\"\npython main.py\n```\n\nBuild standalone binaries (PyInstaller, signed on macOS):\n\n```bash\n./build_installers.sh\n```\n\nOutputs land in `builds/` for macOS Intel / Apple Silicon, Linux x64, Windows x64.\n\n## ✦ Roadmap\n\n- Multi-engine support (DuckDB, BigQuery, Snowflake) behind the same NL interface\n- Query-cost preview before execution (cardinality + bytes-scanned estimate)\n- Saved-query namespace with shareable URLs\n- Chart-in-terminal via `kitty +icat` and Sixel\n- Web companion (read-only) for sharing the same query history\n\nOpen an issue with a use case if you want one of these prioritized.\n\n## ✦ Trademark notice\n\nThis project is not affiliated with, endorsed by, or sponsored by ClickHouse, Inc. **ClickHouse®** is a registered trademark of ClickHouse, Inc. The name appears here descriptively (\"a CLI **for** ClickHouse\") under their [trademark policy](https://clickhouse.com/legal/trademark-policy).\n\n## ✦ License\n\nMIT. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferphq%2Fclickr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferphq%2Fclickr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferphq%2Fclickr/lists"}