ghidra-cli
Automate Ghidra reverse engineering from the command line — headless analysis, decompilation, and structured JSON output for AI agents like Claude Code
What is ghidra-cli?
Automate Ghidra reverse engineering from the command line — headless analysis, decompilation, and structured JSON output for AI agents like Claude Code
Overview of ghidra-cli
What it is
Ghidra CLI is a Rust command-line tool for automating Ghidra reverse engineering tasks. It connects directly to a Java bridge running inside Ghidra's JVM, allowing headless analysis, decompilation, and structured JSON output. The bridge auto-starts on demand, and Ghidra stays resident in memory for sub-second query response times. The tool is designed for direct use by hand or by AI coding agents such as Claude Code.
Key features
- Direct bridge architecture with auto-start and sub-second queries
- Program analysis: functions, symbols, types, strings, cross-references
- Type system: create/edit structs, enums, typedefs; add/remove struct fields
- Function signatures: edit return types, calling conventions, full C signatures; retype variables
- Binary patching: modify bytes, NOP instructions, export patches
- Call graphs: generate caller/callee graphs, export to DOT format
- Search capabilities: find strings, bytes, functions, crypto patterns
- Script execution: run Java/Python Ghidra scripts, inline or from files
- Batch operations: execute multiple commands from a file
- Responsive job control: read-only commands run concurrently, writes run exclusively, control plane stays live
- Flexible output: human-readable, JSON, or pretty JSON formats
- Filtering: expression-based filtering with a small DSL (e.g.,
size > 100 AND name ~ 'crypt')
Use cases
Automate reverse engineering workflows from the command line, integrate with AI agents like Claude Code for structured analysis, analyze multiple binaries concurrently using separate bridge processes, perform headless analysis in CI/CD pipelines, and quickly extract function signatures, decompiled code, or cross-references without launching the Ghidra GUI.
Getting started
Install from source:git clone https://github.com/akiselev/ghidra-clicd ghidra-clicargo install --path .Requirements: Ghidra 11+, a full JDK (not JRE), Rust 1.70+. Point the CLI at your Ghidra install with export GHIDRA_INSTALL_DIR=/path/to/ghidra or use ghidra config set.Quick start commands:ghidra doctorghidra import ./binary --project myproject --program mybinaryghidra function listghidra decompile mainghidra find string "password"ghidra x-ref to 0x401000ghidra graph callers main --depth 3
License and pricing
License: GPL-3.0. Pricing: open source (free).
Based on the project's public README and repository metadata.