AI Shell is a simple GUI-based terminal application built with Rust 🦀 and the iced ❄️ GUI library. It allows users to enter shell commands 💻 and view the output within a graphical interface 🖥️.
Here's an updated table focusing on the Size aspect, incorporating typical application sizes:
Aspect | Rust | C++ | Go | Python (PyInstaller) | Java (JAR files) | Electron (JavaScript) |
---|---|---|---|---|---|---|
Size | - ~8.3 MB (as in your app) - Produces small, standalone binaries without large runtimes |
- ~10-15 MB - Can produce small binaries but may require manual optimization |
- ~10-20 MB - Includes garbage collector, slight overhead |
- ~20-30 MB - Requires bundling interpreter and libraries |
- ~50-100 MB - Requires JVM, adds overhead |
- ~50-150 MB - Includes Chromium and Node.js runtime, leading to large sizes |
Key Takeaways:
-
Rust's Small Binary Size: Your 8.3MB application showcases Rust's efficiency in producing compact binaries, which is especially beneficial for distribution, faster downloads, and reduced storage requirements.
-
Comparison with Other Frameworks:
- Python: Applications bundled with tools like PyInstaller often exceed 20 MB because they need to include the Python interpreter and all dependencies.
- Java: Java applications require the Java Virtual Machine (JVM), adding significant overhead and increasing the overall size.
- Electron: Apps built with Electron can easily exceed 50 MB because they bundle a Chromium browser and Node.js runtime.
-
No Need for Large Runtimes: Rust compiles directly to machine code, eliminating the need for a virtual machine or interpreter at runtime, which contributes to smaller application sizes.
- Command Execution: Enter shell commands 💻 and view their output in a scrollable window 📜.
- Graphical User Interface: Built using the
iced
❄️ library for a modern and responsive GUI 🖥️. - Splash Screen: Displays a splash screen 🎉 on startup.
- Custom Application Icon: Includes a custom icon 🖼️ when running on macOS 🍎.
- Rust 🦀: A systems programming language focused on safety 🛡️ and performance 🚀.
- Version:
1.56
or later (edition 2021)
- Version:
- iced ❄️: A cross-platform GUI library for Rust, inspired by Elm 🌳.
- Version:
0.12.1
- Features Used:
canvas
🎨tokio
⚡
- Version:
- cargo-bundle 📦: A tool for bundling Rust applications into distributable formats.
- Used to create a macOS 🍎 application bundle (
.app
) with a custom icon 🖼️.
- Used to create a macOS 🍎 application bundle (
- winit 🪟: A window handling library in Rust.
- Used indirectly through
iced
❄️ for window management and setting the application icon 🖼️.
- Used indirectly through
ai_shell/
├── Cargo.toml
├── resources/
│ ├── AppIcon.icns # Application icon 🖼️ for macOS bundling
│ ├── icon.png # Icon image 🖼️ used in the application
│ └── splash.png # Splash screen image 🎉 (optional)
└── src/
├── executor.rs # Module handling command execution 💻
└── main.rs # Main application code 🖥️
-
Clone the Repository 📥:
git clone https://github.com/shubham0850/AIShell.git cd AIShell
-
Build the Application 🛠️:
cargo build
-
Run the Application
▶️ :cargo run
For development with live reloading ♻️:
cargo install cargo-watch cargo watch -x run
-
Build the Application for Distribution 📦:
cargo install cargo-bundle # Install cargo-bundle if not already installed cargo bundle --release # Build and bundle the application
This command will create a bundled application in the
target/release/bundle/
directory, including a macOS.app
bundle with the custom icon 🖼️ specified inCargo.toml
.
This project is licensed under the MIT License. See the LICENSE file for details.
- Thanks to the iced ❄️ community for providing an excellent GUI library for Rust 🦀.
- Author: Shubham Raj
- Email: rajshubham0850@gmail.com
- GitHub: Shubham0850
- LinkedIn: Shubham Raj
Feel free to customize this README to better suit your project. Include any additional sections or information that you think would be helpful for users and contributors.