| name | add-client-command |
| description | Checklist for adding a new client command (for example !mycmd) to the Leap interactive client. Lists every location to update so the command handler, help text, and dispatcher stay in sync. Use when adding or modifying a Leap client command. |
Add a New Client Command
When adding a new client command to Leap, update ALL of these locations to keep them in sync.
Files to Update
1. Command Handler — src/leap/client/client.py
_process_command() method — Add the command logic:
if line_lower in ['!mycmd', '!mycommand']:
print("Usage: !mycmd <arg> (e.g., !mycmd something)\n")
return True
if line_lower.startswith('!mycmd ') or line_lower.startswith('!mycommand '):
...
return True
_print_commands_help() method — Add to the commands list:
commands = [
...
("\U0001FXXX", "!mycmd <arg> or !mycommand <arg>", "Description here"),
...
]
Emoji rules:
- ALL emojis MUST be 2 display columns wide
- NEVER use single-width emojis (e.g.
⚡ U+26A1, 🗑 U+1F5D1, ℹ U+2139)
- Test in both JetBrains terminal AND iTerm2/Terminal.app
- If alignment breaks, the emoji is single-width — pick a different one
2. CLAUDE.md — CLAUDE.md
Update the Client Commands table:
| `!mycmd <arg>` or `!mycommand <arg>` | Description here |
3. README.md — README.md
Update the Client Commands table (includes emoji):
| 🔮 `!mycmd <arg>` or `!mycommand <arg>` | Description here |
4. Shell Help — src/scripts/leap-main.sh
Update the CLIENT COMMANDS section:
!mycmd <arg> Description here
Checklist