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 st8 (automatic versioning).
A unified tool suite for developers and system administrators that provides file operations, line analysis, version management, and development workflow automation. All tools accessible through a single ws
binary with intuitive subcommands.
Current Version: 0.38.31859
Build Status: Clean compilation with zero warnings
Test Status: 249 tests passing across 8 test suites
Recursive string replacement with automatic encoding detection and safety features.
# Refactor always previews changes and asks for confirmation
ws refactor ./src "OldClassName" "NewClassName" --verbose
# Refactor with backups and specific file types
ws refactor ./src "OldApi" "NewApi" --backup --include "*.rs" --include "*.toml"
# Include hidden files like .ws configurations
ws refactor . "old_name" "new_name" --include-hidden
Key Features: Encoding detection (UTF-8, UTF-16, Windows-1252), pre-validation, collision detection, multi-threaded processing
Developer Focus: API migrations, bulk renames, safe refactoring, configuration updates
Complete Guide
Real-time pattern recognition for logs and command output with ANSI color preservation.
# Monitor logs in real-time
tail -f /var/log/system.log | ws ldiff
# Analyze different log sources with distinct markers
journalctl -f | ws ldiff "■"
systemctl status | ws ldiff "●"
cargo test --verbose | ws ldiff "█"
Key Features: Real-time streaming, ANSI preservation, customizable visualization, pattern recognition
Developer Focus: Debug analysis, monitoring, test output parsing, system administration
Complete Guide
Safe file disposal with metadata tracking, search capabilities, and git integration.
# Move files to local trash instead of deleting
ws scrap experimental_feature/ temp_logs/ *.bak old_tests/
# Search and browse stored files
ws scrap find "*.rs" --content
ws scrap list --sort date
# Archive and clean up old items
ws scrap archive --output backup-$(date +%Y%m%d).tar.gz --remove
ws scrap clean --days 14
Key Features: Metadata tracking, conflict resolution, content search, git integration, archive support
Developer Focus: Experimental code cleanup, safe file disposal, temporary file management
Complete Guide
Restore files from scrap with automatic path reconstruction and conflict resolution.
# Quick restore operations
ws unscrap # Restore last scrapped item
ws unscrap experimental_feature/ # Restore specific directory
ws unscrap important.rs --to ~/backup/ # Custom destination with conflict handling
Key Features: Automatic recovery, custom destinations, conflict handling, batch restoration
Developer Focus: Accident recovery, experiment rollback, selective file restoration
Complete Guide
Git-integrated versioning with template engine for automated file generation.
# Set up automatic versioning
ws git install
# Add templates that auto-update with version changes
ws template add version-header \
--template "#define VERSION \"\"
#define BUILD_DATE \"\"" \
--output "src/version.h"
# Manual version update and template rendering
ws update --git-add
# Templates render automatically on commits
git add . && git commit -m "New feature" # Auto-increments version and renders templates
Key Features: Git integration, Tera template engine, automatic rendering, multi-format support
Developer Focus: Release automation, version consistency, file generation, CI/CD integration
Complete Guide
The template system supports Tera templating with these variables:
,
, `` - Version components,
, `` - Build timestampsws template add version-header \
--template \
"#ifndef VERSION_H
#define VERSION_H
#define PROJECT_VERSION \"\"
#define BUILD_DATE \"\"
#endif" \
--output "include/version.h"
ws template add version-js \
--template \
"export const VERSION = {
full: '',
major: ,
buildDate: ''
};" \
--output "src/version.js"
ws template add docker-compose \
--template \
"version: '3.8'
services:
app:
image: :
environment:
- VERSION=" \
--output "docker-compose.prod.yml"
| Test Suite | Tests | Focus Area |
|————|——-|————|
| integration_tests
| 18 | Cross-tool integration |
| refac_concurrency_tests
| 9 | Multi-threading safety |
| refac_edge_cases_tests
| 14 | Complex scenarios |
| refac_encoding_tests
| 7 | Encoding safety |
| scrap_advanced_integration_tests
| 21 | Workflows |
| st8_template_tests
| 15 | Template system |
git clone https://github.com/jowharshamshiri/workspace.git
cd workspace
./install.sh
# Check installation and version
ws --version # Should show: ws 0.34.20950
# Test basic functionality
echo "hello world" | ws ldiff
ws git status
ws refactor --help
# 1. Review changes (refactor shows changes before applying)
ws refactor ./src "OldApi" "NewApi" --verbose
# 2. Apply refactoring with backups
ws refactor ./src "OldApi" "NewApi" --backup
# 3. Update configuration files
ws refactor ./config "old.endpoint" "new.endpoint" --content-only --include "*.toml"
# 4. Clean up old test files
ws scrap legacy_tests/ old_benchmarks/
# 5. Update version and render templates
ws update --git-add # Templates auto-render with new version
# 1. Monitor application logs in real-time
tail -f /var/log/app.log | ldiff
# 2. Analyze historical patterns
cat /var/log/app.log.1 | ldiff > patterns-yesterday.txt
# 3. Compare different deployments
cat deployment-v1.log | ldiff "v1:" > patterns-v1.txt
cat deployment-v2.log | ldiff "v2:" > patterns-v2.txt
diff patterns-v1.txt patterns-v2.txt
# 1. Move questionable files to safe storage
scrap experimental_code/ temp_data/ *.backup
# 2. Review and search stored files
scrap list --sort date
scrap find "important" --content
# 3. Archive old items or restore needed files
scrap archive --output archive-$(date +%Y%m%d).tar.gz
unscrap important_config.toml --to ./config/
Each tool provides help documentation:
ws refactor --help # Refac documentation
ws ldiff --help # Log analysis usage guide
ws scrap --help # File management operations
ws unscrap --help # Recovery system guide
ws git --help # Git integration and version management
ws template --help # Template system commands
ws update --help # Version update commands
MIT License - see the LICENSE file for details.