| Crates.io | shimexe-core |
| lib.rs | shimexe-core |
| version | 0.5.5 |
| created_at | 2025-06-16 14:57:14.109594+00 |
| updated_at | 2025-07-06 15:33:55.037411+00 |
| description | Core library for shimexe - executable shim manager |
| homepage | https://github.com/loonghao/shimexe |
| repository | https://github.com/loonghao/shimexe |
| max_upload_size | |
| id | 1714404 |
| size | 237,252 |
Core library for shimexe - a modern, cross-platform executable shim manager with environment variable expansion and TOML configuration support.
shimexe-core provides the foundational functionality for creating and managing executable shims. It offers a flexible and extensible architecture for building shim management tools.
Manages shim configuration including target executable paths, arguments, and environment variables.
Executes shims with proper argument handling and environment setup.
Provides variable expansion and templating for dynamic configuration.
Handles automatic updates for shim configurations and target executables.
Add this to your Cargo.toml:
[dependencies]
shimexe-core = "0.1.0"
use shimexe_core::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
// Load shim configuration
let config = ShimConfig::from_file("path/to/shim.toml")?;
// Create and run shim
let runner = ShimRunner::new(config);
let exit_code = runner.run(&["arg1", "arg2"]).await?;
std::process::exit(exit_code);
}
# shim.toml
[shim]
target = "${HOME}/bin/my-tool"
args = ["--config", "${CONFIG_DIR}/config.yaml"]
[shim.env]
PATH = "${PATH}:${HOME}/bin"
MY_TOOL_HOME = "${HOME}/.my-tool"
[shim.metadata]
name = "my-tool"
version = "1.0.0"
description = "My awesome tool"
use shimexe_core::*;
// Custom shim runner with additional features
struct CustomRunner {
inner: ShimRunner,
}
impl CustomizableShimRunner for CustomRunner {
fn pre_run(&mut self, args: &[String]) -> Result<()> {
// Custom pre-execution logic
println!("Running with args: {:?}", args);
Ok(())
}
fn post_run(&mut self, exit_code: i32) -> Result<()> {
// Custom post-execution logic
println!("Finished with exit code: {}", exit_code);
Ok(())
}
}
For detailed API documentation, visit docs.rs/shimexe-core.
Contributions are welcome! Please see the main repository for contribution guidelines.
This project is licensed under the MIT License - see the LICENSE-MIT file for details.