| Crates.io | ai00-run |
| lib.rs | ai00-run |
| version | 0.1.0 |
| created_at | 2025-10-02 19:41:22.73909+00 |
| updated_at | 2025-10-02 19:41:22.73909+00 |
| description | A Rust library for unified runtime management of Node.js, Python, and Rust environments |
| homepage | |
| repository | https://github.com/cgisky1980/ai00-run |
| max_upload_size | |
| id | 1864956 |
| size | 322,754 |
A Rust library for multi-language runtime management and script execution.
AI00 Run provides unified APIs for managing Node.js and Python runtimes, virtual environments, and script execution. Built with Rust for high performance and async support.
Note: This is a Rust library, not a CLI tool. Use its API in Rust programs.
Add to Cargo.toml:
[dependencies]
ai00-run = { git = "https://github.com/cgisky1980/ai00-run.git" }
Use JSON/YAML configuration files for script execution:
use ai00_run::run;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
let runner = run::ScriptRunner::new();
// Run from configuration
let result = runner.run_from_config("config.json", None).await?;
println!("Result: {}", result.stdout);
Ok(())
}
JSON Configuration (config.json):
{
"name": "test-script",
"script_type": "node",
"node_version": "18.17.0",
"script_path": "src/main.js",
"working_dir": "examples/test-project",
"env_vars": {
"NODE_ENV": "development"
}
}
YAML Configuration (config.yaml):
name: test-script
script_type: python
python_version: 3.9
script_path: src/main.py
working_dir: examples/test-project
env_vars:
PYTHONPATH: ./src
use ai00_run::run;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
let runner = run::ScriptRunner::new();
// Run Node.js script
let result = runner.run_node_script("18.17.0", "src/main.js").await?;
println!("Result: {}", result.stdout);
// Run Python script
let result = runner.run_python_script("3.9", "src/main.py").await?;
println!("Result: {}", result.stdout);
Ok(())
}
use ai00_run::node;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
// Install Node.js version
node::install("18.17.0").await?;
// Check installation
let installed = node::is_installed("18.17.0").await?;
println!("Installed: {}", installed);
// Run command
let result = node::run_command("18.17.0", &["--version"]).await?;
println!("Version: {}", result.stdout);
Ok(())
}
use ai00_run::py;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
// Create virtual environment
py::create_venv(None, Some("3.9")).await?;
// Install packages
py::install_packages(None, &["requests", "pandas"]).await?;
// Run Python script
let result = py::run_script(None, "script.py", &[]).await?;
println!("Output: {}", result.stdout);
Ok(())
}
Note: Python management is based on the uv tool, ensure uv is installed on your system.
use ai00_run::run;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
let runner = run::ScriptRunner::new();
// Run scripts
let result = runner.run_node_script("18.17.0", "script.js").await?;
println!("Result: {}", result.stdout);
// Execute commands
let result = runner.execute_command("echo", &["Hello"]).await?;
println!("Command: {}", result.stdout);
Ok(())
}
use ai00_run::run;
use futures::StreamExt;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
let runner = run::ScriptRunner::new();
// Stream command output
let mut stream = runner.execute_command_stream("ping", &["google.com"], None).await?;
while let Some(chunk) = stream.next().await {
match chunk {
Ok(output) => println!("Output: {}", output.stdout),
Err(e) => eprintln!("Error: {}", e),
}
}
Ok(())
}
## Project Initialization
```rust
use ai00_run::init;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
init::initialize_project(None, None, None).await?;
Ok(())
}
use ai00_run::node;
#[tokio::main]
async fn main() -> ai00_run::Result<()> {
match node::install("18.0.0").await {
Ok(()) => println!("Success"),
Err(e) => eprintln!("Error: {}", e),
}
Ok(())
}
# Build
cargo build --release
# Test
cargo test
# Format
cargo fmt
# Lint
cargo clippy
Contributions welcome! Fork the repository and submit pull requests.
MIT OR Apache-2.0 dual license.
Inspired by: