|
| 1 | +# CCMD Features |
| 2 | + |
| 3 | +## Core Features |
| 4 | + |
| 5 | +### ✨ Custom Command Management (v1.1.0+) |
| 6 | + |
| 7 | +Create and manage your own custom commands that persist across CCMD updates! |
| 8 | + |
| 9 | +**Commands:** |
| 10 | +- `add` - Create a new custom command interactively |
| 11 | +- `remove` - Delete a custom command |
| 12 | +- `reload` - Reload configuration and update shell integration |
| 13 | + |
| 14 | +**Features:** |
| 15 | +- Commands stored in `~/.ccmd/custom_commands.yaml` (separate from CCMD defaults) |
| 16 | +- Survives CCMD updates - your custom commands never get overwritten |
| 17 | +- Interactive creation with helpful prompts |
| 18 | +- Auto-updates shell integration after adding/removing commands |
| 19 | +- Platform-aware reload instructions |
| 20 | + |
| 21 | +**Example:** |
| 22 | +```bash |
| 23 | +# Create a custom command |
| 24 | +add |
| 25 | +> Enter command name: myls |
| 26 | +> Enter description: My custom ls with colors |
| 27 | +> Enter command: ls -la --color=auto |
| 28 | +> Interactive? No |
| 29 | + |
| 30 | +# Use it immediately after reloading |
| 31 | +. $PROFILE # or source ~/.bashrc |
| 32 | +myls |
| 33 | + |
| 34 | +# Remove it when no longer needed |
| 35 | +remove |
| 36 | +``` |
| 37 | + |
| 38 | +### 🔄 Configuration Reload |
| 39 | + |
| 40 | +Instantly reload your CCMD configuration without manual reinstall: |
| 41 | + |
| 42 | +```bash |
| 43 | +reload |
| 44 | +``` |
| 45 | + |
| 46 | +This command: |
| 47 | +- Reloads all commands from `commands.yaml` |
| 48 | +- Includes custom commands from `~/.ccmd/custom_commands.yaml` |
| 49 | +- Updates shell integration automatically |
| 50 | +- Shows platform-specific reload instructions |
| 51 | +- No need to manually run `--install` anymore! |
| 52 | + |
| 53 | +### 🎯 Interactive Push (v1.1.0+) |
| 54 | + |
| 55 | +Enhanced git workflow with interactive prompts: |
| 56 | + |
| 57 | +```bash |
| 58 | +push |
| 59 | +``` |
| 60 | + |
| 61 | +**Features:** |
| 62 | +- Select which directory to push from |
| 63 | +- Git repository validation |
| 64 | +- File selection (add all or select specific files) |
| 65 | +- Auto-generated commit messages based on changes |
| 66 | +- Option to write custom commit message |
| 67 | +- Push confirmation |
| 68 | +- Full error handling and helpful messages |
| 69 | + |
| 70 | +### 📋 Command List Editor (v1.1.0+) |
| 71 | + |
| 72 | +Manage which commands are available in your shell: |
| 73 | + |
| 74 | +```bash |
| 75 | +list |
| 76 | +``` |
| 77 | + |
| 78 | +**Features:** |
| 79 | +- Interactive command list with enable/disable toggle |
| 80 | +- Shows command descriptions |
| 81 | +- Marks custom commands with `[CUSTOM]` badge |
| 82 | +- Marks disabled commands with `[DISABLED]` badge |
| 83 | +- Auto-updates shell integration after changes |
| 84 | + |
| 85 | +### 🛡️ Graceful Cancellation (v1.1.0+) |
| 86 | + |
| 87 | +All interactive commands now handle Ctrl+C gracefully: |
| 88 | + |
| 89 | +- Shows "→ Action cancelled" instead of ugly stack traces |
| 90 | +- Exits cleanly without errors |
| 91 | +- Works across all platforms (Linux, WSL, Windows, macOS) |
| 92 | + |
| 93 | +### 🌍 Cross-Platform Support |
| 94 | + |
| 95 | +CCMD works on: |
| 96 | +- ✅ **Linux** (Ubuntu, Debian, Fedora, Arch, etc.) |
| 97 | +- ✅ **WSL** (Windows Subsystem for Linux) - Tested on WSL 2 |
| 98 | +- ✅ **Windows PowerShell** - Fully tested |
| 99 | +- ⚠️ **macOS** - Code supports it, but untested (we need your feedback!) |
| 100 | + |
| 101 | +**Shells Supported:** |
| 102 | +- Bash |
| 103 | +- Zsh |
| 104 | +- Fish |
| 105 | +- PowerShell |
| 106 | + |
| 107 | +### 📁 Smart Directory Navigation |
| 108 | + |
| 109 | +Navigate to common directories with shortcuts and search: |
| 110 | + |
| 111 | +```bash |
| 112 | +# Predefined locations |
| 113 | +go downloads # → ~/Downloads |
| 114 | +go documents # → ~/Documents |
| 115 | +go desktop # → ~/Desktop |
| 116 | +go home # → ~ |
| 117 | +go ccmd # → $CCMD_HOME |
| 118 | + |
| 119 | +# Smart search (finds directories in common locations) |
| 120 | +go myproject # Searches and navigates to "myproject" |
| 121 | +go lha # Finds and navigates to LHA directory |
| 122 | +``` |
| 123 | + |
| 124 | +**Features (v1.1.0+):** |
| 125 | +- Cross-platform search (works on Windows, Linux, WSL) |
| 126 | +- Searches up to 3 levels deep in common locations |
| 127 | +- Case-insensitive matching |
| 128 | +- Optimized for performance |
| 129 | + |
| 130 | +### ⚙️ Built-in System Commands |
| 131 | + |
| 132 | +**System Monitoring:** |
| 133 | +```bash |
| 134 | +cpu # Show CPU usage |
| 135 | +mem # Show memory usage |
| 136 | +proc # Show running processes |
| 137 | +``` |
| 138 | + |
| 139 | +**Process Management:** |
| 140 | +```bash |
| 141 | +kap <pid> # Kill a process by PID |
| 142 | +``` |
| 143 | + |
| 144 | +**Git Operations:** |
| 145 | +```bash |
| 146 | +push # Interactive git add, commit, and push |
| 147 | +``` |
| 148 | + |
| 149 | +**CCMD Management:** |
| 150 | +```bash |
| 151 | +update # Update CCMD from GitHub |
| 152 | +version # Show current and latest version |
| 153 | +restore # Restore shell config from backup |
| 154 | +uninstall # Remove CCMD |
| 155 | +reload # Reload configuration (v1.1.0+) |
| 156 | +list # Manage commands (v1.1.0+) |
| 157 | +add # Add custom command (v1.1.0+) |
| 158 | +remove # Remove custom command (v1.1.0+) |
| 159 | +``` |
| 160 | + |
| 161 | +## Configuration |
| 162 | + |
| 163 | +### Command Structure |
| 164 | + |
| 165 | +Commands are defined in YAML format: |
| 166 | + |
| 167 | +```yaml |
| 168 | +commands: |
| 169 | + mycommand: |
| 170 | + description: What this command does |
| 171 | + action: the command to execute |
| 172 | + type: command_type |
| 173 | + interactive: false # Set to true for commands needing user input |
| 174 | +``` |
| 175 | +
|
| 176 | +### Command Types |
| 177 | +
|
| 178 | +- `navigation` - Directory navigation commands |
| 179 | +- `git` - Git-related operations |
| 180 | +- `system` - System monitoring/management |
| 181 | +- `internal` - CCMD management commands |
| 182 | +- `custom` - User-defined commands (v1.1.0+) |
| 183 | + |
| 184 | +### Platform-Specific Actions |
| 185 | + |
| 186 | +Commands can have different actions per platform: |
| 187 | + |
| 188 | +```yaml |
| 189 | +mycommand: |
| 190 | + description: Cross-platform command |
| 191 | + action: |
| 192 | + linux: command for linux |
| 193 | + macos: command for macOS |
| 194 | + windows: command for Windows |
| 195 | +``` |
| 196 | + |
| 197 | +### Interactive Commands |
| 198 | + |
| 199 | +Commands marked as `interactive: true` run with direct terminal access: |
| 200 | + |
| 201 | +```yaml |
| 202 | +push: |
| 203 | + description: Git push |
| 204 | + interactive: true |
| 205 | + action: git add . && git commit -m "{message}" && git push |
| 206 | +``` |
| 207 | + |
| 208 | +## Advanced Features |
| 209 | + |
| 210 | +### Backup & Restore |
| 211 | + |
| 212 | +CCMD automatically backs up your shell configuration before making changes: |
| 213 | + |
| 214 | +- Backups stored in `~/.ccmd/backups/` |
| 215 | +- Includes timestamp in filename |
| 216 | +- Restore with `restore` command |
| 217 | +- Multiple backups maintained |
| 218 | + |
| 219 | +### Command Disabling |
| 220 | + |
| 221 | +Disable commands without deleting them: |
| 222 | + |
| 223 | +1. Run `list` command |
| 224 | +2. Toggle commands on/off |
| 225 | +3. Save and reload shell |
| 226 | + |
| 227 | +Disabled commands are tracked in `$CCMD_HOME/.disabled_commands` |
| 228 | + |
| 229 | +### Custom Command Persistence |
| 230 | + |
| 231 | +Custom commands survive CCMD updates because they're stored separately: |
| 232 | + |
| 233 | +- **CCMD defaults:** `$CCMD_HOME/commands.yaml` (overwritten on update) |
| 234 | +- **Your customs:** `~/.ccmd/custom_commands.yaml` (never touched) |
| 235 | + |
| 236 | +### Shell Integration |
| 237 | + |
| 238 | +CCMD generates shell-specific integration code: |
| 239 | + |
| 240 | +- **Bash/Zsh:** Function wrappers in `.bashrc`/`.zshrc` |
| 241 | +- **Fish:** Function files in Fish syntax |
| 242 | +- **PowerShell:** Function definitions in `$PROFILE` |
| 243 | + |
| 244 | +Features: |
| 245 | +- Automatic `cd` command detection |
| 246 | +- Output capture for non-interactive commands |
| 247 | +- Direct execution for interactive commands |
| 248 | +- Error checking with helpful messages |
| 249 | + |
| 250 | +## Platform-Specific Features |
| 251 | + |
| 252 | +### Windows PowerShell |
| 253 | + |
| 254 | +- UTF-8 console encoding for Unicode support |
| 255 | +- Windows-specific system commands |
| 256 | +- PowerShell-native implementations |
| 257 | +- Full path resolution for Windows paths |
| 258 | + |
| 259 | +### WSL (Windows Subsystem for Linux) |
| 260 | + |
| 261 | +- Access to both Linux and Windows filesystems |
| 262 | +- `/mnt/c/` path support |
| 263 | +- Cross-platform directory search |
| 264 | +- Works with Windows Python or WSL Python |
| 265 | + |
| 266 | +### Linux |
| 267 | + |
| 268 | +- Full compatibility with all distributions |
| 269 | +- Native shell integration |
| 270 | +- Optimal performance with `find` command |
| 271 | +- Standard Unix tools support |
| 272 | + |
| 273 | +### macOS (Untested) |
| 274 | + |
| 275 | +- Code supports macOS |
| 276 | +- Should work with both Bash and Zsh |
| 277 | +- We need community testing and feedback! |
| 278 | +- Please report issues on GitHub |
| 279 | + |
| 280 | +## Version History |
| 281 | + |
| 282 | +### v1.1.0 (Current) |
| 283 | +- ✨ Custom commands feature |
| 284 | +- ✨ `add` and `remove` commands |
| 285 | +- ✨ `reload` command for quick config updates |
| 286 | +- ✨ Interactive push with full workflow |
| 287 | +- ✨ Command list editor with enable/disable |
| 288 | +- ✨ Graceful Ctrl+C handling |
| 289 | +- 🐛 Fixed PowerShell encoding issues |
| 290 | +- 🐛 Fixed directory search on Windows |
| 291 | +- 🐛 Fixed interactive command hanging |
| 292 | +- 📝 Platform-aware reload instructions |
| 293 | + |
| 294 | +### v1.0.6 |
| 295 | +- System monitoring commands |
| 296 | +- Git integration |
| 297 | +- Directory navigation |
| 298 | +- Cross-platform support |
| 299 | + |
| 300 | +### v1.0.0 |
| 301 | +- Initial release |
| 302 | +- Basic command management |
| 303 | +- Shell integration |
| 304 | + |
| 305 | +## Experimental Features |
| 306 | + |
| 307 | +These features are available but may need refinement: |
| 308 | + |
| 309 | +- macOS support (untested) |
| 310 | +- Fish shell integration (code exists, needs testing) |
| 311 | +- PowerShell on macOS (untested) |
| 312 | + |
| 313 | +## Contributing |
| 314 | + |
| 315 | +Want to add a feature? Check out [CONTRIBUTING.md](CONTRIBUTING.md) |
| 316 | + |
| 317 | +Found a bug? Open an issue on [GitHub](https://github.com/Wisyle/ccmd/issues) |
| 318 | + |
| 319 | +Have feedback on macOS? We especially need testing on: |
| 320 | +- macOS Monterey, Ventura, Sonoma |
| 321 | +- Both Intel and Apple Silicon |
| 322 | +- Both Bash and Zsh shells |
0 commit comments