Development Setup
Prerequisites
- Python 3.10+ - Required for development
- uv - Package manager (recommended)
- Git - Version control
- IDA Pro - For testing plugin functionality (optional)
Getting Started
Clone the Repository
git clone https://github.com/HexRaysSA/ida-hcli.git
cd ida-hcli
Setup Development Environment
Using uv (recommended):
uv sync --extra dev
Using pip:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
Verify Installation
uv run hcli --version
Testing
Run tests:
uv sync --extra test
uv run pytest
Project Structure
ida-hcli/
├── src/hcli/ # Main package
│ ├── commands/ # CLI command implementations
│ │ ├── auth/ # Authentication commands
│ │ ├── license/ # License management
│ │ └── share/ # File sharing
│ ├── lib/ # Core libraries
│ │ ├── api/ # API clients
│ │ ├── auth/ # Authentication logic
│ │ ├── config/ # Configuration management
│ │ └── util/ # Utilities
│ ├── env.py # Environment configuration
│ └── main.py # Entry point
├── tests/ # Test suite
├── docs/ # Documentation
├── pyproject.toml # Project configuration
└── uv.lock # Dependency lock file
Architecture Overview
Command Structure
Commands are organized hierarchically using Click:
# src/hcli/commands/__init__.py
def register_commands(cli):
cli.add_command(auth_group)
cli.add_command(license_group)
cli.add_command(share_group)
Each command group is implemented as a separate module with subcommands.
Development Guidelines
Adding New Commands
- Create command module in appropriate group
- Use
@async_command
decorator for async operations - Add
@require_auth
for commands that require authentication - Follow existing patterns for error handling
Example:
@async_command
@require_auth
async def my_command():
"""My new command."""
# Implementation here
Building and Packaging
Build Package
uv build
Install Local Build
pip install dist/ida_hcli-*.whl
Create Development Build
uv pip install -e .