Skip to content

πŸ–₯️ CLI UX auditΒ #236

Closed
Closed

Description

@hurttlocker

Problem

The CLI grew organically across 9 releases. Commands were added as features shipped, not designed as a cohesive interface. For v1.0, the CLI should feel intentional.

Audit Areas

1. Help Text Consistency

Every command should have:

  • One-line description (shows in cortex --help)
  • Detailed description with examples (shows in cortex <cmd> --help)
  • Flag descriptions that explain what the flag does, not just what it is

Bad: --mode string search mode
Good: --mode string search strategy: bm25 (exact keywords), semantic (conceptual), hybrid (both, default), rrf (rank fusion)

2. Flag Naming Consistency

Audit for inconsistencies:

  • Is it --limit or --max or -n? Pick one pattern.
  • Is it --source or --provider?
  • Is it --agent everywhere?
  • Do boolean flags use --no-X consistently? (--no-enrich, --no-classify, --no-infer)

3. Output Format

  • Default output should be human-readable (aligned columns, colors for TTY)
  • --json flag on every command that returns data (for scripting/piping)
  • --quiet flag to suppress non-essential output (for cron jobs)

4. Command Grouping

Current: flat list of ~20 commands. Consider logical grouping:

Memory:    import, search, extract, classify, cleanup, reimport
Observe:   stats, stale, conflicts, alerts
Graph:     graph (serve + CLI queries)
Connect:   connect add/sync/schedule/list
LLM:       reason, summarize, expand (or are these flags, not commands?)
System:    mcp, embed, optimize, version

5. Shell Completion

  • Generate completion scripts for bash, zsh, fish
  • cortex completion bash > /etc/bash_completion.d/cortex
  • Cobra has built-in support β€” wire it up

6. Discoverability

  • cortex with no args should show a helpful overview, not just the flag list
  • Include "Quick start" in the root help text
  • cortex doctor command that checks: DB exists, embeddings available, LLM keys configured, connectors set up

Acceptance Criteria

  • Every command has examples in --help
  • Flag naming is consistent across all commands
  • --json output available on search, stats, stale, conflicts, agents
  • Shell completions generated and documented
  • cortex doctor command validates installation health
  • Root cortex help shows logical command groups

Activity

  1. added
    v1.0
    dx
    on Feb 25, 2026
  2. hurttlocker commented on Feb 26, 2026

    @hurttlocker
    OwnerAuthor

    All acceptance criteria met:

    Shipped in ab53871:

    • βœ… Root help organized into 7 logical groups (Memory, Facts, Observe, Knowledge Graph, LLM, Maintenance, Connectors, Integration)
    • βœ… Quick Start section (4 essential commands)
    • βœ… Shell completions: cortex completion bash|zsh|fish
    • βœ… cortexCommands var as single source of truth for all 31 commands
    • βœ… 60% shorter root help (moved per-command flags to cortex <cmd> --help)
    • βœ… 5 new completion tests

    Pre-existing (verified):

    • βœ… Flag naming: --agent everywhere, --json on 12+ commands, --no-X pattern consistent
    • βœ… cortex doctor command (ac5a54c)
    • βœ… --json on search, stats, stale, conflicts, agents, list, export, cluster, bench, doctor, graph, optimize

    856 test functions, 15 packages green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxv1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions