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).
Complete reference for all wsb command-line options and usage patterns.
All tools are subcommands of the wsb binary:
wsb <COMMAND> [OPTIONS]
| Command | Description |
|---|---|
refactor |
Recursive string replacement in files and directories |
git |
Git integration and version management |
template |
Tera template management |
update |
Update version and render templates |
wsbtemplate |
Cross-project .wstemplate version stamping |
version |
Database-driven version management |
scrap |
Local trash can using .scrap folder |
unscrap |
Restore files from .scrap folder |
ldiff |
Line difference visualization |
code |
AST-based code analysis and transformation |
test |
Intelligent test runner based on project type |
status |
Project status with feature metrics |
feature |
Feature management with state machine workflow |
task |
Feature-centric task management |
directive |
Project directive and rule management |
note |
Note management for any entity |
relationship |
Entity relationship management |
start |
Start development session |
end |
End development session |
continuity |
Session continuity and context management |
consolidate |
Documentation consolidation |
database |
Database backup, recovery, maintenance |
serve |
Web server for Claude AI integration |
sample |
Create sample project with test data |
Recursive string replacement in file names and contents with collision detection.
wsb refactor <ROOT_DIR> <OLD_STRING> <NEW_STRING> [OPTIONS]
| Argument | Description |
|---|---|
ROOT_DIR |
Root directory to search in (use . for current directory) |
OLD_STRING |
String to find and replace |
NEW_STRING |
Replacement string |
| Option | Short | Description | Default |
|---|---|---|---|
--assume-yes |
-y |
Skip confirmation prompts | false |
--force |
-f |
Skip confirmation prompt | false |
--verbose |
-v |
Show detailed output | false |
--backup |
-b |
Create backup files before modifying | false |
--follow-symlinks |
Follow symbolic links | false |
|
--files-only |
Only process files (skip directories) | false |
|
--dirs-only |
Only process directories (skip files) | false |
|
--names-only |
Skip content replacement, only rename | false |
|
--content-only |
Skip renaming, only replace content | false |
|
--include <PATTERN> |
Include only files matching glob (repeatable) | all | |
--exclude <PATTERN> |
Exclude files matching glob (repeatable) | none | |
--max-depth <N> |
Maximum depth to search (0 = unlimited) | 0 |
|
--threads <N> |
-j |
Number of threads (0 = auto) | 0 |
--ignore-case |
-i |
Case-insensitive matching | false |
--regex |
-r |
Use regex patterns | false |
--format <FORMAT> |
Output format: human, json, plain |
human |
|
--progress <MODE> |
Progress display: auto, always, never |
auto |
Only one mode flag (--files-only, --dirs-only, --names-only, --content-only) can be specified at a time.
wsb refactor . "oldname" "newname" # Full replacement
wsb refactor . "oldname" "newname" --verbose # Preview first
wsb refactor . "oldname" "newname" --include "*.rs" --backup
wsb refactor . "old.api.com" "new.api.com" --content-only
wsb refactor . "OldClass" "NewClass" --names-only
wsb refactor . "old_\\w+" "new_name" --regex
wsb refactor . "oldname" "newname" --format json # Machine-readable output
| Code | Meaning |
|---|---|
0 |
Success |
1 |
General error |
2 |
Invalid arguments |
3 |
Permission denied |
4 |
File not found |
5 |
Naming collision detected |
Git integration and version management via pre-commit hooks.
| Subcommand | Description | Options |
|---|---|---|
install |
Install pre-commit hook | --force |
uninstall |
Remove hook | |
show |
Display version information | |
status |
Show configuration status |
wsb git install # Install git hook
wsb git install --force # Force reinstall
wsb git show # Show version info
wsb git status # Check configuration
wsb git uninstall # Remove hook
Tera template management for automatic file generation during wsb update.
| Subcommand | Description |
|---|---|
add |
Add a new template |
list |
List all templates |
show |
Show template details |
update |
Update an existing template |
delete |
Remove a template |
render |
Render all enabled templates |
wsb template add version-header --template "v" --output version.h
wsb template list
wsb template show version-header
wsb template render
wsb template delete version-header
Update version file and render all templates (both .tera and .wstemplate).
wsb update [OPTIONS]
| Option | Description | Default |
|---|---|---|
--no-git |
Skip git integration | false |
--git-add |
Auto-add updated files to git staging | false |
version.txt.tera templates via the template manager.wstemplate files via the wstemplate engine--git-add: stages version.txt, rendered .tera outputs, and rendered .wstemplate outputswsb update # Basic update
wsb update --git-add # Update and stage files
wsb update --no-git # Update without git integration
Manage .wstemplate file rendering for cross-project version stamping.
Each project has a single wstemplate entry consisting of an alias (Tera identifier)
and a scan root (directory tree to search). Cross-project references like
`` are resolved dynamically by scanning the root for
sibling .wsb/state.json files.
| Subcommand | Description |
|---|---|
add <PATH> |
Set the scan root (replaces any existing entry) |
remove <ALIAS> |
Remove this project’s wstemplate entry |
list-entries |
Show this project’s wstemplate entry |
list |
List all .wstemplate files relevant to this project |
render |
Render all relevant .wstemplate files |
add| Option | Description |
|---|---|
--alias <ALIAS> |
Override auto-derived alias (must be valid Tera identifier) |
| Variable | Description |
|---|---|
| `` | Owning project’s full version (e.g., 0.5.12) |
| `` | e.g., v0 |
| `` | Commit count |
| `` | Line changes |
| `` | From manifest or directory name |
| `` | Any discoverable project’s version |
| `` | Any project’s major version |
| `` | Any project’s minor version |
| `` | Any project’s patch version |
| `` | Any project’s name |
| `` | RFC 3339 timestamp |
| `` | YYYY-MM-DD |
| `` | HH:MM:SS |
| `` | Year |
| `` | Month |
| `` | Day |
When rendering, only templates satisfying at least one condition are rendered:
version.txt: Hard error with instructions to run wsb update in the dependencywsb wstemplate add /path/to/workspace # Set scan root
wsb wstemplate add /path/to/workspace --alias mylib # Custom alias
wsb wstemplate list-entries # Show current entry
wsb wstemplate list # Show relevant templates
wsb wstemplate render # Render templates
wsb wstemplate remove mylib # Remove entry
Version management with database-driven major version and git-calculated components.
{major}.{minor}.{patch} where:
wsb version major (stored in database)| Subcommand | Description | Options |
|---|---|---|
show |
Display version breakdown | --verbose, --format |
major <N> |
Set major version number | |
tag |
Create git tag with current version | --prefix, --message |
info |
Show calculation details | --include-history |
wsb version show # Display version
wsb version show --verbose --format json # Detailed JSON output
wsb version major 2 # Set major to 2
wsb version tag # Create git tag
wsb version tag --prefix "release-" # Custom tag prefix
wsb version info --include-history # Show git history analysis
Local trash can using a .scrap folder for files you want to remove safely.
wsb scrap [PATH...] [SUBCOMMAND] [OPTIONS]
| Subcommand | Description | Options |
|---|---|---|
list |
List .scrap contents |
--sort name\|date\|size |
clean |
Remove old items | --days N |
purge |
Remove all items | --force |
find |
Search for patterns | --content |
archive |
Create archive | --output FILE, --remove |
wsb scrap temp.txt logs/ # Move to .scrap
wsb scrap list --sort size # List contents
wsb scrap find "*.log" # Find files
wsb scrap clean --days 30 # Remove old items
wsb scrap archive backup.tar.gz --remove # Archive and remove
wsb scrap purge --force # Empty completely
Restore files from .scrap folder to their original locations.
wsb unscrap [NAME] [OPTIONS]
| Option | Description |
|---|---|
--to PATH |
Custom restoration path |
--force |
Overwrite existing files |
wsb unscrap # Restore last item
wsb unscrap important_file.txt # Restore specific file
wsb unscrap config.json --to backup/ # Restore to directory
wsb unscrap data.txt --force # Overwrite existing
Process input lines, replacing repeated tokens with a substitute character to highlight differences.
wsb ldiff [SUBSTITUTE_CHAR]
Default substitute character: ░
echo -e "hello world\nhello universe" | wsb ldiff
tail -f /var/log/syslog | wsb ldiff
cat access.log | wsb ldiff "*"
Display project status with feature metrics and progress tracking.
| Option | Description | Default |
|---|---|---|
--debug-mode |
Enable diagnostic output | false |
--include-features |
Include feature breakdown | false |
--include-metrics |
Include detailed metrics | false |
--format |
Output format: human, json, summary |
human |
wsb status
wsb status --include-features
wsb status --include-metrics --format json
Feature management with state machine workflow and validation.
| Subcommand | Description |
|---|---|
add |
Add a new feature |
list |
List features with filters |
show |
Show feature details |
update |
Update feature status/properties |
wsb feature add "User authentication"
wsb feature list --state implemented
wsb feature show F00001
Feature-centric task management with automatic feature detection.
| Subcommand | Description |
|---|---|
add |
Add a new task |
list |
List tasks with filters |
show |
Show task details |
update |
Update task status/properties |
complete |
Mark task as completed |
start |
Start working on a task |
block |
Mark task as blocked |
unblock |
Remove blocked status |
wsb task add "Implement login" "Build the login page" --feature F00001
wsb task list --status pending
wsb task show T000001
wsb task start T000001
wsb task complete T000001 --evidence "Tests passing"
Project directive and rule management.
| Subcommand | Description |
|---|---|
add |
Add a new directive |
list |
List directives |
show |
Show directive details |
update |
Update directive |
activate |
Activate a directive |
deactivate |
Deactivate a directive |
check |
Check directive compliance |
AST-based code analysis and codebase exploration.
| Subcommand | Description |
|---|---|
tree |
Visual tree of codebase structure (default) |
search |
Search for AST patterns in source code |
tree| Option | Description | Default |
|---|---|---|
--depth N |
Maximum depth to display | 3 |
--hidden |
Show hidden files and directories | false |
--sizes |
Show file sizes | false |
--extensions |
Filter by file extensions (e.g., rs,py,js) |
all |
--no-ignore |
Ignore .gitignore rules | false |
wsb code # Show tree (default)
wsb code tree --depth 5 --sizes # Deep tree with file sizes
wsb code tree --extensions rs,toml # Only Rust files
wsb code search "fn main" --language rust
Intelligent test runner that detects project type and runs appropriate tests.
| Option | Description | Default |
|---|---|---|
--dry-run |
Show test command without executing | false |
--install |
Install missing test runners | false |
wsb test # Run tests for detected project type
wsb test --dry-run # Show what would run
wsb test -- --nocapture # Pass args to test runner
Session management for development workflow.
wsb init # Initialize a new workspace in the current directory
wsb init "Implement auth" # Initialize and record the first task
wsb start # Start new session
wsb start --continue-from T000001 # Continue from task
wsb start "Implement auth" # Start with first task description
wsb end # End session
wsb end --summary "Completed auth" # End with summary
wsb end --skip-docs # Skip documentation updates
Web server for Claude AI integration with automatic session management.
| Option | Description | Default |
|---|---|---|
--port |
HTTP server port | 3000 |
--debug |
Enable debug logging | false |
--migrate |
Migrate features from features.md to database | false |
wsb # Start on localhost:3000
wsb serve --port 8080 # Custom port
wsb serve --debug # With debug logging
Database backup, recovery, and maintenance operations.
Session continuity and context management.
| Subcommand | Description |
|---|---|
list |
List continuity records |
snapshot |
Create context snapshot |
Documentation consolidation with diagram management.
| Option | Description |
|---|---|
--generate-diagrams |
Generate architectural diagrams in DOT format |
--preserve-complexity |
Preserve complexity information |
--force |
Force consolidation |
wsb --help # Show all commands
wsb <COMMAND> --help # Help for specific command