Skip to content

v0.7.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Feb 23:40

v0.7.0 — CLI Restructure, MCP Gateway, and Quality of Life

This is a major release that restructures the entire CLI from 34 top-level commands to 5 primary commands, adds a unified MCP tool gateway, and fixes critical bugs. Everything is simpler, more discoverable, and more powerful.

What Changed from v0.5.0

CLI Restructured: 34 Commands → 5+1

The old CLI had 34 top-level commands (cx show, cx safe, cx guard, cx trace, cx blame, cx dead, cx impact, cx report, cx render, cx doctor, cx sql, ...). In v0.7.0, everything is organized into 5 primary commands:

Command What it does Replaces
cx [target] Auto-detect: entity lookup, file safety check, context assembly cx show, cx safe, cx context, cx map, cx trace, cx blame
cx find <pattern> Search and discover entities, dead code analysis cx find, cx dead
cx check [file] Quality gate: safety checks, pre-commit guard, test selection cx safe, cx guard, cx test
cx scan Build or rebuild the code graph cx scan (unchanged)
cx call <tool> Machine gateway for MCP tools New
cx admin Administrative commands (db, tags, branches, etc.) cx db, cx tag, cx doctor, cx sql, cx history, etc.

All old commands still work — they're hidden from help output but fully functional for backwards compatibility.

Auto-Detect Dispatcher (cx)

The bare cx command now auto-detects what you need:

cx                                 # Session recovery context
cx LoginUser                       # → shows entity details (was: cx show)
cx src/auth/login.go               # → safety check (was: cx safe)
cx --smart "add auth" --budget 8000 # → task context (was: cx context --smart)
cx --map                           # → project skeleton (was: cx map)
cx --diff                          # → context for changes (was: cx context --diff)
cx --trace LoginUser               # → trace call chains (was: cx trace)
cx --blame LoginUser               # → entity history (was: cx blame)

Context flags (--budget, --depth, --hops, --with-coverage, --commit-range) are now available directly on the root command — no need to use the full cx context subcommand.

Unified Quality Gate (cx check)

A single command replaces three separate quality commands:

cx check src/auth/login.go         # Safety check (was: cx safe)
cx check                           # Pre-commit guard (was: cx guard)
cx check --test                    # Smart test selection (was: cx test --diff)
cx check --test --gaps             # Coverage gap analysis
cx check --test --run              # Run affected tests
cx check --coverage                # Coverage summary

All pass-through flags work: --threshold, --depth, --diff, --commit, --drift, --quick.

cx find --dead (Dead Code in Find)

Dead code detection is now integrated into cx find:

cx find --dead                     # Conservative: private + zero callers
cx find --dead --tier 2            # Include probable dead code
cx find --dead --tier 3 --chains   # Full analysis with chain grouping

cx admin Real Command Group

cx admin is now a real cobra command group with working subcommands:

cx admin db info                   # Database statistics
cx admin db compact                # Compact the database
cx admin tag add Foo important     # Tag an entity
cx admin tag list                  # List all tags
cx admin doctor                    # Health check
cx admin sql "SELECT ..."          # Direct SQL query
cx admin blame LoginUser           # Entity commit history
cx admin impact file.go            # Blast radius analysis

cx call — Unified MCP Tool Gateway (New)

A single command to invoke any of the 14 MCP tools directly from the CLI:

cx call --list                              # See all tools with parameter schemas
cx call context '{"smart":"add auth","budget":8000}'
cx call safe '{"target":"src/api/handler.go"}'
cx call find '{"pattern":"LoginUser"}'
cx call show '{"name":"Store","density":"dense"}'
cx call map '{}'

# Pipe mode: multiple calls, single process
echo '{"tool":"cx_find","args":{"pattern":"Store"}}' | cx call --pipe

Tool names accept shorthand: find = cx_find.

6 New MCP Tools (8 → 14 Total)

The MCP server (cx serve) now exposes 14 tools, up from 8:

New Tool Description
cx_blame Entity commit history — track how code changed over time
cx_tag Entity tag management — add, remove, list, find by tags
cx_trace Call chain tracing — find paths, callers, callees in the graph
cx_dead Dead code detection — 3 confidence tiers with chain grouping
cx_test Smart test selection — find affected tests, coverage gaps
cx_guard Pre-commit quality checks — signature drift, dead-on-arrival detection

Default tools (enabled by default): cx_context, cx_safe, cx_show, cx_find, cx_map, cx_trace, cx_tag, cx_guard

All 14 tools available with cx serve or limited with cx serve --tools=context,safe,find.

Bug Fixes

  • Fixed daemon spawn storm — The background daemon could spawn infinite child processes on systems where auto-start failed. Added CX_DAEMON_CHILD env var guard to prevent recursive spawning.
  • Fixed noisy error output — Errors no longer dump 30+ lines of usage text. Added SilenceUsage: true to the root command.
  • Fixed pre-commit guard — Added dead-on-arrival check for new private entities that are never called.

Improvements

  • Clean error messages — Errors print just the error, not the full help text
  • Context flags on root command — --budget, --depth, --hops, --with-coverage, --commit-range work directly with cx --smart
  • Pass-through flags on check — --threshold, --depth, --diff, --commit work with cx check --test
  • Documentation in help text — Root command help explains "for advanced flags, use the full command"

Release Infrastructure

  • Linux ARM64 binary — New platform support
  • SHA256 checksums — All binaries include checksums for verification
  • Improved macOS builds — Cross-compilation for darwin-amd64 on Apple Silicon runners
  • Updated Go version — Built with Go 1.25

Installation

Download the binary for your platform:

# Linux (amd64)
curl -L https://github.com/hargabyte/cortex/releases/download/v0.7.0/cx-linux-amd64 -o cx
chmod +x cx && sudo mv cx /usr/local/bin/

# Linux (arm64)
curl -L https://github.com/hargabyte/cortex/releases/download/v0.7.0/cx-linux-arm64 -o cx
chmod +x cx && sudo mv cx /usr/local/bin/

# macOS (Apple Silicon)
curl -L https://github.com/hargabyte/cortex/releases/download/v0.7.0/cx-darwin-arm64 -o cx
chmod +x cx && sudo mv cx /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/hargabyte/cortex/releases/download/v0.7.0/cx-darwin-amd64 -o cx
chmod +x cx && sudo mv cx /usr/local/bin/

Windows: Download cx-windows-amd64.exe and add to PATH.

Quick Start

cd your-project
cx scan              # Build the code graph
cx --smart "task"    # Get task-focused context
cx find Login        # Search for entities
cx check file.go     # Safety check before editing

See the README for full documentation.