{"id":51629869,"url":"https://github.com/obsessiondb/chcli","last_synced_at":"2026-07-13T06:02:51.528Z","repository":{"id":339203027,"uuid":"1160600962","full_name":"obsessiondb/chcli","owner":"obsessiondb","description":"Clickhouse CLI - Interact with your Clickhouse via CLI.  Perfect for Agents.","archived":false,"fork":false,"pushed_at":"2026-03-20T06:54:48.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-20T21:57:57.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/obsessiondb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2026-02-18T06:19:46.000Z","updated_at":"2026-03-20T06:54:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/obsessiondb/chcli","commit_stats":null,"previous_names":["obsessiondb/chcli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/obsessiondb/chcli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsessiondb%2Fchcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsessiondb%2Fchcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsessiondb%2Fchcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsessiondb%2Fchcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obsessiondb","download_url":"https://codeload.github.com/obsessiondb/chcli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obsessiondb%2Fchcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35412265,"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-13T02:00:06.543Z","response_time":119,"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":[],"created_at":"2026-07-13T06:02:50.903Z","updated_at":"2026-07-13T06:02:51.521Z","avatar_url":"https://github.com/obsessiondb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chcli\n\nA lightweight ClickHouse CLI built on [Bun](https://bun.sh).\n\n## Install\n\n```bash\nnpm install -g @obsessiondb/chcli\n```\n\n## Query input\n\nProvide a query inline, from a file, or piped via stdin:\n\n```bash\nchcli -q \"SELECT 1\"\nchcli -f query.sql\necho \"SELECT 1\" | chcli\n```\n\n## Connecting to ClickHouse\n\nConnection can be configured via CLI flags or environment variables. Flags take precedence.\n\n| Flag | Env var | Default |\n|------|---------|---------|\n| `--host \u003chost\u003e` | `CLICKHOUSE_HOST` | `localhost` |\n| `--port \u003cport\u003e` | `CLICKHOUSE_PORT` | `8123` |\n| `-u, --user \u003cuser\u003e` | `CLICKHOUSE_USER` | `default` |\n| `--password \u003cpass\u003e` | `CLICKHOUSE_PASSWORD` | *(empty)* |\n| `-d, --database \u003cdb\u003e` | `CLICKHOUSE_DATABASE` | `default` |\n| `-s, --secure` | `CLICKHOUSE_SECURE` | `false` |\n\n```bash\n# Local instance with defaults\nchcli -q \"SHOW DATABASES\"\n\n# Remote instance\nchcli --host ch.example.com --port 8443 --secure \\\n      -u admin --password secret \\\n      -d analytics -q \"SELECT count() FROM events\"\n```\n\nOr set your connection in a `.env` file (Bun loads it automatically):\n\n```env\nCLICKHOUSE_HOST=ch.example.com\nCLICKHOUSE_PORT=8443\nCLICKHOUSE_SECURE=true\nCLICKHOUSE_USER=admin\nCLICKHOUSE_PASSWORD=secret\nCLICKHOUSE_DATABASE=analytics\n```\n\n## Output formats\n\n| Flag | Description |\n|------|-------------|\n| `-F, --format \u003cfmt\u003e` | Output format (see table below) |\n| `-t, --time` | Print execution time to stderr |\n| `-v, --verbose` | Print query metadata to stderr |\n\nDefault format is `pretty` in a terminal, `tsv` when piping.\n\n| Alias | ClickHouse format |\n|-------|-------------------|\n| `json` | JSON |\n| `jsonl` / `ndjson` | JSONEachRow |\n| `csv` | CSVWithNames |\n| `tsv` | TabSeparatedWithNames |\n| `pretty` | PrettyCompactMonoBlock |\n| `vertical` | Vertical |\n| `markdown` | Markdown |\n| `sql` | SQLInsert |\n\nAny native ClickHouse format name is also accepted directly.\n\n```bash\nchcli -q \"SELECT * FROM events LIMIT 5\" -F json\nchcli -q \"SHOW TABLES\" -F csv \u003e tables.csv\n```\n\n## Agent Skill\n\nchcli ships as an [Agent Skill](https://agentskills.io) so AI coding agents (Claude Code, Cursor, etc.) can query your ClickHouse databases directly.\n\n```bash\nnpx skills add obsessiondb/chcli\n```\n\nOnce installed, your agent can run SQL queries, explore schemas, and extract data using `chcli` — no manual copy-pasting required.\n\n---\n\nSponsored by [obsessiondb.com](https://obsessiondb.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsessiondb%2Fchcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobsessiondb%2Fchcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobsessiondb%2Fchcli/lists"}