Skip to content

v3.7.0-alpha.1 β€” Faster CLI for plugin scripts (cli-core split)

Pre-release
Pre-release

Choose a tag to compare

@ruvnet ruvnet released this 05 May 17:46

What this release does for you

If you're a plugin author writing scripts that spawn the Ruflo CLI to read or write memory, this release gives you a way to make those scripts up to 22.9Γ— faster on a fresh dev machine. If you're an end user running `npx ruflo` or `npx @claude-flow/cli@latest` directly, nothing changes β€” everything works the same.

The problem we fixed

When a plugin script does something like:

```bash
npx @claude-flow/cli@latest memory store --key foo --value bar
```

…on a developer's machine for the first time, it takes about 35 seconds to download and start the full CLI before it can do anything. That's because the full CLI ships with everything β€” vector search (ONNX), SQLite, the entire MCP tool registry, ML libraries β€” and `npx` has to fetch all 1,146 files (10.5 MB unpacked) before running.

Plugin scripts that do this several times in a row would routinely race the 30-second MCP startup timeout and get killed before producing any output. Multiple users reported this as silent failures.

What we did about it

We split the CLI into two packages:

Package Size What's in it
`@claude-flow/cli-core` (new) 156 KB unpacked Memory commands + MCP tool definitions only. No SQLite, no vector search, no ML.
`@claude-flow/cli` (existing) 10.5 MB unpacked Everything β€” same as before

Plugin authors can now write:

```bash

Old (full CLI, ~35s cold-cache):

npx @claude-flow/cli@latest memory store --key foo --value bar

New (lite CLI, ~1.5s cold-cache):

npx @claude-flow/cli-core@alpha memory store --key foo --value bar
```

…or use the recommended opt-in pattern in their scripts:

```javascript
const cliPkg = process.env.CLI_CORE === '1'
? '@claude-flow/cli-core@alpha' // fast lite path
: '@claude-flow/cli@latest'; // full features
```

Set `CLI_CORE=1` in your env when you want the speedup. Leave it unset to keep using the full CLI.

Measured speedup

Reproducible benchmark at `v3/@claude-flow/cli-core/scripts/cold-cache-bench.sh` (N=3 runs, macOS, Node 22, redirected npm cache):

Condition Mean time
Full CLI, cold cache 34.89s
Full CLI, warm cache 16.69s
cli-core, cold cache 1.53s
cli-core, warm cache 1.36s

Speedup: 22.9Γ— on cold cache, 12.3Γ— on warm cache.

What you need to know

  • βœ… Nothing breaks for existing users. The full CLI still has every command, hook, MCP tool, and integration. Same behavior, same outputs.
  • βœ… The full CLI got a tiny bit smaller too. 1,229 lines of duplicated code were removed by re-exporting them from cli-core.
  • ⚠️ The lite CLI is opt-in and limited. It only handles `memory store/retrieve/list/search/delete/stats`. Search degrades from semantic vector to substring match. For everything else (swarm, hooks, neural, agents, init, daemon, etc.) you still need the full CLI.
  • ⚠️ Storage format is different. The lite CLI writes to `.swarm/memory.json`. The full CLI writes to `.swarm/memory.db`. They don't share data. If you switch a plugin from one to the other, treat it as a fresh start for that namespace.

Plugin scripts already migrated

Eight plugin scripts in this repo are already CLI_CORE-aware and can be referenced as templates:

  • `plugins/ruflo-cost-tracker/scripts/{track,budget,summary,conversation,federation,export}.mjs`
  • `plugins/ruflo-adr/scripts/{verify,import}.mjs`

Trying it out

```bash

Lite CLI (fast for plugin scripts):

npx @claude-flow/cli-core@latest --help

Full CLI (unchanged):

npx @claude-flow/cli@latest --version

β†’ 3.7.0-alpha.1

Or via the umbrella packages:

npx ruflo@latest --version
npx claude-flow@latest --version
```

Reproduce the benchmark on your hardware

```bash
git clone https://github.com/ruvnet/ruflo.git
cd ruflo
bash v3/@claude-flow/cli-core/scripts/cold-cache-bench.sh
```

The script redirects npm cache to a temp dir, so it never touches your real `~/.npm`.

Packages published in this release

Package Version Tags
`@claude-flow/cli` 3.7.0-alpha.1 `latest`, `alpha`, `v3alpha`
`claude-flow` 3.7.0-alpha.1 `latest`, `alpha`, `v3alpha`
`ruflo` 3.7.0-alpha.1 `latest`, `alpha`
`@claude-flow/cli-core` 3.7.0-alpha.5 `latest`, `alpha`

What's next

  • Hooks command surface for cli-core β€” the 9th plugin script (`outcome.mjs`) is currently blocked because cli-core only ships hooks tool definitions, not handlers. Future fire splits the handlers like memory was split.
  • Larger metapackage refactor β€” making `@claude-flow/cli` itself lazy-load extras (sql.js, ONNX, HNSW) only when the matching command is invoked. Today the foundation modules are shared via cli-core; deeper modules still load eagerly.

Refs