parasite

Development

Build

# Full workspace
cargo build

# Individual crates
cargo build -p parasite-core
cargo build -p parasite-agent
cargo build -p parasite-client

# Release
cargo build --release

Project Structure

parasite/
├── Cargo.toml              Workspace root
├── docs/                   Documentation (this wiki)
├── crates/
│   ├── parasite-core/      Shared library
│   │   ├── config/         Config template (config.toml)
│   │   ├── scripts/        Remote operation scripts
│   │   │   ├── unix/       Bash (Linux/macOS)
│   │   │   └── windows/    PowerShell (Windows)
│   │   └── src/
│   ├── parasite-agent/     Remote agent
│   └── parasite-client/    TUI client
├── install.sh              Agent install script
└── uninstall.sh            Agent uninstall script

Adding a New Action

  1. Add a variant to the Action enum in action.rs
  2. Add a handler in the appropriate app/dispatch/*.rs module
  3. Add a match arm in app/dispatch/mod.rsdispatch_action()
  4. If UI changes are needed, update the relevant component

Adding a New Message Type

  1. Add variants to the Message enum in parasite-core/src/protocol.rs
  2. Add agent handling in parasite-agent/src/session.rs (or file_ops.rs)
  3. Add client handling in app/dispatch/network.rs (for incoming messages)
  4. Add send logic in the appropriate dispatch module (for outgoing messages)

Adding a New Component

  1. Create the component file in components/
  2. Implement the Component trait:
    • handle_key_event() — return Action variants
    • handle_action() — react to state changes
    • render() — draw with ratatui
  3. Add a View variant if it needs its own screen
  4. Wire it into App::draw() and App::handle_event()

Code Organization Conventions

Linting

cargo clippy --workspace

The only expected warning is exit_code never read in action.rs (reserved for future use).