Skip to content

Commit e3893fa

Browse files
authored
Helix chef + sdks (#919)
<!-- greptile_comment --> <h3>Greptile Summary</h3> This PR introduces `helix chef`, a new CLI command that bootstraps a full HelixDB app by orchestrating skill/MCP installation, project init, DB startup, and launching a coding agent (Claude Code, Codex, or OpenCode) with a structured prompt. It also adds new Rust and TypeScript SDKs with type-safe DSL query builders and a cross-SDK parity test suite. - **`helix chef`** (`helix-cli/src/commands/chef.rs`, 2182 lines): interactive/automatic setup flow, streaming Claude Code output via `stream-json`, and a `run_quietly` helper that temporarily sets verbosity to `Silent` while orchestrating sub-commands. - **Rust SDK** (`sdks/rust/`): full DSL builder API plus an async HTTP client; the `#[register]` macro generates typed query functions. - **TypeScript SDK** (`sdks/typescript/src/index.ts`): parallel DSL builder with a custom bigint-safe JSON serializer/parser and query bundle generation. - **Parity test suite** (`.github/workflows/parity_tests.yml`, `sdks/tests/`, `sdks/typescript/scripts/parity/`): generates fixtures from both SDKs, runs them against a live Helix instance, and diffs the results. <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | helix-cli/src/commands/chef.rs | New `helix chef` onboarding command: installs skills/MCP, initializes a project, starts DB, seeds data, and launches a coding agent. Contains the process-global `env::set_current_dir` concern and the unimplemented `--auto`/`--agent` flags referenced in install.sh. | | helix-cli/install.sh | Updated post-install instructions document `helix chef --agent` and `helix chef --auto` flags that are not implemented in the CLI, causing clap errors when users follow these instructions. | | .github/workflows/parity_tests.yml | New CI workflow for SDK DSL parity tests. Installs the helix CLI from `main` branch rather than building from the PR's source, which may produce false results when CLI behavior is also changing. | | sdks/typescript/src/index.ts | New TypeScript SDK: full query-builder DSL mirroring the Rust SDK, with custom bigint-safe JSON serializer/parser, property value types, and query bundle generation. Implementation looks correct and well-structured. | | sdks/rust/src/lib.rs | New Rust SDK HTTP client with builder pattern for stored and dynamic queries. The known URL-joining behavior for path-prefixed base URLs is already noted in a prior review thread. | | helix-cli/src/output.rs | Adds a new `Silent` verbosity level (shifting existing numeric values by 1) and a `show_quiet()` helper. The default VERBOSITY value is updated correctly from 1 to 2 to maintain Normal as default. | | helix-cli/src/commands/query.rs | Query output is now gated on `show_normal()` so chef's internal seed query doesn't print to stdout. Correct behavior; default verbosity (Normal) preserves the existing user-facing output. | | sdks/typescript/scripts/parity/run-helix.ts | Parity test runner that spins up Helix instances for both Rust and TypeScript SDK fixtures and compares their outputs. The previously-flagged `spawnSync` OS-error surfacing issue is tracked in an existing thread. | | sdks/rust/src/dsl.rs | Large new Rust DSL module (5370 lines) providing type-safe query-builder API for HelixDB. Comprehensive coverage of all query constructs; no significant issues found. | </details> </details> <details><summary><h3>Sequence Diagram</h3></summary> ```mermaid sequenceDiagram participant User participant Chef as helix chef participant NPX as npx (skills/MCP) participant Init as helix init participant DB as helix run dev participant Query as helix query participant Agent as Coding Agent (Claude/Codex) participant Browser User->>Chef: helix chef Chef->>User: Prompts (intent, mode, dir) Chef->>NPX: npx skills add HelixDB/skills Chef->>NPX: npx add-mcp helixdb-docs Chef->>Init: init local (run_quietly) Chef->>Chef: write HELIX_CHEF_PROMPT.md + examples/ Chef->>DB: helix run dev (run_quietly) Chef->>Query: helix query dev --file seed.json (run_quietly) Chef->>User: Prompt: Give agent full autonomy? Chef->>Agent: launch with --append-system-prompt-file loop stream-json events Agent-->>Chef: tool use events (Edit/Bash/Read...) Chef->>User: spinner update end Agent-->>Chef: ResultEvent (cost, duration, summary) Chef->>Browser: try_open_frontend (http://localhost:3000) Chef->>User: Final summary ``` </details> <sub>Reviews (2): Last reviewed commit: ["updating cli"](49d3e42) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=33039363)</sub> > Greptile also left **1 inline comment** on this PR. <!-- /greptile_comment -->
2 parents 8a8ef37 + 49d3e42 commit e3893fa

44 files changed

Lines changed: 21562 additions & 80 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/parity_tests.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: SDK DSL Parity
2+
3+
on:
4+
pull_request:
5+
branches: [main, dev]
6+
paths:
7+
- 'sdks/**'
8+
- 'Cargo.toml'
9+
- 'Cargo.lock'
10+
- '.github/workflows/parity_tests.yml'
11+
push:
12+
branches: [main, dev]
13+
paths:
14+
- 'sdks/**'
15+
- 'Cargo.toml'
16+
- 'Cargo.lock'
17+
- '.github/workflows/parity_tests.yml'
18+
19+
env:
20+
CARGO_TERM_COLOR: always
21+
RUST_BACKTRACE: 1
22+
23+
jobs:
24+
parity:
25+
runs-on: ubuntu-latest # Docker daemon preinstalled; required for the runtime phase
26+
timeout-minutes: 30
27+
defaults:
28+
run:
29+
working-directory: sdks/typescript
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
# --- Rust (generate Rust fixtures) ---
34+
- uses: dtolnay/rust-toolchain@stable
35+
- uses: actions/cache@v4
36+
with:
37+
path: |
38+
~/.cargo/registry
39+
~/.cargo/git
40+
target
41+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') || 'fallback' }}
42+
restore-keys: ${{ runner.os }}-cargo-
43+
44+
# --- Node (all phases) ---
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: 20
48+
cache: npm
49+
cache-dependency-path: sdks/typescript/package-lock.json
50+
51+
# --- helix CLI (released binary) ---
52+
# install.sh lives under helix-cli/ on main (not the repo root); installs to ~/.local/bin
53+
# and is non-interactive on Linux (the Docker Desktop prompt is macOS-only).
54+
- name: Install helix CLI
55+
working-directory: .
56+
run: |
57+
curl -fsSL https://raw.githubusercontent.com/HelixDB/helix-db/main/helix-cli/install.sh | bash
58+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
59+
60+
- name: Verify toolchain
61+
run: |
62+
helix --version
63+
docker --version
64+
65+
- name: Install npm deps
66+
run: npm ci
67+
68+
- name: Run parity suite
69+
run: npm run test:parity
70+
71+
- name: Upload parity artifacts on failure
72+
if: failure()
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: parity-output
76+
path: |
77+
sdks/tests/parity/generated/**
78+
sdks/tests/parity/results/**
79+
if-no-files-found: ignore

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.helix/
2-
target/
32
*.log
43
test/
54
/thoughts/
@@ -11,4 +10,11 @@ hack/
1110
claude.md
1211
.cargo/
1312
**/dist
14-
**/node_modules
13+
**/node_modules
14+
15+
**/target
16+
**/dist
17+
**/dist-dev
18+
**/tests/parity/results
19+
**/tests/parity/workspaces
20+
**/tests/parity/generated

0 commit comments

Comments
 (0)