You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #2273. Spec: dev/plans/rust-cli.md (lands with the first PR).
One Rust binary with the same commands as the Python CLI. Pipeline logic is compiled into the
user's binary, so the CLI works like cargo run: build the crate, run the user's binary,
pass the subcommand through over versioned JSON-lines on stdio. ls --db / show skip the
build and read the state db directly via core::inspect.
SDK registration: #[cocoindex::app] + #[cocoindex::lifespan] via linkme (same
mechanism as #[cocoindex::function]), #[cocoindex::main] dispatch, Environment::from_registered(), EnvironmentBuilder::on_shutdown — the CLI path and
the user's own main initialize environments through the identical lifespans
(Rust analogue of @coco.lifespan + import)
new crate rust/cli/: ls [--db], show, update [-L] [--full-reprocess] [--preview] [--reset], drop [--db-only], init scaffold, --env-file
migrate examples/rust/text_embedding as the validating example (cocoindex update, -L, --preview, show, drop all work; cargo run -- query untouched)
Phase 2 (follow-up issue once this lands): ship the binary in the Python wheels (ruff-style)
and replace the click front-end with a thin python -m cocoindex protocol child — one CLI
for both SDKs.
Part of #2273. Spec:
dev/plans/rust-cli.md(lands with the first PR).One Rust binary with the same commands as the Python CLI. Pipeline logic is compiled into the
user's binary, so the CLI works like
cargo run: build the crate, run the user's binary,pass the subcommand through over versioned JSON-lines on stdio.
ls --db/showskip thebuild and read the state db directly via
core::inspect.#[cocoindex::app]+#[cocoindex::lifespan]via linkme (samemechanism as
#[cocoindex::function]),#[cocoindex::main]dispatch,Environment::from_registered(),EnvironmentBuilder::on_shutdown— the CLI path andthe user's own
maininitialize environments through the identical lifespans(Rust analogue of
@coco.lifespan+ import)cli::try_dispatch()handling__coco ls|update|drop+ protocol events(
start/progress/preview/done/error), exit codes, version handshakerust/cli/:ls [--db],show,update [-L] [--full-reprocess] [--preview] [--reset],drop [--db-only],initscaffold,--env-fileexamples/rust/text_embeddingas the validating example (cocoindex update,-L,--preview,show,dropall work;cargo run -- queryuntouched)Phase 2 (follow-up issue once this lands): ship the binary in the Python wheels (ruff-style)
and replace the click front-end with a thin
python -m cocoindexprotocol child — one CLIfor both SDKs.