Skip to content

v0.2.2 - Replace CLI Command with Knowledge Graph Integration

Choose a tag to compare

@AlexMikhalev AlexMikhalev released this 06 Oct 19:59
· 657 commits to fix_content since this release

πŸŽ‰ New Features

Replace CLI Command

Added intelligent text replacement functionality to the terraphim-tui CLI using knowledge graph thesaurus and Aho-Corasick pattern matching.

Usage:

# Replace npm with bun
terraphim-tui replace "npm"

# Replace with specific role
terraphim-tui replace "yarn install" --role "Engineer"

# Output as markdown links
terraphim-tui replace "pnpm" --format markdown

Features:

  • βœ… Intelligent text replacement using knowledge graph synonyms
  • βœ… Aho-Corasick LeftmostLongest matching (longer patterns win)
  • βœ… Multiple output formats (PlainText, MarkdownLinks, WikiLinks, HTMLLinks)
  • βœ… Package manager migration support (npm/yarn/pnpm β†’ bun)
  • βœ… Role-specific thesaurus support
  • βœ… Offline mode operation with dynamic thesaurus building

Implementation:

  • Added Replace variant to Command enum in terraphim-tui
  • Comprehensive test suite with 8 test scenarios
  • Documentation updates across @memories.md, @scratchpad.md, @lessons-learned.md
  • Knowledge graph integration with docs/src/kg/bun.md

πŸ› Bug Fixes

Clippy Warnings Resolution

  • Fixed collapsible else-if in terraphim_server/build.rs
  • Replaced bool assert_eq! with assert! in test files
  • Fixed field reassignment with Default pattern
  • Removed needless borrows for generic args
  • Replaced len() > 0 with !is_empty() checks

All pre-commit checks passing βœ…

πŸ“š Documentation

  • CLI implementation patterns documented in @lessons-learned.md
  • LeftmostLongest matching strategy explained
  • OpenDAL warnings documented (informational only)
  • Complete architecture flow diagrams

πŸ”— Links

  • Commit: 0d83dca
  • Branch: fix_content
  • Files Changed: 12 files (+1844, -14)