hack-ink / AiR

AI with Rust.
GNU General Public License v3.0
118 stars 6 forks source link
ai language language-learning learning openai productivity rust studying tool translation translation-tool writing writing-tool
# AiR

AI with Rust |

[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Checks](https://github.com/hack-ink/air/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/hack-ink/air/actions/workflows/checks.yml) [![Release](https://github.com/hack-ink/air/actions/workflows/release.yml/badge.svg)](https://github.com/hack-ink/air/actions/workflows/release.yml) [![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/hack-ink/air)](https://github.com/hack-ink/air/tags) [![GitHub last commit](https://img.shields.io/github/last-commit/hack-ink/air?color=red&style=plastic)](https://github.com/hack-ink/air) 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! [English](README.md) | [中文](README-zh-CN.md) [![AiR](https://repobeats.axiom.co/api/embed/0077d1532f0a8a35e5301e86b32552fd70c03547.svg "Repobeats analytics image")](https://github.com/hack-ink/air/pulse)

Feature Highlights

UIs

Rewrite Directly

rewrite-directly

Translate Directly

translate-directly

Status

Usage

Installation

Build from Source

# Clone the repository.
git clone https://github.com/hack-ink/air
cd air

# To install Rust on macOS and Unix, run the following command.
#
# To install Rust on Windows, download and run the installer from `https://rustup.rs`.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable

# Install the necessary dependencies. (Unix only)
# Using Ubuntu as an example, this really depends on your distribution.
sudo apt-get update
sudo apt-get install libasound2-dev libxdo-dev

# 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 pack the binary into an app.
cargo install cargo-bundle
# Pack the app, and the it will be available at `target/release/bundle/osx/AiR.app`.
cargo bundle --release

Download Pre-built Binary

Configuration

API Key

Please configure the API key the first time you run AiR!

  1. Open AiR.
  2. Navigate to the "Setting" panel.
  3. Click the "AI" section.
  4. Fill in the "API Key" field.

Open a Mac app from an unidentified developer (macOS only)

When you open AiR 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 AiR to run on your Mac.

Buy me a coffee so I can get an Apple Developer Certificate. 😄

  1. Open "System Preferences" -> "Privacy & Security".
  2. Scroll down to the '"AiR" was blocked from use because it is not from an identified developer.' section.
  3. Click "Open Anyway".

Relate resources:

Gain System Accessibility Permission (macOS only)

To control the keyboard and use the system clipboard for reading and writing data, AiR must obtain system accessibility permissions.

  1. Open "System Settings" -> "Privacy & Security" -> "Accessibility".
  2. Click the "+" button and add the "AiR.app" or "air" binary.

Setting

You can configure the settings by navigating to the "Settings" panel.

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.

Interaction

Update

An automatic update feature is under development.

For now, you can manually update AiR by repeating the installation steps.

Re-gain System Accessibility Permission (macOS only)

Sometimes, you might need to regain system accessibility permission after updating AiR. However, in most cases, this step is unnecessary.

  1. Follow the "Gain System Accessibility Permission" section to locate the "AiR.app" or "air" binary.
  2. Click the "-" button to remove the existing permission, then click the "+" button to re-add it.

Development

Architecture

```mermaid 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](https://github.com/emilk/egui), a fast and cross-platform GUI toolkit written in pure Rust.**

Support Me

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.

Thank you for your support!

Appreciation

We would like to extend our heartfelt gratitude to the following projects and contributors:

Additional Acknowledgements

#### License Licensed under [GPL-3.0](LICENSE).