docs/cli/CLI_REDESIGN.md
Redesign the CLI structure to be more intuitive, consistent, and user-friendly while maintaining power-user capabilities. All top-level commands (except start/stop) will support interactive wizards when called without arguments, making the CLI approachable for new users while keeping direct command paths for scripting.
local://, s3://, content://)--format json supportsd start [--foreground] # Start daemon
sd stop [--reset] # Stop daemon (optional data reset)
sd config # Interactive: show current config, prompt to edit
sd config get <key> # Get specific config value
sd config set <key> <value> # Set config value
sd library # Show current library status (name, locations, stats, devices)
sd library create # Interactive: name, path, settings
sd library switch # Interactive: select from list
sd library list # List all libraries
sd library delete # Interactive: select + confirm
sd location # Interactive: list → add/remove/rescan
sd location add # Interactive wizard (already implemented)
sd location remove # Interactive: select from list
sd location rescan [id] # Interactive: select location if no ID
sd location list # List all locations
sd browse [path|uri] # Smart browsing with interactive TUI
# - Uses location index if path is managed
# - Falls back to ephemeral index if outside locations
# - No path = interactive root picker
Behavior:
sd ls [path|uri] # List files (simple output)
sd cp <src> <dst> # Copy (supports URIs + --device/--cloud flags)
sd mv <src> <dst> # Move
sd rm <path|uri> # Delete (with confirmation)
sd info <path|uri> # Show file metadata
SdPath Examples:
# Traditional paths
sd cp /Users/me/file.txt /backup/
# SdPath URIs
sd cp local://macbook/Users/me/file.txt s3://my-bucket/backup/
sd info content://550e8400-e29b-41d4-a716-446655440000
sd search # Interactive: query builder with filters
sd search <query> # Direct search
sd search --tag <tag> # Filter by tag
sd search --type <type> # Filter by file type
sd search --content <text> # Content search
sd search --size <range> # Size filter
sd search --date <range> # Date filter
sd tag # Interactive: select file → add tags
sd tag create # Interactive: name, color, namespace
sd tag apply <target> <tags> # Direct apply tags
sd tag remove <target> <tags> # Remove tags
sd tag list # List all tags
sd tag search <query> # Search tag names (different from sd search)
sd collection # Interactive: list → create/add/remove
sd collection create # Interactive: name, description
sd collection add <id> # Interactive: select files to add
sd collection remove <id> # Interactive: select files to remove
sd collection list # List all collections
sd pair # Interactive: initiate or join
sd pair initiate # Generate pairing code
sd pair join [code] # Interactive: enter code if not provided
Note: These are paired devices, not devices registered in a library, for clarity we should show which libraries these devices are participating in by quering the devices table for all libraries!
sd devices # Interactive: list → revoke/manage
sd devices list # List paired devices
sd devices remove <id> # Remove/revoke device
This doesn't exist yet so we can implement as a stub
sd share # Interactive: select device → select file
sd share <device> <file> # Direct share via Spacedrop
sd cloud # Interactive wizard (already implemented)
sd cloud add # Interactive: service type → credentials
sd cloud remove # Interactive: select volume
sd cloud list # List cloud volumes
sd volume # Interactive: list → manage
sd volume list # List all volumes (local + cloud)
sd sync # Interactive: conduit management
sd sync status # Show sync state
sd sync create # Interactive: create sync conduit
sd job # Interactive: list → monitor/pause/cancel
sd job list # List all jobs
sd job monitor [id] # Monitor jobs with TUI (all or specific)
sd job pause <id> # Pause job
sd job resume <id> # Resume job
sd job cancel <id> # Cancel job
sd logs # Interactive: show or follow
sd logs show [--tail N] # Show recent logs
sd logs follow # Follow logs in real-time
sd index → Functionality absorbed into sd location and sd browsesd status → Replaced by sd library (shows current state)sd network → Split into sd pair, sd devices, sd sharesd restart → Can be achieved with sd stop && sd startsd update → Can be system-level or sd daemon update if neededsd location browse → sd browse (root level, location-aware)sd index quick-scan → sd browse (ephemeral mode automatic)sd index start → sd location add (with mode flags)sd index verify → sd location rescan --verifysd network pair → sd pairsd network devices → sd devicessd network spacedrop → sd shareGoal: Reorganize command structure and file layout
Tasks:
Create new domain modules:
apps/cli/src/domains/browse/ (new)apps/cli/src/domains/pair/ (split from network)apps/cli/src/domains/share/ (split from network)apps/cli/src/domains/collection/ (new)Remove obsolete modules:
apps/cli/src/domains/index/ (merge into location + browse)Update apps/cli/src/main.rs:
Commands enum to match new hierarchyUpdate existing domain modules to match new patterns
Goal: Create location-aware browsing command
Tasks:
Implement browse command with dual-mode indexing:
Add interactive TUI for navigation:
Support SdPath URIs for remote browsing:
sd browse local://device/pathsd browse s3://bucket/prefixGoal: Restore and improve global search
Tasks:
domains/search/ with enhanced functionality--tag, --type, --content, --size, --dateGoal: Add wizards to all commands that should have them
Commands requiring wizards:
sd config - show/edit flowsd browse - TUI navigatorsd search - query buildersd tag - tagging workflowsd collection - collection managementsd pair - pairing flowsd devices - device managementsd share - file sharing pickersd volume - volume managementsd job - job list → actionssd logs - show/follow pickerImplementation approach:
dialoguer crate for promptsGoal: Support both traditional paths and SdPath URIs
Tasks:
Create URI parser that accepts both formats
Update file operations (ls, cp, mv, rm, info, browse):
/Users/me/file.txtlocal://device/path, s3://bucket/key, content://uuid--device, --cloudAdd resolution logic:
Error handling:
Goal: Comprehensive documentation and UX refinement
Tasks:
--help outputdocs/cli/--format json works consistentlyFor users upgrading from current CLI:
Breaking changes:
sd index removed → use sd location add or sd browsesd network pair → sd pairsd network spacedrop → sd sharesd status → sd libraryNon-breaking:
browse is separate from lsbrowse is an interactive navigator with TUIls is a simple list command (like traditional Unix ls)search is global while tag search existssd search searches file content, names, metadata across entire librarysd tag search searches for tag names themselvesnetwork into pair, devices, sharesd statussd library provides library-level status (the most common query)sd daemon status if neededsd config separate