commandchronicles

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 36 Imported by: 0

README ΒΆ

CommandChronicles CLI (ccr)

===================================================================
                CommandChronicles CLI (ccr) v0.1.0
===================================================================

  πŸš€ A modern shell history management tool that supercharges
     your command line experience with intelligent search
                and secure local storage

===================================================================

Version License Go Version

CommandChronicles CLI transforms your shell history into a powerful knowledge base, capturing rich context for every command and providing lightning-fast search capabilities through an intuitive TUI interface.

✨ Key Features

  • πŸ” Military-grade encryption (XChaCha20-Poly1305) for your command history
  • πŸ” Blazing-fast fuzzy search with real-time interactive TUI (Ctrl+R)
  • πŸ“Š Rich command metadata (exit codes, duration, working directory, git info)
  • 🐚 Seamless shell integration for bash and zsh with automatic setup
  • πŸ”‘ Secure key derivation (Argon2id) and session management
  • ⚑ Smart caching system for instant search results
  • πŸ“ˆ Beautiful command statistics and usage analytics

πŸš€ Quick Start

Installation
# One line install
curl -sSL https://get.commandchronicles.dev | bash

#or

# Clone the repository
git clone https://github.com/NeverVane/commandchronicles.git
cd commandchronicles

# Build the binary
go build -o ccr

# Move to your PATH
sudo mv ccr /usr/local/bin/
Initial Setup
# Initialize CommandChronicles
ccr init

# Automatically install shell hooks (recommended)
ccr install-hooks --auto

# Or manually install for specific shell
ccr install-hooks zsh
ccr install-hooks bash

# Enable auto-sync daemon (recommended)
ccr daemon-control install-service
ccr daemon-control start

After installation, restart your shell or run:

source ~/.zshrc  # for zsh
source ~/.bashrc # for bash

πŸ“– Usage

Interactive Search (TUI)

Press Ctrl+R in your shell to launch the interactive TUI search interface.

TUI Key Bindings:

  • ↑/↓ - Navigate through commands
  • Enter - Copy command to shell prompt
  • Ctrl+J - Execute command immediately
  • Tab - View detailed command information
  • Ctrl+F - Toggle fuzzy search
  • Ctrl+S - Show only successful commands
  • Ctrl+X - Show only failed commands
  • Ctrl+T - View statistics
  • Ctrl+K - Clear search
  • ? - Show help
  • Esc/Ctrl+C - Exit

Important TUI Behavior:

  • Shell Integration Required: Command injection (Enter/Ctrl+J) only works when TUI is launched via Ctrl+R after installing shell hooks
  • Direct TUI Calls: Running ccr tui directly will show the interface but cannot inject commands into your shell
  • Recommended Usage: Always use Ctrl+R for interactive command search and selection
  • Installation: Run ccr install-hooks to enable full TUI functionality
# Search for commands containing "git"
ccr search git

# Search with fuzzy matching
ccr search --fuzzy "gt sttus"

# Filter by exit code
ccr search --exit-code 0 "docker"

# Filter by directory
ccr search --directory /project "npm"

# Filter by time
ccr search --since 1h "build"
ccr search --since 2d --until 1d "test"
Statistics
# View command usage statistics
ccr stats

# Export statistics as JSON
ccr stats --format json > stats.json
Import/Export
# Import existing shell history
ccr import ~/.bash_history --format bash
ccr import ~/.zsh_history --format zsh

# Export command history
ccr export --format json > commands.json
ccr export --format bash > commands.bash
Session Management
# Lock your command history (requires password)
ccr lock

# Unlock for searching
ccr unlock

# Change password
ccr change-password

πŸ”§ Configuration

CommandChronicles stores its configuration in ~/.config/commandchronicles/config.toml.

Example Configuration
[cache]
hot_cache_size = 2000      # Number of recent commands to keep in memory
search_batch_size = 5000   # Commands to load per search batch
max_memory_mb = 100        # Maximum memory usage

[security]
session_timeout = 7776000  # Session timeout in seconds (90 days)
argon2_time = 3           # Argon2 time parameter
argon2_memory = 65536     # Argon2 memory parameter (KB)

[shell]
auto_install = false      # Auto-install shell integration
graceful_degradation = true # Fallback if ccr is unavailable

[tui]
animations = true         # Enable TUI animations
color_scheme = "auto"     # Color scheme: auto, dark, light
results_per_page = 20     # Results per page in TUI

πŸ›‘οΈ Security

CommandChronicles takes your privacy seriously:

  • All command history is encrypted using XChaCha20-Poly1305
  • Passwords are processed using Argon2id key derivation
  • Session keys are stored securely with configurable timeouts
  • All data is stored locally - no cloud services or telemetry ( optional )
  • Secure memory handling prevents sensitive data from being swapped to disk

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Leonardo Zanobi

πŸ™ Acknowledgments

  • Bubble Tea for the amazing TUI framework
  • Bleve for powerful full-text search
  • Cobra for CLI structure
  • The Go community for excellent cryptography libraries

Made with ❀️ by Leonardo Zanobi

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
tui
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL