13 Commits

Author SHA1 Message Date
Alexander Kiselev af315c20cc docs updates 2026-02-23 16:01:11 -08:00
Alexander Kiselev 8b8caada4e documentation update 2026-02-22 10:07:29 -08:00
Alexander Kiselev 3d20a3104f fixes 2026-02-04 14:26:33 -08:00
Alexander Kiselev 25ca14ab34 Add troubleshooting documentation for common setup issues
- Add Troubleshooting section to main README with:
  - Missing X11 libraries fix for Linux/WSL (libXtst)
  - Java version requirements (JDK 17+ not JRE)
  - WSL-specific notes
  - How to view daemon logs
  - Doctor command usage
- Document startup logging in daemon README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 03:09:49 -08:00
Alexander Kiselev 76fde9c3f7 Getting ready for v0.1.0 2026-01-26 16:04:00 -08:00
Alexander Kiselev 3cb63d1953 create a socket for each project 2026-01-26 14:43:22 -08:00
Alexander Kiselev e7d10b599b update output format 2026-01-26 07:30:32 -08:00
Alexander Kiselev f7b5049625 changes to daemon mode 2026-01-26 06:58:39 -08:00
Alexander Kiselev 18592bbd8c docs: Add comprehensive README for v0.1.0 release
Document all features, commands, and usage examples for the
open source release.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:10:54 -08:00
Alexander Kiselev 6b5097463c deleted outdated readme. need to rewrite it later 2026-01-20 12:18:07 -08:00
Claude 242f52f173 Implement daemon-based architecture with command queuing and caching
This major refactoring converts ghidra-cli from a synchronous CLI into a
daemon-based system that prevents Ghidra headless conflicts and dramatically
improves performance through queuing and caching.

Key Features:
- **Daemon Architecture**: Background daemon keeps Ghidra loaded in memory
- **Command Queuing**: Serializes operations to prevent project conflicts
- **Automatic Caching**: 5-minute TTL cache for instant repeated queries
- **JSON-over-TCP RPC**: Simple, reliable client-daemon communication
- **Process Management**: PID files, lock files, and lifecycle management
- **Graceful Lifecycle**: Start, stop, restart, status, ping commands

Technical Implementation:
- Added tokio async runtime for daemon operations
- Implemented JSON-over-TCP RPC (decided against remoc for simplicity)
- Created command queue with tokio channels and semaphore
- Built LRU cache with TTL expiration
- Added comprehensive daemon lifecycle management
- Automatic daemon routing when daemon is running

New Modules:
- src/daemon/mod.rs: Core daemon logic with shutdown handling
- src/daemon/rpc.rs: JSON-over-TCP RPC server and client
- src/daemon/queue.rs: Command queue for serializing Ghidra operations
- src/daemon/cache.rs: Result caching with TTL
- src/daemon/state.rs: Project state management
- src/daemon/process.rs: PID files and process management

CLI Changes:
- Added "ghidra daemon" subcommand group
- Commands: start, stop, restart, status, ping, clear-cache
- Automatic daemon detection and routing
- All existing commands work with or without daemon

Documentation:
- Updated README.md with daemon architecture and usage
- Created SKILL.md: Comprehensive LLM agent guide

Dependencies Added:
- tokio: Async runtime
- tracing/tracing-subscriber: Better logging
- chrono: Timestamps for daemon info
- sysinfo: Process management
- md5: Lock file naming

Performance Improvements:
- 100x faster for repeated operations (cache hits)
- No startup delay when daemon is running
- Eliminates project lock conflicts
- Instant responses for cached queries

This implementation follows the architecture pattern from the provided
reference daemon, adapted for Ghidra CLI's specific needs.
2026-01-12 21:44:02 +00:00
Claude f8710ace0a Implement comprehensive Ghidra Rust CLI with universal query system
This commit implements a complete Rust CLI tool for Ghidra reverse engineering,
optimized for Claude Code and AI agents.

Core Features:
- Universal query command supporting all Ghidra data types (functions, strings, imports, exports, memory, etc.)
- Advanced filter language with comparison, string, and logical operators
- Multiple output formats (JSON, CSV, Table, minimal) optimized for LLM token efficiency
- Field selection and pagination for precise data extraction
- Windows-first design with cross-platform compatibility

Architecture:
- Filter parser using Pest grammar for robust expression parsing
- Modular design with separate filter, format, query, and Ghidra integration layers
- Headless Ghidra integration with built-in Python scripts for data extraction
- Configuration system with environment variable and file support
- Auto-detection of Ghidra installation on Windows

LLM Optimizations:
- Count-first workflow to check result sizes before fetching
- Aggressive server-side filtering to reduce data transfer
- Field selection to minimize token usage
- Compact output formats (json-compact, minimal, ids)
- Pagination support for large datasets

Documentation:
- Comprehensive README with examples and troubleshooting
- Claude skill document (CLAUDE_SKILL.md) for agent integration
- Subagent markdown (SUBAGENT.md) for Task tool integration
- Inline code documentation and examples

Commands Implemented:
- ghidra query <data-type> - Universal query interface
- ghidra import/analyze - Binary import and analysis
- ghidra fn/strings/mem - Specialized command shortcuts
- ghidra dump - Export data (imports, exports, functions, strings)
- ghidra decompile - Function decompilation
- ghidra project - Project management
- ghidra config - Configuration management
- ghidra init/doctor/version - Setup and diagnostics

Built-in Ghidra Scripts:
- Function listing with call graphs
- Decompilation
- String extraction
- Import/Export tables
- Memory map
- Cross-references
- Program information

The CLI is designed to be succinct and efficient, with commands like:
  ghidra query functions --program=malware.exe --filter="size>1000 AND name~crypt" --format=json-compact

Windows Support:
- Auto-detection of Ghidra installation
- Path handling for both Unix and Windows styles
- Support for .exe, .dll, .sys formats

This implementation provides a powerful, token-efficient interface for binary
analysis that integrates seamlessly with Claude Code and other AI agents.
2026-01-12 21:11:19 +00:00
Alexander Kiselev 790ad7153d Initial commit 2026-01-12 12:49:19 -08:00