mirror of
https://github.com/encounter/ghidra-cli.git
synced 2026-07-10 03:18:56 -07:00
1.1 KiB
1.1 KiB
Agent Instructions
Critical Rules
- Tests require Ghidra. Tests use
require_ghidra!()to check availability; when Ghidra is not installed, tests are skipped (silent pass). This is intentional for local development. CI environments must have Ghidra installed. - DEFAULT OUTPUT FORMAT should be human and agent readable, NOT JSON. Use
--jsonand--prettyfor JSON output. Exception: when stdout is not a TTY (piped/scripted), the default auto-detects toJsonCompactfor machine consumption — this is standard Unix pipe convention.
Architecture
ghidra-cli uses a direct bridge architecture:
- CLI connects directly to a Java bridge running inside Ghidra's JVM via TCP
- The bridge is a GhidraScript (
GhidraCliBridge.java) started viaanalyzeHeadless -postScript - Bridge binds
ServerSocket(0)on localhost, writes port/PID files for discovery - One bridge per project, identified by
~/.local/share/ghidra-cli/bridge-{md5}.port - Import/Analyze commands auto-start the bridge if not running
- No separate Rust daemon process — the Java bridge IS the persistent server