| Crates.io | chakra |
| lib.rs | chakra |
| version | 0.9.6 |
| created_at | 2025-04-27 11:43:54.602076+00 |
| updated_at | 2025-06-23 08:09:14.436282+00 |
| description | A WebAssembly Runtime |
| homepage | |
| repository | https://github.com/anistark/chakra |
| max_upload_size | |
| id | 1651037 |
| size | 1,271,663 |

Chakra is a powerful WebAssembly (WASM) runtime CLI tool with full WASI support and modular plugin architecture.
cargo install chakra
git clone https://github.com/anistark/chakra.git
cd chakra
cargo install --path .
Chakra supports both flag-based arguments using --path and direct positional arguments for an intuitive command line experience.
# Run on current directory
chakra
# Run a WebAssembly file directly
chakra myfile.wasm
# Run a project directory
chakra ./my-wasm-project
# With flags
chakra --path ./path/to/your/file.wasm
chakra --path ./my-wasm-project
Start the development server with live reload:
chakra run ./my-project --watch
chakra run ./my-project --port 3000 --language rust
Compile a project to WebAssembly using the appropriate plugin:
chakra compile ./my-project
chakra compile ./my-project --output ./build --optimization release
chakra compile ./my-project --optimization size --verbose
List available plugins and check dependencies:
# List all available plugins
chakra plugins list
# Get detailed plugin information
chakra plugins info rust
chakra plugins info go
Verify a WASM file format and analyze structure:
chakra verify ./file.wasm
chakra verify ./file.wasm --detailed
chakra inspect ./file.wasm
Initialize a new project:
chakra init my-app --template rust
chakra init my-app --template go --directory ./projects/
Clean build artifacts:
chakra clean ./my-project
Stop any running Chakra server:
chakra stop
Chakra uses a modular plugin system where each programming language is supported through dedicated plugins. This architecture provides:
| Plugin | Status | Compiler/Runtime | Capabilities |
|---|---|---|---|
| ✅ Full Support | cargo + rustc |
Standard WASM, wasm-bindgen, web apps, optimization | |
| ✅ Full Support | tinygo |
Lightweight runtime, optimization | |
| ✅ Full Support | emscripten |
Complete toolchain, Makefile support | |
| ✅ Full Support | asc + npm/yarn |
TypeScript-like syntax, optimization | |
| ✅ Beta Support | py2wasm |
Runtime integration, bundle creation |
Each plugin provides specific capabilities:
| Feature | Rust | Go | C/C++ | AssemblyScript | Python |
|---|---|---|---|---|---|
| Compile to WASM | ✅ | ✅ | ✅ | ✅ | ✅ |
| Web Applications | ✅ | ❌ | ✅ | ❌ | ✅ |
| Live Reload | ✅ | ✅ | ✅ | ✅ | ❌ |
| Optimization | ✅ | ✅ | ✅ | ✅ | ❌ |
| Custom Targets | Multiple | wasm | web | wasm | TBD |
The Rust plugin automatically detects and supports web frameworks with specialized web application mode:
Web framework support is highly experimental and actively being improved. Looking for contributors. 👋
Chakra intends to provide support for complete WebAssembly System Interface (WASI) implementation in the browser. It's a work in progress. Some features might work, but it's highly experimental.
# Quick WASM testing with instant feedback
chakra test.wasm
# Project development with live reload (plugin auto-detected)
chakra run ./my-rust-project --watch
# Build and optimize for production (plugin-specific optimizations)
chakra compile ./my-project --optimization size
# List available plugins and their capabilities
chakra plugins list
# Get detailed information about a specific plugin
chakra plugins info rust
# Inspect WASM structure and understand internals
chakra inspect ./complex-module.wasm
# Verify WASM compliance and format
chakra verify ./student-submission.wasm --detailed
# See which plugin would handle a project
chakra run ./unknown-project --dry-run
# Rust web app with hot reload (Rust plugin auto-detects frameworks)
chakra run ./my-yew-app --watch
# Multi-framework support
chakra run ./leptos-project
chakra run ./dioxus-app
# Python web app with Pyodide
chakra run ./my-python-web-app
# Size-optimized builds with plugin-specific optimizations
chakra compile ./my-project --optimization size
# Debug builds with full symbols
chakra compile ./my-project --optimization debug --verbose
# Compare different plugin optimizations
chakra compile ./rust-project --optimization size
chakra compile ./go-project --optimization size
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 errorsChakra automatically selects plugins based on project structure:
Cargo.toml presentgo.mod or .go files present.c, .cpp, .h files, or Makefile presentpackage.json with AssemblyScript dependency or assembly/ directory.py files or requirements.txt presentPlugin-specific optimization levels:
debug - Fast compilation, full symbols, no optimizationrelease - Optimized for performance (default)size - Optimized for minimal file size (plugin-dependent implementation)"No plugin found for project"
# Check what files are in your project
ls -la
# Ensure proper entry files exist (Cargo.toml, go.mod, etc.)
# Use chakra plugins list to see available plugins
🚨 Open an issue and let us know about it.
"Plugin dependencies missing"
# Install missing tools for specific plugins:
rustup target add wasm32-unknown-unknown # Rust plugin
# Install emcc for C/C++ plugin
# Install tinygo for Go plugin
# Install asc for AssemblyScript plugin
"Wrong plugin selected"
# Force a specific plugin
chakra --language rust
chakra --language go
mise use python@3.11.0
pip install py2wasm
"Port is already in use"
chakra stop # Stop existing server
chakra --port 3001 # Use different port
"No entry point found"
main(), _start(), or exported functionschakra inspect to see available exports"wasm-bindgen module detected"
.js file instead of the .wasm file directly (Rust plugin)chakra project-dir instead of individual filesWe welcome contributions! Please see CONTRIBUTING.md for detailed guidelines, including how to add new plugins and extend existing ones.
The modular architecture makes it easy to add support for new languages. See the plugin development guide for details.
Chakra is built with love using:
Made with ❤️ for the WebAssembly community
⭐ If you find Chakra useful, please consider starring the repository!