feat(tool): cg CLI + embedded opt-in feature flag (v0.6.6-dev)#267
Merged
feat(tool): cg CLI + embedded opt-in feature flag (v0.6.6-dev)#267
Conversation
- New `clickgraph-tool` workspace crate (`cg` binary): agent/script CLI for Cypher translation and execution without a running server. Commands: sql, validate, query, nl (NL→Cypher via LLM), schema show/validate/discover/diff. Supports Anthropic (default) and any OpenAI-compatible API. Config via ~/.config/cg/config.toml. - `clickgraph-embedded`: make `embedded` feature (chdb) opt-in. Added `Database::new_remote(schema, RemoteConfig)` — executes Cypher against external ClickHouse with no chdb dependency. `sql_only()` and `query_to_sql()` always available. `clickgraph-ffi` now explicitly enables the `embedded` feature. - Remove leftover debug println in render_plan/render_expr.rs. - Version bump to v0.6.6-dev; TCK test count (383/402) added to README. - Docs: README, CHANGELOG, STATUS, ROADMAP, CLAUDE.md, DEV_QUICK_START, copilot-instructions, all AGENTS.md files updated. Wiki: Quick-Start-Guide (pre-built binaries), Embedded-Mode (3 constructors), Schema-Discovery (cg server-free path), AI-Assistant-Integration-MCP (cg agent path), Home (v0.6.6-dev). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two framework-agnostic agent skills backed by the cg CLI: - skills/cypher.md — /cypher <NL query>: NL→Cypher→SQL→execute - skills/graph-schema.md — /graph-schema: show schema + validate skills/README.md covers installation for Claude Code, LangChain, AutoGen, CrewAI, and OpenAI function calling. Also: .gitignore negation for skills/, README and wiki updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ration Wraps `cg schema discover` as a publishable agent skill: - Collects ClickHouse credentials from env/config/user input - Runs cg schema discover → show → validate - Guides user to set CG_SCHEMA and use /cypher next Also: skills/README.md and wiki (Agent-Skills, Schema-Discovery) updated to include the new skill and the three-path discovery comparison table. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…features - Separate v0.6.6-dev and v0.6.5-dev What's New sections - Add TCK (383/402, 95.3%) to v0.6.5-dev What's New; clarify 19 skipped = write operations (CREATE/SET/DELETE/MERGE) unsupported by design - Add agent skills to v0.6.6-dev What's New - Features section: add remote mode, TCK, GraphRAG write API, hybrid mode, new Agentic & AI Integration subsection (cg CLI, agent skills, MCP, DataFrame) - Update schema discovery entry to mention cg schema discover (no server needed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TCK (383/402, 95.3%) moved from v0.6.5-dev to v0.6.6-dev in both README What's New and CHANGELOG - 19 skipped TCK scenarios: clarified as Cypher write *syntax* not yet implemented, distinct from the programmatic write API already available in embedded mode; Cypher write support noted as planned - Known Limitations updated: "Cypher write syntax" replaces "Read-Only Engine" to accurately reflect that writes are available programmatically - Agent skills added to CHANGELOG 0.6.6-dev entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
genezhang
commented
Apr 3, 2026
Owner
Author
genezhang
left a comment
There was a problem hiding this comment.
Code Review — CLI + embedded opt-in feature flag
The architecture and feature design are solid. The embedded feature flag refactor is clean and well-gated. The cg CLI fills a real gap for agent/script use without a running server.
Posting inline comments for the specific issues I found. Summary by priority:
| Priority | Issue |
|---|---|
| Must fix | Wrong flag names in Schema-Discovery.md (--ch-user → --user) |
| Must fix | Wrong RemoteConfig field types in Embedded-Mode.md code example |
| Should fix | ch_user == "default" override logic conflates explicit vs unset |
| Should fix | value_str/value_to_json Debug fallback for Date/Timestamp/UUID/List |
| Nice to have | Add unit tests for config.rs, schema_fmt.rs, extract_code_block |
| Nice to have | Fix Python skill example; consider deduplicating merge_batch_yaml |
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
genezhang
commented
Apr 3, 2026
Must-fix bugs: - docs: cg schema discover uses --user/--password not --ch-user/--ch-password (Schema-Discovery.md, skills/schema-discover.md) - docs: RemoteConfig fields user/password are String not Option<String>; add missing cluster_name field (Embedded-Mode.md) - config: fix sentinel bug — ch_user/ch_password are now Option<String> in Cli, using proper priority chain (explicit > config file > default) instead of comparing against literal "default" / "" (main.rs, config.rs) - query: add explicit Value::Date/Timestamp/UUID/List/Map arms to value_str and value_to_json; previously fell back to Rust Debug format - skills/README.md: fix Python example — execution branch now uses cg nl --execute instead of passing raw NL string to cg query - schema_discovery: move merge_batch_yaml/extract_yaml_list_items to clickgraph core crate (src/graph_catalog/schema_discovery.rs); remove duplicate from clickgraph-tool/src/commands/schema.rs Nit: - llm.rs: remove .or_else(|| None) no-op Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
clickgraph-toolcrate (cgbinary): agent/script CLI for Cypher translation and execution without a running ClickGraph servercg sql— Cypher→SQL translationcg validate— parse + plan checkcg query— execute via remote ClickHouse (Database::new_remote)cg nl— NL→Cypher via LLM (Anthropic default; any OpenAI-compatible API)cg schema show/validate/discover/diff— schema inspection and LLM-assisted discovery (no server hop needed)~/.config/cg/config.toml+CG_*env varsclickgraph-embedded:embeddedfeature now opt-in — chdb not compiled by default. NewDatabase::new_remote(schema, RemoteConfig)executes Cypher against external ClickHouse with no chdb dependency.sql_only()/query_to_sql()always available.clickgraph-ffiexplicitly enablesembedded.Bug fix: removed leftover
println!("DEBUG TryFrom RenderExpr: ...")inrender_plan/render_expr.rsVersion: v0.6.5-dev → v0.6.6-dev; TCK count (383/402, 95.3%) added to README test coverage
Docs: README, CHANGELOG, STATUS, ROADMAP, CLAUDE.md, DEV_QUICK_START, copilot-instructions, AGENTS.md files, and wiki (Quick-Start-Guide, Embedded-Mode, Schema-Discovery, AI-Assistant-Integration-MCP, Home)
Test plan
cargo build -p clickgraph-toolbuilds successfullycargo build -p clickgraph-embeddedbuilds without chdb (noembeddedfeature)cargo build -p clickgraph-ffi --features embeddedbuilds with chdbcg --schema <yaml> sql "MATCH (n:User) RETURN n.name"prints SQLcg --schema <yaml> validate "MATCH (n:User) RETURN n"succeedscg --schema <yaml> schema showprints compact schemacg --schema <yaml> schema validatesucceedscargo test— all unit tests still pass🤖 Generated with Claude Code