Chakra

Chakra is a powerful WebAssembly (WASM) runtime CLI tool with full WASI support.
✨ Features
- 🚀 Instant Development Server - Point Chakra to your .wasm file or project and get a ready playground in your browser
- 🌐 Browser Integration - Automatically opens your default browser with interactive console and debugging tools
- 💻 Interactive Console - View execution results and logs in a beautiful web interface
- 🔍 Smart Detection - Automatically identifies entry points and module types (standard WASM vs wasm-bindgen)
- 📦 Multi-Language Support - Compile Rust, Go, C/C++, and AssemblyScript projects to WASM
- 🔧 Built-in Compilation - Integrated build system
- 🔍 WASM Inspection - Verify and analyze WASM files with detailed module information and binary analysis
- 👀 Live Reload - Watch mode for automatic recompilation and browser refresh during development
- 🌟 Full WASI Support - Complete WebAssembly System Interface implementation with virtual filesystem
- 🌐 Web Application Support - Experimental support for Rust web frameworks (Yew, Leptos, Dioxus, etc.)
- ⚡ Zero Configuration - Works out of the box with sensible defaults and automatic project detection
🚀 Installation
From Cargo (Recommended)
From Source
📖 Usage
Chakra supports both flag-based arguments using --path and direct positional arguments for an intuitive command line experience.
Quick Start
# Run on current directory
# Run a WebAssembly file directly
# Run a project directory
# With flags
🔧 Commands
Development Server
Start the development server with live reload:
Compilation
Compile a project to WebAssembly:
Verification & Inspection
Verify a WASM file format and analyze structure:
Project Management
Initialize a new project:
Clean build artifacts:
Server Control
Stop any running Chakra server:
🛠️ Supported Languages & Frameworks
Programming Languages
| Language | Status | Compiler | Notes |
|---|---|---|---|
| ✅ Full Support | cargo + rustc |
Standard WASM, wasm-bindgen, and web apps | |
| ✅ Full Support | tinygo |
Lightweight Go runtime | |
| ✅ Full Support | emscripten |
Complete toolchain support | |
| ✅ Full Support | asc |
TypeScript-like syntax | |
| 🚧 Coming Soon | py2wasm / waspy |
In development |
Web Frameworks (Rust)
Chakra automatically detects and supports Rust web frameworks with specialized web application mode:
- Yew - Modern Rust / Wasm framework
- Leptos - Full-stack, compile-time optimal Rust framework
- Dioxus - Cross-platform GUI library
- Sycamore - Reactive library
- Trunk - Build tool for Rust-generated WebAssembly
Web framework support is highly experimental and actively being improved. Looking for contributors. 👋
🌟 How It Works
For WASM Files
- Chakra server with WASI support starts running
- Opens your default browser with an interactive interface
- Serves the WASM file with comprehensive WASI support including virtual filesystem
- Provides real-time console output, debugging tools, and file system interaction
For Projects
- Language Detection - Automatically identifies project type (Rust, Go, C, AssemblyScript)
- Dependency Checking - Verifies required tools are installed
- Compilation - Builds optimized WASM with proper flags and optimizations
- Serving - Runs development server with live reload
- Experimental Web App Mode - Special handling for web applications with framework detection
🔍 WASI Support
Chakra includes a complete WebAssembly System Interface (WASI) implementation in the browser:
Supported Features ✅
- Virtual Filesystem - Complete file system with directories, file creation, and manipulation
- Standard I/O - stdout, stderr with console integration and real-time display
- Environment Variables - Full environment variable support
- Command Arguments - Access to command-line arguments
- File Operations - Read, write, seek, and comprehensive file management
- Random Number Generation - Secure random numbers via Web Crypto API
- Time Functions - System time and high-precision timers
- Pre-opened Directories - Filesystem sandboxing and security
- Interactive Console - Real-time output and error display
- File Explorer - Browse and edit virtual filesystem contents
Coming Soon 🚧
- Network Sockets - TCP/UDP socket support for networking
- Threading - Multi-threading and shared memory support
- Advanced I/O - Async I/O operations and streaming
🎯 Use Cases
Development & Testing
# Quick WASM testing with instant feedback
# Project development with live reload
# Build and optimize for production
Learning & Education
# Inspect WASM structure and understand internals
# Verify WASM compliance and format
Web Application Development
# Rust web app with hot reload
# Multi-framework support
Performance Analysis
# Size-optimized builds
# Debug builds with full symbols
🔧 Configuration
Environment Variables
CHAKRA_PORT- Default server port (default: 8420)CHAKRA_WATCH- Enable watch mode by defaultCHAKRA_OUTPUT- Default output directory for buildsCHAKRA_DEBUG- Enable debug outputRUST_BACKTRACE- Show stack traces for errors
Project Detection
Chakra automatically detects project types based on files:
- Rust:
Cargo.tomlpresent - Go:
go.modor.gofiles present - C/C++:
.c,.cpp, or.hfiles present - AssemblyScript:
package.jsonwith AssemblyScript dependency - Python: 🚧 Coming Soon
Optimization Levels
debug- Fast compilation, full symbols, no optimizationrelease- Optimized for performance (default)size- Optimized for minimal file size
🚀 Examples
Rust Examples
# Standard Rust WASM
# Add your Rust code
# Rust web application with live reload
# Add Yew/Leptos dependencies to Cargo.toml
C Examples
# Simple C program
Go Examples
# TinyGo project
🔍 Troubleshooting
Common Issues
"Port is already in use"
"No entry point found"
- Ensure your WASM has
main(),_start(), or exported functions - Use
chakra inspectto see available exports
"Missing compilation tools"
# Install required compilers
# Install emcc for C/C++
# Install tinygo for Go
"wasm-bindgen module detected"
- Use the
.jsfile instead of the.wasmfile directly - Run
chakra project-dirinstead of individual files
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.
📄 License
🙏 Credits
Chakra is built with love using:
- tiny_http - Lightweight HTTP server
- clap - Command line argument parsing
- notify - File system watching for live reload
- wasm-bindgen - Web integration
- And the amazing Rust and WebAssembly communities ❤️
Made with ❤️ for the WebAssembly community
⭐ If you find Chakra useful, please consider starring the repository!