Skip to content
/ ract Public

Ract is a conversational CLI tool written in Rust, providing an all-in-one solution for integrating dependencies, setting up environments, generating project templates, running, and packaging projects with frameworks like GenUI and Makepad. Simplify your development workflow with minimal arguments and intuitive dialogs. πŸš€

License

Notifications You must be signed in to change notification settings

Privoce/ract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ract

Ract is a conversational CLI tool written in Rust, designed to simplify the development process by providing an all-in-one solution for:

  • Integrating dependencies
  • Setting up environments
  • Generating project templates
  • Running and packaging projects

With minimal arguments and an intuitive dialog-based interface, Ract supports frameworks like GenUI and Makepad, making your development workflow smooth and efficient. πŸš€


πŸ“– Table of Contents

  1. Config
  2. Usage
  3. Features
  4. Video for Usage

πŸ› οΈ Config

Note

Your computer may prompt security questions, please select Allow

You can configure ract as a global command in the following way:

Macos | Linux

# copy download ract to /usr/local/bin
sudo cp /path/to/download/ract /usr/local/bin/ract/ract

# add permission
sudo chmod 755 /usr/local/bin/ract
sudo chmod 755 /usr/local/bin/ract/ract

# confirm permission
sudo chown -R $(whoami) /usr/local/bin/ract

# echo to .zshrc
echo 'export PATH="/usr/local/bin/ract:$PATH"' >> ~/.zshrc

source ~/.zshrc
# get version
ract --version

Windows

put path/to/ract into System Env

πŸš€ Usage

init - Initialize Ract

Initialize or reset the CLI. Ract will generate:

  1. .env
  2. chain/
    • chain/env.toml
ract init

Output:

πŸš€ Start to init ract...
βœ… Chain init successfully!
πŸŽ‰ Init ract successfully!

check - Check Toolchain

Check if required tools and dependencies are installed. Options include:

  • Basic: [cargo, rustc, git]
  • Underlayer: [makepad (gen_ui, makepad)]
  • All: Combines both basic and underlayer tools.
ract check

Interactive dialog example:

πŸ₯³ Welcome to use ract checker!
? Which you need to check?
> Basic
  Underlayer
  All

install - Install Toolchain

Install required tools and dependencies for development. Available options:

  • Rust tools: rustc, cargo
  • Version control: git
  • Makepad-specific tools: Includes components like gen_components, wasm_build, and more.
ract install

Interactive dialog example:

πŸ₯³ Welcome to use ract Install!

πŸ”Έ Select the tools to install:
  - rustc
  - cargo
  - git
  - makepad tools (default or custom options)
? What tools you want to (re)install?
> [ ] rustc|cargo
  [ ] git
  [x] makepad

config - Configure CLI

Set or update environment variables and CLI configurations.

ract config

Interactive dialog example:

πŸ₯³ Welcome to use ract config!

πŸ”Έ env: Set the `path` for the chain env.toml file
πŸ”Έ chain_env_toml: Set the rust dependency for GenUI toolchain

> Which env file do you want to config? chain_env_toml
> Get or Set Config? set
> Which one do you want to config? makepad-widgets
> Path: /Users/shengyifei/projects/makepad/makepad
πŸŽ‰ Config finish!

create - Create a GenUI or Makepad Project

Ract will build a Makepad or GenUI project template based on the configuration entered by the user

create will help you check current env states

ract create

Interactive dialog example:

❀️ WELOCME TO GENUI, ract is a build tool for you!

> Which project you want to create? makepad
> Project name: test1
> Authors name: John
> ...
πŸŽ‰ Your project has been created successfully!

run - Run a Project

Run Makepad or GenUI projects.

ract run

studio - Launch Makepad Studio

Start Makepad Studio for GUI projects.

ract studio

wasm - Run WASM Project in Browser

Build and run a WASM project directly from the CLI.

ract wasm

Interactive dialog example:

πŸ₯³ Welcome to use ract wasm!

πŸ”Έ Port for the web studio 8888
πŸ“¦ wasm is being packaged
πŸš€ wasm is being started...
Starting webserver on 127.0.0.1:8888

pkg - Package a Project

Package a project using cargo-packager.

ract pkg

Interactive dialog example:

πŸ₯³ Welcome to use ract packager!

πŸ”Έ gpiler will check and install `cargo-packager` if not present.
πŸ”Έ Basic packaging configuration is auto-generated.
? Select how to package the project: init
πŸŽ‰ Package resources have been generated!

🎯 Features

Core Features

  • Initialization: Automatically generate .env and environment templates.
  • Toolchain Check: Verify if all dependencies are installed.
  • Interactive Installation: Install only the tools you need.
  • Environment Configuration: Flexible configuration of environment paths.
  • Project Running: Run Makepad or GenUI projects with a single command.
  • WASM Support: Build and serve WASM projects in the browser.
  • Project Packaging: Streamlined packaging for distribution.

Future Features

  • Watcher: Monitor changes for automatic reload.
  • Logger: Advanced logging system for debugging.
  • Cross-platform Packaging: Simplify builds for multiple platforms.
  • Documentation: Include a comprehensive book for learning Makepad and GenUI.

Ract makes your Rust-based development with Makepad and GenUI easier, faster, and more efficient. πŸŽ‰

Feel free to contribute or share feedback to help us improve! 😊

About

Ract is a conversational CLI tool written in Rust, providing an all-in-one solution for integrating dependencies, setting up environments, generating project templates, running, and packaging projects with frameworks like GenUI and Makepad. Simplify your development workflow with minimal arguments and intuitive dialogs. πŸš€

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages