agentsclimarketplace

Ghidra agent cli

Skill ByteLandTechnology/headless-ghidra/ghidra-agent-cli

Headless Ghidra reverse-engineering skill family for reproducible, evidence-backed workflows and audit-ready Markdown outputs.

Install
npx -y skills add ByteLandTechnology/headless-ghidra --skill ghidra-agent-cli

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Rust CLI reference for the headless-ghidra pipeline. Covers command syntax, flags, output contract, artifact paths, and workspace layout for all ghidra-agent-cli subcommands. Load when: constructing a ghidra-agent-cli command, interpreting its output, resolving a flag or artifact path question, or debugging CLI behavior. Do not load for P0–P4 workflow sequencing — use the headless-ghidra skill family instead.

SKILL.md

13.2 KB, ~2.1k tokens by cl100k_base, as published. Nobody here has run it

ghidra-agent-cli

Description

ghidra-agent-cli is the bundled helper for the Headless Ghidra skill family. It owns the command tree, workspace layout, YAML artifact semantics, output envelope, and runtime behavior for supported Ghidra, Frida, progress, and gate operations.

This skill documents the helper command semantics for agents. It does not define the P0–P4 workflow order, stage routing, or orchestration policy. Those are defined by headless-ghidra/SKILL.md and the per-phase skills. Normal users install and use the skill family; they do not manually install, build, or run this CLI during the workflow.

Prerequisites

  • Node.js >= 18
  • Local Ghidra installation discoverable by ghidra-agent-cli ghidra discover
  • Optional Frida installation for frida * commands

Availability

<!-- SEMANTIC_RELEASE_VERSION -->

The helper is installed with the skill family and must remain a sibling of headless-ghidra and the phase skills. If ghidra-agent-cli is unavailable, ask the user to reinstall or refresh the whole skill family rather than installing a separate CLI package inside the target workspace.

Release-managed helper package version: [email protected]. This marker is packaging metadata; do not ask users to install it manually during an analysis workflow.

Invocation

ghidra-agent-cli [GLOBAL FLAGS] <COMMAND> [COMMAND FLAGS]

Input

Global flags:

  • --format yaml|json|toml — Output format (default: yaml)
  • --target <id> — Target selector
  • --workspace <path> — Workspace root path
  • --config-dir <PATH> — Override config directory
  • --data-dir <PATH> — Override data directory
  • --state-dir <PATH> — Override state directory
  • --cache-dir <PATH> — Override cache directory
  • --log-dir <PATH> — Override log directory
  • --lock-timeout <SECS> — Lock acquisition timeout in seconds (default: 30)
  • --no-wait — Do not wait for lock acquisition
  • --help — Show help text

Most commands require --target <id> or an active context set via context use.

Output

Commands emit a structured envelope in the selected format:

status: ok
message: "<summary>"
data: <structured payload>

Errors

Errors are structured and stable:

{
  "code": "E_ERROR",
  "message": "description of what went wrong",
  "source": "main",
  "format": "json"
}

Known codes:

  • E_ERROR — General error
  • E_GATE_FAILED — Gate check failed
  • E_LOCK_TIMEOUT — Lock acquisition timed out

Command Groups

GroupPurpose
workspaceInitialize a target workspace and manage phase state
scopeManage scope.yaml
functions / callgraph / types / vtables / constants / strings / importsManage baseline YAML metadata
third-partyManage third-party/identified.yaml, explicit no-third-party reviews, and pristine source metadata
runtimeManage runtime/run-manifest.yaml and runtime/run-records/*.yaml
hotpathManage runtime/hotpaths/call-chain.yaml
metadataManage P3 metadata YAML such as metadata/renames.yaml and metadata/signatures.yaml
substituteManage P4 substitution records under substitution/functions/<fn_id>/
git-checkValidate artifact YAML files are ready for review when a gate asks for it
execution-logAppend and inspect execution records
progressCompatibility helpers for legacy decompilation progress YAML
gateRun aggregate gate checks and inspect gate reports
ghidraDiscover Ghidra, import/analyze, export baseline, apply changes, import custom headers/signatures, decompile, rebuild
fridaDevice, capture, compare, trace, run, and invoke helpers
inspectRead-only binary inspection helpers
contextActive context helpers
pathsShow resolved workspace/runtime paths
validate / helpValidation and help surfaces

Workspace Model

ghidra-agent-cli uses this active workspace layout:

targets/<target-id>/
└── ghidra-projects/

artifacts/<target-id>/
├── pipeline-state.yaml
├── scope.yaml
├── intake/
├── baseline/
│   ├── functions.yaml
│   ├── callgraph.yaml
│   ├── types.yaml
│   ├── vtables.yaml
│   ├── constants.yaml
│   ├── strings.yaml
│   └── imports.yaml
├── runtime/
│   ├── project/
│   ├── fixtures/
│   ├── run-manifest.yaml
│   ├── run-records/
│   └── hotpaths/call-chain.yaml
├── third-party/
│   ├── identified.yaml
│   ├── pristine/<library>@<version>/
│   └── compat/<library>@<version>/
├── metadata/
│   ├── renames.yaml
│   ├── signatures.yaml
│   ├── types.yaml
│   ├── constants.yaml
│   ├── strings.yaml
│   └── apply-records/
├── substitution/
│   ├── template/
│   ├── next-batch.yaml
│   └── functions/<fn_id>/
│       ├── capture.yaml
│       └── substitution.yaml
├── gates/
└── scripts/

workspace init creates the base workspace structure and initializes pipeline-state.yaml plus scope.yaml. Later phases populate the remaining artifacts.

Artifact Semantics

ArtifactMeaning
pipeline-state.yamlCurrent target, current phase, recorded binary path
scope.yamlExplicit scope mode and entry list
baseline/*.yamlBaseline metadata exported from Ghidra or curated through CLI commands
runtime/run-manifest.yamlP1 reproducible runtime manifest and run-record index
runtime/run-records/*.yamlP1 concrete executable or harness run observations
runtime/hotpaths/call-chain.yamlP1 Frida-derived hotpath call-chain priority source
third-party/identified.yamlIdentified libraries, versions, evidence, source paths, pristine paths, and function classifications; libraries: [] records an explicit no-third-party review
third-party/pristine/<library>@<version>/Unmodified third-party source snapshot that must remain pristine
third-party/compat/<library>@<version>/Compatibility modifications separate from pristine source
metadata/*.yamlP3 recovered names, signatures, types, constants, and strings before CLI-mediated Ghidra apply
metadata/apply-records/*.yamlP3 records for serialized metadata apply attempts
substitution/next-batch.yamlP4 substitution worklist
substitution/functions/<fn_id>/*.yamlP4 function fixtures, captures, substitution records, status, and follow-up data
gates/*-report.yamlPersisted gate check reports

Examples

# Initialize a target
ghidra-agent-cli workspace init --target libfoo --binary ./libfoo.so

# Set scope and inspect state
ghidra-agent-cli --target libfoo scope set --mode full --entries 0x1000,0x2000
ghidra-agent-cli --target libfoo workspace state show

# Export and inspect baseline YAML
ghidra-agent-cli --target libfoo ghidra import
ghidra-agent-cli --target libfoo ghidra auto-analyze
ghidra-agent-cli --target libfoo ghidra export-baseline
ghidra-agent-cli --target libfoo functions list

# Import custom headers and signatures into the current Ghidra program
ghidra-agent-cli --target libfoo ghidra import-types-and-signatures --header ./include/custom_types.h --header ./include/custom_api.h

# Runtime, metadata, substitution, and gate checks
ghidra-agent-cli --target libfoo runtime record --key entrypoint --value 0x401000
ghidra-agent-cli --target libfoo hotpath add --addr 0x401000 --reason runtime
ghidra-agent-cli --target libfoo metadata enrich-function --addr 0x401000 --name main --prototype 'int(void)'
ghidra-agent-cli --target libfoo substitute add --fn-id fn_001 --addr 0x401000 --replacement 'return 0;'
ghidra-agent-cli --target libfoo gate check --phase P1

# Frida helpers
ghidra-agent-cli frida device-list
ghidra-agent-cli frida trace --target ./bin/app --functions open,read

Boundary

  • Use this skill to answer: command names, flags, output shape, artifact paths, file semantics, and CLI behavior.
  • Do not use this skill as the source of truth for P0–P4 sequencing, stage ownership, or workflow decisions. Those live in the headless-ghidra skill family.

What ships with it: 79 files

1123.4 KB alongside SKILL.md, 23 of them executable

frida-scripts/

39 more files not listed here. See all 79 in the repository.

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.