Skip to content

Release v1.1.0: Major CLI Refactor and Feature Enhancements#7

Open
Karib0u wants to merge 26 commits intomainfrom
new-commands
Open

Release v1.1.0: Major CLI Refactor and Feature Enhancements#7
Karib0u wants to merge 26 commits intomainfrom
new-commands

Conversation

@Karib0u
Copy link
Copy Markdown
Owner

@Karib0u Karib0u commented Dec 8, 2025

Summary

This release introduces a major architectural overhaul of the CLI, significant CI/CD improvements, and comprehensive documentation updates. The project now follows an opinionated 4-command workflow for better UX and introduces modern Python tooling standards.

🎯 Major Changes

CLI Architecture Refactor

  • BREAKING: Adopted new 4-command CLI structure: init, snapshot, analyze, chat
  • Replaced old commands (summary, ask, oneshot) with more intuitive workflow
  • Enhanced interactive capabilities with conversation history management
  • Improved output formatting and user experience

Version 1.1.0 Features

  • Context handling system for improved binary analysis workflow
  • Conversation history management in agent
  • Enhanced message handling in ReverseEngineeringAgent
  • Parallel decompilation with caching mechanisms for better performance

CI/CD Enhancements

  • Multi-platform Docker builds (amd64 + arm64) with workflow dispatch support
  • Concurrency controls to cancel stale workflow runs
  • Enhanced security with read-only permissions by default
  • Replaced Python syntax checking with ruff format and ruff check
  • Better test isolation and artifact handling
  • Fixed release notes generation with full git history fetching

Code Quality

  • Comprehensive type annotations across the codebase
  • Applied linting fixes and code quality improvements
  • Refactored BinaryArchiveExtractor with improved thread-local management
  • Removed deprecated prompts and dead code
  • Enhanced readability throughout

📝 Documentation

  • Complete README overhaul with new CLI architecture documentation
  • Added CHANGELOG.md following Keep a Changelog format
  • Added NOTICE file for license compliance (Apache 2.0, Ghidra, CAPA)
  • Updated installation guides and usage examples

🐛 Bug Fixes

  • Fixed ASCII art logo rendering in CLI banner
  • Fixed CI release notes to fetch full git history
  • Improved Docker entrypoint for reliable streaming output

🧪 Testing

  • New snapshot fixtures for comprehensive testing
  • Enhanced test coverage for conversation history management
  • Multi-platform build testing in CI

🔧 Infrastructure

  • Dockerfile improvements for better functionality
  • Modular installation system
  • Better dependency management
  • Added demo/ directory to .gitignore

Breaking Changes

⚠️ CLI Command Changes: The old command structure has been replaced:

  • summaryanalyze
  • askchat
  • oneshotanalyze --json
  • New init command for initial configuration
  • New snapshot command for managing extraction artifacts

Migration Guide

For users upgrading from v1.0.x:

# Old workflow
kernagent summary binary.exe
kernagent ask binary.exe "question"

# New workflow  
kernagent init                    # One-time setup
kernagent analyze binary.exe      # Replaces summary
kernagent chat binary.exe         # Replaces ask

Test Plan

  • CI passes on all platforms (Ubuntu latest)
  • Multi-platform Docker builds (amd64, arm64)
  • All unit tests passing
  • Linting checks passing (ruff format + check)
  • Documentation builds correctly
  • Installation script tested on Linux/macOS/WSL2

🤖 Generated with Claude Code

Karib0u and others added 26 commits December 4, 2025 22:50
This major refactor simplifies the user experience into four distinct
workflows: Setup, Intelligence, Investigation, and Management.

Key Changes:
- CLI: Replace `summary`/`ask`/`oneshot` with `init`, `analyze`, `chat`, `snapshot`.
- Storage: Deprecate ZIP archives in favor of side-by-side `<binary>.snapshot` directories.
- Analysis: Unify prompts into a single `ANALYZE_SYSTEM_PROMPT` for consistent reporting.
- Config: Replace shell scripts with a cross-platform Python `init` wizard.
- Docker: Update wrapper script to allow read-write config mounting for `init` persistence.
- Cleanup: Remove obsolete shell scripts (`kernagent-config`, `kernagent-update`, `kernagent-uninstall`).

BREAKING CHANGE: All previous CLI arguments have changed. Existing .zip snapshots are no longer supported.
- Dockerfile: Added the `-u` flag to the ENTRYPOINT for unbuffered output, enhancing compatibility with Docker's streaming.
- cli.py: Modified output handling in `run_analyze` to use `sys.stdout.write` for consistent flushing, ensuring reliable streaming.
- Updated package version from 1.0.0 to 1.0.3 in uv.lock.
- Introduced a persistent message history in the ReverseEngineeringAgent to maintain context across iterations.
- Updated the run method to utilize the new message history for improved interaction with the LLM.
- Ensured that only user questions and final answers are stored in the message history for clarity and efficiency.
- Added verbose logging for LLM responses to aid in debugging.
- Updated Dockerfile to include `context.py` for improved context management.
- Enhanced `cli.py` to support a new `--full` flag in the `analyze` command, allowing for the generation of a comprehensive multi-agent context.
- Refactored `run_analyze` to utilize the new context management features, ensuring that context is included in analysis outputs.
- Introduced a new method in `SnapshotTools` to retrieve the persisted `BINARY_CONTEXT.md` content.
- Updated prompts to reflect the integration of pre-analysis context in the analysis workflow.
…ence

- Updated Dockerfile to include new files for enhanced CLI functionality.
- Modified ENTRYPOINT to allow direct execution of the kernagent module.
- Added `typer` dependency for improved command-line interface management.
- Refactored CLI to utilize rich console features for better user interaction and feedback.
- Introduced event handling in the agent for real-time updates during processing.
…gement

- Revised README.md to improve clarity and structure, including updates to the Quick Start and Features sections.
- Added tests to ensure the ReverseEngineeringAgent preserves conversation history across interactions and excludes tool calls from history.
- Enhanced CLI command tests to validate context handling and output formatting in analysis commands.
…with parallel decompilation and caching mechanisms

- Bump version in uv.lock to 1.1.0.
- Introduce threading for parallel decompilation of functions, improving performance.
- Implement caching for cross-reference maps and BasicBlockModel to optimize repeated analyses.
- Add methods for adaptive timeout calculation and thread-local decompiler management.
- Enhance function data extraction to include metrics and instruction details without decompilation.
- Removed final markdown render in run_analyze for cleaner output.
- Updated run_chat to display assistant responses using rich Markdown for improved formatting.
…and function processing

- Renamed _ThreadLocalDecompiler to _ThreadLocalEnvironment to better reflect its purpose.
- Enhanced thread-local storage to include monitor and BasicBlockModel instances.
- Updated function processing to utilize thread-local environment for decompilation and analysis.
- Improved error handling and logging during function data extraction and decompilation.
- Streamlined the extraction process to support parallel function processing with adaptive timeout handling.
- Replaced individual file copies with a single command to copy the entire kernagent package, ensuring new modules are automatically included.
- Maintained existing environment variable settings for Python version.
- Introduced a conditional log statement to output the detected binary and its mount point when verbose mode is enabled, enhancing debugging capabilities during container runs.
- Fix all ruff linting errors (unused imports, bare except statements, undefined variables)
- Apply ruff formatting to ensure consistent code style
- Remove unreachable code in oneshot/pruner.py
- Replace bare except clauses with specific Exception handling
- Remove unused variable assignments in tests
- All tests passing (188/188)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add type: ignore comments for Ghidra/Java imports (unavailable outside Ghidra environment)
- Fix type errors in capa_runner.py (layout assignment)
- Fix type errors in config.py (load_dotenv shadowing)
- Fix type errors in oneshot/pruner.py:
  * Ensure string types in _resolve_function_refs
  * Fix file_info["size"] type conversion
  * Fix _dedup_preserve calls with proper None filtering
- Fix type errors in snapshot/extractor.py (Ghidra API calls)
- Fix type errors in snapshot/tools.py (dict operations)
- Update tests to use Counter instead of dict for string_kind_counts
- All 188 tests passing
- All ty type checks passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Bump versions of `flare-capa` to 9.3.1, `openai` to 2.9.0, and `pytest` to 9.0.2 in `pyproject.toml`.
- Add `ruff` as a new dependency for linting.
- Update `uv.lock` with new package versions and URLs for `anyio`, `certifi`, `click`, and others.
- Enhance CI workflow by adding `ruff` format check and linting steps to ensure code quality.
- Adjust Docker build conditions to include all branches and PRs for better testing coverage.
- Modified the CI configuration to run on all branches instead of just main and develop, enhancing testing coverage across the repository.
- Split long list comprehensions into multiple lines for better readability in build_oneshot_summary function.
- No functional changes made, focusing on code clarity.
- Restrict CI triggers to main and develop branches to focus on critical development paths.
- Implement concurrency to cancel previous runs on the same branch/PR, optimizing resource usage.
- Set permissions for read-only access by default, with escalated permissions for specific jobs.
- Remove redundant Python syntax check step to streamline the workflow.
- Adjust GitHub Release job permissions to allow necessary write access for creating releases.
- Added manual trigger option for CI with input to test multi-platform builds (amd64 + arm64).
- Adjusted Docker build conditions to accommodate multi-platform testing based on the manual trigger input.
- Streamlined job steps to conditionally skip certain actions when multi-platform testing is enabled.
- Added a conditional check to log detailed warnings only when verbose mode is enabled, enhancing the clarity of error reporting during capa analysis failures.
- Removed outdated workflow sections from README for clarity.
- Updated `init` command description to specify LLM provider setup.
- Enhanced `analyze` and `chat` command descriptions with additional context and images.
- Improved agent's response handling by prompting for analysis if initial content is empty after tool calls.
- Deleted deprecated prompts from `prompts.py` to streamline codebase.
- Updated the formatting of user message appends for clarity and consistency in the ReverseEngineeringAgent class.
- Ensured that the prompt for analysis is consistently structured across multiple instances in the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant