⚡ 使用 Rust 和 WASM 构建的极其快速的终端风格个人网站
A browser-based terminal emulator built with Rust, Yew framework, and TailwindCSS for modern, responsive styling.
help - Display help information for all available commandsecho - Output text to the terminalClone the repository:
git clone
cd terminal-emulatorInstall Trunk (if not already installed):
cargo install --locked trunkNote: TailwindCSS will be automatically downloaded and run via npx during the build process - no local installation needed!
./dev.shGenerate TailwindCSS styles:
./generate-css.shStart the development server:
trunk serve --openThe application will be available at http://127.0.0.1:8080.
Note: When you modify Tailwind classes in your Rust code, run ./generate-css.sh to regenerate the CSS styles.
Build the application for production deployment:
./build.sh
# Or manually:
trunk build --releaseThe built files will be available in the dist directory.
Once the application is running:
help - Show all available commands and their usageecho - Output the specified text…Routes are defined in App.toml and executed via the terminal command runner:
/ runs its command exactly./posts/{name}/foo binds {name} to the segment between posts and foo (e.g., /posts/bar/foo sets name = "bar")./posts/{*file_path} captures everything after /posts/ (e.g., /posts/a/b/c sets file_path = "/a/b/c", and visiting /posts/ sets file_path = "/").* matches anything not caught earlier.Captured values can be interpolated into commands using {name} or {*name}.
To add a new command:
Command trait in src/commands/mod.rsCommandExecutor::new()Example:
pub struct MyCommand;
impl Command for MyCommand {
fn execute(&self, args: &[String]) -> CommandResult {
CommandResult::Success("Hello from my command!".to_string())
}
fn description(&self) -> &'static str {
"My custom command"
}
fn usage(&self) -> &'static str {
"mycommand"
}
}MIT License
暂无开放 Issues,或尚未同步最近议题。