Workspace is a tool suite for file operations, version management, and development workflow automation. Includes refac (string replacement), scrap (local trash folder), unscrap (file restoration), and state (automatic versioning).
This guide covers installation methods for the Workspace tool suite.
rg) (required for wstemplate file discovery)git clone https://github.com/jowharshamshiri/wsb.git
cd workspace
./install.sh
The installation script will:
wsb binary in release mode (includes all tools as subcommands)~/.local/bin by default (or customize with -d option)./install.sh --help # See all available options
./install.sh -d /usr/local/bin # Install system-wide
./install.sh --force # Force reinstall even if up-to-date
./install.sh --verbose # Show detailed build output
./install.sh --check # Verify installation without installing
wsb --version
wsb --help
wsb refactor --help
wsb scrap --help
wsb git --help
wsb wstemplate --help
wsb version --help
# Test basic functionality
echo "hello world" | wsb ldiff # Test pattern recognition
wsb refactor . "test" "test" --verbose # Test string replacement preview
wsb git status # Test git integration status
./uninstall.sh # Remove from default location
./uninstall.sh -d /usr/local/bin # Remove from custom directory
git clone https://github.com/jowharshamshiri/wsb.git
cd workspace
cargo build --release
cargo install --path .
cargo install --path . --root ~/.local
cargo install --path . --root /usr/local # Requires sudo
For development or testing the latest changes:
git clone https://github.com/jowharshamshiri/wsb.git
cd workspace
# Run tools directly without installing
cargo run -- refactor --help
cargo run -- wstemplate --help
# Build in debug mode for development
cargo build
# Run the test suite
cargo test
RUSTFLAGS="-C target-cpu=native" cargo build --release
RUSTFLAGS="-C target-cpu=native" cargo install --path .
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
sudo apt update
sudo apt install build-essential git curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
git clone https://github.com/jowharshamshiri/wsb.git
cd workspace && ./install.sh
sudo pacman -S base-devel git rustup
rustup default stable
git clone https://github.com/jowharshamshiri/wsb.git
cd workspace && ./install.sh
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Install Xcode command line tools if needed
xcode-select --install
# Install ripgrep (required for wstemplate)
brew install ripgrep
# Install Workspace
git clone https://github.com/jowharshamshiri/wsb.git
cd workspace && ./install.sh
# Comprehensive functionality check
wsb refactor . "test" "test" --verbose # Test refactor preview
echo -e "line1\nline2\nline1" | wsb ldiff # Test ldiff pattern recognition
wsb scrap list # Test scrap
wsb git status # Test git integration
wsb unscrap --help # Test unscrap help
# Test template system
cd /tmp && mkdir test-project && cd test-project
git init
wsb git install
wsb template add test-template --template "Version: " --output test.txt
wsb template list
wsb template render
cd .. && rm -rf test-project
# Test scrap system
mkdir test-scrap && cd test-scrap
echo "test content" > test.txt
wsb scrap test.txt
wsb scrap list
wsb unscrap test.txt
cd .. && rm -rf test-scrap
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
# If installed via cargo install
export PATH="$HOME/.cargo/bin:$PATH"
# If installed via install.sh to custom location
export PATH="$HOME/.local/bin:$PATH"
cd /path/to/workspace
git pull origin main
./install.sh # Will detect updates and rebuild if needed
Or manually:
cd /path/to/workspace
git pull origin main
cargo build --release
cargo install --path . --force
“cargo: command not found”
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
“Permission denied” during installation
./install.sh -d ~/.local/bin
# Or use sudo for system installation
sudo ./install.sh -d /usr/local/bin
“Binary not found after installation”
echo $PATH | grep -E "(cargo/bin|local/bin)"
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
“xcrun: error: invalid active developer path” (macOS)
xcode-select --install
“failed to run custom build command” (Linux)
sudo apt install build-essential # Ubuntu/Debian
sudo dnf groupinstall "Development Tools" # Fedora
“No such file or directory” when running tools
which wsb
ls -la ~/.cargo/bin/wsb # Should be executable
cargo install --path . --force
If you encounter issues: