| Crates.io | legionnaire |
| lib.rs | legionnaire |
| version | 0.1.3 |
| created_at | 2025-08-27 00:48:24.745831+00 |
| updated_at | 2025-08-27 20:56:47.756758+00 |
| description | โ๏ธ Legionnaire - Secure IRC client with Legion Protocol support |
| homepage | |
| repository | https://github.com/exec/legionnaire |
| max_upload_size | |
| id | 1812062 |
| size | 5,314,060 |
A production-ready IRC client with modern features, E2E encryption, and comprehensive functionality.
Built in Rust with security, performance, and usability as core principles. Part of the Legion Protocol ecosystem.
git clone https://github.com/dylan-k/legionnaire
cd legionnaire
cargo build --release
# Install directly from git
cargo install --git https://github.com/dylan-k/legionnaire
# Or using pre-built binaries
wget https://github.com/dylan-k/legionnaire/releases/latest/download/legionnaire-linux-x64.tar.gz
tar -xzf legionnaire-linux-x64.tar.gz
sudo cp legionnaire /usr/local/bin/
legionnaire # Launch GUI application
legionnaire --setup # Run setup wizard
legionnaire --tui # Clean terminal interface
legionnaire --tui --setup # Setup with TUI
legionnaire --cli send "#channel" "Hello world"
legionnaire --cli join "#newchannel"
legionnaire --cli --server "irc.libera.chat" --nick "mybot"
# Start bouncer daemon
legionnaire --bouncer --daemon
# Connect client to bouncer
legionnaire --connect-bouncer localhost:8080
Config location: ~/.config/legionnaire/config.toml
[user]
nickname = "yournick"
username = "yournick"
realname = "Your Name"
[[servers]]
name = "Libera Chat"
host = "irc.libera.chat"
port = 6697
tls = true
verify_certificates = true
channels = ["#rust", "#programming"]
# Bouncer configuration
[bouncer]
enabled = true
bind = "127.0.0.1:8080"
password = "secure_bouncer_password"
log_retention_days = 30
# End-to-end encryption
[encryption]
enabled = true
auto_accept_keys = false
key_rotation_interval = "7 days"
# Plugin system
[plugins]
enabled = ["e2ee", "weather_bot", "reaction_handler"]
e2ee_plugin_path = "./plugins/e2ee.so"
[ui]
mode = "gui" # gui, tui, cli
theme = "dark"
font_size = 12
notifications = true
[keybindings.tui]
quit = "Ctrl+c"
help = "Ctrl+h"
next_channel = "Ctrl+n"
prev_channel = "Ctrl+p"
# Enable end-to-end encryption
/plugin load e2ee
# Generate new key pair
/e2ee keygen
# Share public key with channel
/e2ee share-key #channel
# Encrypt message
/encrypt #channel "Secret message"
# Load weather bot
/plugin load weather_bot
# Get weather information
/weather London
/forecast Tokyo 5d
# Load reaction system
/plugin load reactions
# React to a message
/react :thumbsup: @msgid_12345
# View reactions
/reactions show #channel
Create custom plugins using the plugin API:
use legionnaire_plugin::{Plugin, PluginResult, Context};
#[derive(Default)]
pub struct MyPlugin;
impl Plugin for MyPlugin {
fn name(&self) -> &str {
"my_custom_plugin"
}
fn handle_command(&mut self, ctx: &Context, cmd: &str, args: &[&str]) -> PluginResult {
match cmd {
"myplugin" => {
ctx.send_message("Plugin command executed!").await?;
PluginResult::Handled
}
_ => PluginResult::NotHandled
}
}
}
Legionnaire uses the Phalanx protocol for group end-to-end encryption:
# Initialize encryption for a channel
/e2ee init #securechannel
# Key exchange with participants
/e2ee handshake alice bob carol
# Send encrypted message
/encrypt #securechannel "This message is E2E encrypted"
# Verify key fingerprints
/e2ee verify alice
# Start bouncer daemon
sudo systemctl start legionnaire-bouncer
# Configure bouncer settings
legionnaire --bouncer --config
# Connect multiple clients
legionnaire --connect-bouncer user@server:8080
use legionnaire_bot::{Bot, BotConfig, EventHandler};
#[tokio::main]
async fn main() {
let config = BotConfig::from_file("bot.toml").unwrap();
let mut bot = Bot::new(config);
bot.on_message(|ctx, msg| async move {
if msg.content.starts_with("!weather") {
let location = msg.content.strip_prefix("!weather ").unwrap();
let weather = get_weather(location).await?;
ctx.reply(&msg, &format!("Weather: {}", weather)).await?;
}
});
bot.run().await?;
}
git clone https://github.com/dylan-k/legionnaire
cd legionnaire
cargo build --release
# Run tests
cargo test --all-features
cargo test --test integration_tests
# Run benchmarks
cargo bench
# Create new plugin
cargo new --lib my_plugin
cd my_plugin
# Add dependencies
[dependencies]
legionnaire-plugin = { git = "https://github.com/dylan-k/legionnaire" }
tokio = { version = "1.0", features = ["full"] }
# Build plugin
cargo build --release
cp target/release/libmy_plugin.so ~/.config/legionnaire/plugins/
# Run E2E encryption tests
cargo test --test e2ee_integration
# Test key exchange
cargo test test_phalanx_handshake
# Performance benchmarks
cargo bench --bench encryption_bench
FROM rust:1.70 as builder
WORKDIR /app
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=builder /app/target/release/legionnaire /usr/local/bin/
COPY --from=builder /app/config.toml /etc/legionnaire/
CMD ["legionnaire", "--bouncer", "--daemon"]
[Unit]
Description=Legionnaire IRC Bouncer
After=network.target
[Service]
Type=forking
User=ircd
Group=ircd
ExecStart=/usr/local/bin/legionnaire --bouncer --daemon
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
Legionnaire is licensed under the MIT License. See LICENSE for details.
Legionnaire: Production-ready IRC with modern security, comprehensive features, and extensible architecture.