Built entirely in Rust, AiR delivers blazing speed and efficiency!
AiR boasts two main features: accurate translation and seamless text rewriting, designed to supercharge your productivity.
AiR is a great assistant for non-native speakers, automatically fixing errors and polishing language to sound like a native speaker.
More awesome features are on the horizon!
- OS
- macOS
- Windows (Coming Soon)
- Unix
- Features
- Rewrite
- Rewrite Directly
- Translate
- Translate Directly
- Refactor Code (Coming Soon)
- OCR (Planed)
- TTS (Planed)
# Install Rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable
# Clone the repository.
git clone https://github.com/hack-ink/air
cd air
# Build the project, and the binary will be available at `target/release/air`.
cargo build --release
# If you are a macOS user and want to have a `AiR.app`, run the following command.
# Install `cargo-bundle` to package the binary into an app.
cargo install cargo-bundle
# Build the app, and the it will be available at `target/release/bundle/osx/AiR.app`.
cargo bundle --release
- macOS
- Download the latest pre-built binary from GitHub Releases.
- Windows
- Coming Soon
- Unix
- Planed
When you open the app for the first time, you'll see the following message:
"AiR" cannot be opened because the developer cannot be verified.
Since I'm not an identified developer, you need to allow the app to run on your Mac.
Buy me a coffee so I can get an Apple Developer Certificate. 😄
Open "System Preferences" -> "Privacy & Security".
Scroll down to the '"AiR" was blocked from use because it is not from an identified developer.' section.
Click "Open Anyway".
Relate resources:
- Open a Mac app from an unidentified developer (support.apple.com)
- How to open a Mac app from an unidentified developer (macworld.com)
To control the keyboard and use the system clipboard for reading and writing data, AiR must obtain system accessibility permissions.
Open "System Settings" -> "Privacy & Security" -> "Accessibility".
Click the "+" button and add the "AiR.app" or "air" binary.
You can configure the settings by navigating to the "Settings" panel.
- General
- Font Size
- Hide on Lost Focus: Hide the app when it loses focus.
- Active Function: The active function when using non-directly functions.
- AI
- API Base: The base URL of the AI API. It's crucial to ensure you don't forget the
v1
part. (e.g., https://api.openai.com/v1). - API Key: The AI API key.
- Model: The AI model.
- Temperature: The unpredictability of AI.
- API Base: The base URL of the AI API. It's crucial to ensure you don't forget the
- Translation
- Language A: The language you want to translate from/to B.
- Language B: The language you want to translate from/to A.
- Hotkey
- Rewrite
- Rewrite Directly
- Translate
- Translate Directly
- Development
- Log Level
AiR is currently under heavy development, and not all settings are always available in the user interface.
However, all settings can always be found in the settings file.
The location of the settings file varies depending on the OS.
~/Library/Application\ Support/AiR/setting.toml
(macOS)C:\Users\<username>\AppData\Roaming\AiR\setting.toml
(Windows)~/.config/AiR/setting.toml
(Unix)
Type the text in the input area and press META+ENTER
on macOS or CTRL+ENTER
on other OS to trigger the corresponding function.
You can also select text and use hotkeys to directly apply the corresponding function to the selected text.
An automatic update feature is under development.
For now, you can manually update the app by repeating the installation steps.
Follow the "Gain System Accessibility Permission" section to locate the "AiR.app" or "air" binary.
Click the "-" button to remove the existing permission, then click the "+" button to re-add it.
graph TD
A[AiR]
A --> B[Components]
A --> C[OS]
A --> D[Services]
A --> E[State]
A --> F[UI]
B --> B1[Data Structures]
C --> C1[macOS/Unix/Windows]
D --> D1[Background Processes]
E --> E1[Synchronization]
F --> F1[Interaction]
Built upon egui, a fast and cross-platform GUI toolkit written in pure Rust.
- Components
- Provides the basic data structures and functions used by other parts of the program.
- Component should be static, don't include any mutable state.
- OS
- Provides wrapped APIs to interact with the OS.
- Differences between OS should be addressed here and presented in a summarized, abstract manner.
- Services
- Provides background tasks ability to run independently of the UI.
- Service has one or more requirements for a cache component to conserve system resources, perform frequent checks or updates, and handle time-sensitive tasks.
- Service related to UI settings should provide a hot reload function so that when a setting is changed on UI, the changes are applied immediately.
- Service should include an abort function to stop the service, and it should be called when exiting the program. to prevent it from stalling.
- State
- Provides mutability that can be synchronized and shared throughout the entire program.
- State should be
Arc<parking_lot::Mutex/RwLock<_>>
orArc<std::sync::atomic::Atomic*>
.
- UI
- Provides the interaction ability of other parts for users.
If you find this project helpful and would like to support its development, you can buy me a coffee!
Your support is greatly appreciated and motivates me to keep improving this project.
- Fiat
- Crypto
- Bitcoin
bc1pedlrf67ss52md29qqkzr2avma6ghyrt4jx9ecp9457qsl75x247sqcp43c
- Ethereum
0x3e25247CfF03F99a7D83b28F207112234feE73a6
- Polkadot
156HGo9setPcU2qhFMVWLkcmtCEGySLwNqa3DaEiYSWtte4Y
- Bitcoin
Thank you for your support!
We would like to extend our heartfelt gratitude to the following projects and contributors:
- egui for providing the foundation for our GUI.
- The Rust community for their continuous support and development of the Rust ecosystem.
- OpenAI Translator for providing the inspiration for this work.
- The awesome icon created through recraft.ai.
Licensed under GPL-3.0.