A modern, cross-platform implementation of AutoHotkey written in Rust, supporting Windows, Linux, and macOS.
- 中文使用手册 - Complete Chinese documentation
- 用户指南 - Detailed user guide in Chinese
- 快速参考 - Quick reference in Chinese
- 常见问题 - FAQ in Chinese
- Cross-Platform: Single codebase that compiles natively on Windows, Linux, and macOS
- Performance: Fast execution with minimal memory footprint
- Compatibility: High compatibility with existing AutoHotkey v1 scripts
- Safety: Memory-safe implementation with minimal unsafe code
- Embeddable: Can be embedded as a library in other Rust applications
- ✅ Hotkeys and hotstrings
- ✅ Basic commands (Send, Run, MsgBox)
- ✅ Control flow (If/Else, Loop)
- ✅ Cross-platform window management
- ✅ Virtual machine with stack-based execution
| Platform | Hotkeys | Hotstrings | Send | WinActivate | Status |
|---|---|---|---|---|---|
| Windows | ✔ | ✔ | ✔ | ✔ | ✅ Full |
| Linux | ✔ | ✔ | ✔ | ◐ | 🚧 X11 |
| macOS | ✔ | ✔ | ✔ | ◐ | 🚧 Limited |
◐ = Partial support (requires specific permissions/setup)
git clone https://github.com/your-org/ahk-rs
cd ahk-rs
cargo build --releaseDownload from Releases
# Run an AHK script
ahk-rs script.ahk
# Interactive mode
ahk-rs --interactiveuse ahk_rt::{Engine, Error};
fn main() -> Result<(), Error> {
let mut engine = Engine::new();
engine.load_file("demo.ahk")?;
engine.run()
}; demo.ahk - Compatible with original AutoHotkey syntax
^j::
Send, Hello from Rust-AHK
return
::btw::by the wayahk-rs/
├── crates/
│ ├── ahk_core/ # Platform-agnostic lexer, parser, VM
│ ├── ahk_platform/ # Platform abstraction layer
│ ├── ahk_builtin/ # Built-in command implementations
│ ├── ahk_rt/ # Embeddable runtime API
│ └── ahk_cli/ # Command-line interface
├── scripts/ # Test scripts and examples
└── tests/ # Integration tests
- Rust 1.78+ (MSRV)
- Platform-specific dependencies:
- Linux: X11 development libraries
- macOS: Xcode command line tools
- Windows: Windows SDK
# Build all crates
cargo build
# Run tests
cargo test
# Run with debug logging
RUST_LOG=debug cargo run -- script.ahk# Ubuntu/Debian
sudo apt install libx11-dev libxtst-dev
# Fedora
sudo dnf install libX11-devel libXtst-develEnable "Accessibility" permissions for the terminal/IDE you're using.
- Phase 0: Project setup and design
- Phase 1: Lexer and parser implementation
- Phase 2: Virtual machine and runtime
- Phase 3: Platform abstraction layer
- Phase 4: Built-in commands migration
- Phase 5: Cross-platform packaging and CI
- Phase 6: Plugin system and backward compatibility
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
- Original AutoHotkey project
- Rust community for excellent cross-platform libraries