| Crates.io | vx-shim |
| lib.rs | vx-shim |
| version | 0.2.3 |
| created_at | 2025-06-16 07:15:07.346117+00 |
| updated_at | 2025-06-18 05:17:26.61769+00 |
| description | Cross-platform shim executable for vx tool manager |
| homepage | https://github.com/loonghao/vx |
| repository | https://github.com/loonghao/vx |
| max_upload_size | |
| id | 1714005 |
| size | 70,824 |
Cross-platform shim executable for the vx universal tool manager.
vx-shim is a lightweight, cross-platform executable that acts as a proxy to other executables. It's inspired by scoop-better-shimexe but written in Rust for better cross-platform support and modern features.
.shim file with the same name as the executable# Path to the target executable
path = "/usr/bin/git"
# Optional arguments to prepend
args = "status -u"
# Working directory (optional)
working_dir = "/workspace"
# Environment variables (optional)
[env]
GIT_EDITOR = "vim"
PAGER = "less"
# Signal handling configuration (optional)
[signal_handling]
ignore_sigint = true
forward_signals = true
kill_on_exit = true
# Windows-specific options (optional)
hide_console = false
run_as_admin = false
path = C:\Program Files\Git\git.exe
args = status -u
working_dir = C:\workspace
env.GIT_EDITOR = vim
env.PAGER = less
use vx_shim::{ShimConfig, Executor};
// Load configuration
let config = ShimConfig::load("my-tool.shim")?;
// Execute with arguments
let executor = Executor::new(config);
let exit_code = executor.execute(&["--version"])?;
# The shim executable looks for a .shim file with the same name
# For example, git.exe looks for git.shim
# Create a shim configuration
echo 'path = "/usr/bin/git"' > git.shim
echo 'args = "status -u"' >> git.shim
# Copy vx-shim to git (or git.exe on Windows)
cp vx-shim git
# Now running ./git will execute: /usr/bin/git status -u [additional args]
./git --short
# Executes: /usr/bin/git status -u --short
cargo install vx-shim
git clone https://github.com/loonghao/vx
cd vx/crates/vx-shim
cargo build --release
cargo build
cargo test
# Test on Windows
cargo test --target x86_64-pc-windows-msvc
# Test on Linux
cargo test --target x86_64-unknown-linux-gnu
# Test on macOS
cargo test --target x86_64-apple-darwin
vx-shim is designed to work seamlessly with the vx tool manager:
# echo.shim
path = "/bin/echo"
args = "Hello from shim:"
./echo world
# Output: Hello from shim: world
# node.shim
path = "/usr/local/bin/node"
working_dir = "/workspace"
[env]
NODE_ENV = "development"
DEBUG = "*"
# notepad.shim
path = "C:\\Windows\\System32\\notepad.exe"
hide_console = true
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see the contributing guidelines for more information.