emdash-cli 0.1.35__py3-none-any.whl → 0.1.67__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- emdash_cli/client.py +41 -22
- emdash_cli/clipboard.py +30 -61
- emdash_cli/commands/__init__.py +2 -2
- emdash_cli/commands/agent/__init__.py +14 -0
- emdash_cli/commands/agent/cli.py +100 -0
- emdash_cli/commands/agent/constants.py +63 -0
- emdash_cli/commands/agent/file_utils.py +178 -0
- emdash_cli/commands/agent/handlers/__init__.py +51 -0
- emdash_cli/commands/agent/handlers/agents.py +449 -0
- emdash_cli/commands/agent/handlers/auth.py +69 -0
- emdash_cli/commands/agent/handlers/doctor.py +319 -0
- emdash_cli/commands/agent/handlers/hooks.py +121 -0
- emdash_cli/commands/agent/handlers/index.py +183 -0
- emdash_cli/commands/agent/handlers/mcp.py +183 -0
- emdash_cli/commands/agent/handlers/misc.py +319 -0
- emdash_cli/commands/agent/handlers/registry.py +72 -0
- emdash_cli/commands/agent/handlers/rules.py +411 -0
- emdash_cli/commands/agent/handlers/sessions.py +168 -0
- emdash_cli/commands/agent/handlers/setup.py +715 -0
- emdash_cli/commands/agent/handlers/skills.py +478 -0
- emdash_cli/commands/agent/handlers/telegram.py +475 -0
- emdash_cli/commands/agent/handlers/todos.py +119 -0
- emdash_cli/commands/agent/handlers/verify.py +653 -0
- emdash_cli/commands/agent/help.py +236 -0
- emdash_cli/commands/agent/interactive.py +842 -0
- emdash_cli/commands/agent/menus.py +760 -0
- emdash_cli/commands/agent/onboarding.py +619 -0
- emdash_cli/commands/agent/session_restore.py +210 -0
- emdash_cli/commands/agent.py +7 -1321
- emdash_cli/commands/index.py +111 -13
- emdash_cli/commands/registry.py +635 -0
- emdash_cli/commands/server.py +99 -40
- emdash_cli/commands/skills.py +72 -6
- emdash_cli/design.py +328 -0
- emdash_cli/diff_renderer.py +438 -0
- emdash_cli/integrations/__init__.py +1 -0
- emdash_cli/integrations/telegram/__init__.py +15 -0
- emdash_cli/integrations/telegram/bot.py +402 -0
- emdash_cli/integrations/telegram/bridge.py +865 -0
- emdash_cli/integrations/telegram/config.py +155 -0
- emdash_cli/integrations/telegram/formatter.py +385 -0
- emdash_cli/main.py +52 -2
- emdash_cli/server_manager.py +70 -10
- emdash_cli/sse_renderer.py +659 -167
- {emdash_cli-0.1.35.dist-info → emdash_cli-0.1.67.dist-info}/METADATA +2 -4
- emdash_cli-0.1.67.dist-info/RECORD +63 -0
- emdash_cli/commands/swarm.py +0 -86
- emdash_cli-0.1.35.dist-info/RECORD +0 -30
- {emdash_cli-0.1.35.dist-info → emdash_cli-0.1.67.dist-info}/WHEEL +0 -0
- {emdash_cli-0.1.35.dist-info → emdash_cli-0.1.67.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"""Contextual help system for emdash CLI.
|
|
2
|
+
|
|
3
|
+
Provides detailed help for commands with zen styling.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
|
|
8
|
+
from ...design import (
|
|
9
|
+
Colors,
|
|
10
|
+
STATUS_ACTIVE,
|
|
11
|
+
DOT_BULLET,
|
|
12
|
+
ARROW_PROMPT,
|
|
13
|
+
header,
|
|
14
|
+
footer,
|
|
15
|
+
SEPARATOR_WIDTH,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
console = Console()
|
|
19
|
+
|
|
20
|
+
# Detailed help for each command
|
|
21
|
+
COMMAND_HELP = {
|
|
22
|
+
"/help": {
|
|
23
|
+
"description": "Show available commands and help",
|
|
24
|
+
"usage": ["/help", "/help <command>"],
|
|
25
|
+
"examples": ["/help", "/help agents"],
|
|
26
|
+
},
|
|
27
|
+
"/plan": {
|
|
28
|
+
"description": "Switch to plan mode for exploration and architecture",
|
|
29
|
+
"usage": ["/plan"],
|
|
30
|
+
"details": """Plan mode is read-only. The agent will explore your codebase,
|
|
31
|
+
analyze architecture, and create implementation plans without
|
|
32
|
+
making any changes.""",
|
|
33
|
+
"examples": ["/plan"],
|
|
34
|
+
},
|
|
35
|
+
"/code": {
|
|
36
|
+
"description": "Switch to code mode for implementation",
|
|
37
|
+
"usage": ["/code"],
|
|
38
|
+
"details": """Code mode allows the agent to make changes to your codebase.
|
|
39
|
+
Use this after approving a plan or for direct implementation tasks.""",
|
|
40
|
+
"examples": ["/code"],
|
|
41
|
+
},
|
|
42
|
+
"/agents": {
|
|
43
|
+
"description": "Manage custom agents for specialized tasks",
|
|
44
|
+
"usage": [
|
|
45
|
+
"/agents",
|
|
46
|
+
"/agents create <name>",
|
|
47
|
+
"/agents show <name>",
|
|
48
|
+
"/agents edit <name>",
|
|
49
|
+
"/agents delete <name>",
|
|
50
|
+
],
|
|
51
|
+
"details": """Custom agents extend emdash with specialized capabilities.
|
|
52
|
+
Each agent has its own prompt, tools, and behavior configuration.""",
|
|
53
|
+
"examples": [
|
|
54
|
+
"/agents",
|
|
55
|
+
"/agents create code-reviewer",
|
|
56
|
+
"/agents edit planner",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
"/rules": {
|
|
60
|
+
"description": "Configure rules that guide agent behavior",
|
|
61
|
+
"usage": ["/rules", "/rules create", "/rules list"],
|
|
62
|
+
"details": """Rules define coding standards, preferences, and project
|
|
63
|
+
conventions. The agent follows these guidelines when working
|
|
64
|
+
on your codebase.""",
|
|
65
|
+
"examples": ["/rules", "/rules create"],
|
|
66
|
+
},
|
|
67
|
+
"/skills": {
|
|
68
|
+
"description": "Manage reusable skill templates",
|
|
69
|
+
"usage": ["/skills", "/skills create", "/skills list"],
|
|
70
|
+
"details": """Skills are reusable prompt templates that can be invoked
|
|
71
|
+
for common tasks like code review, testing, or documentation.""",
|
|
72
|
+
"examples": ["/skills", "/skills create"],
|
|
73
|
+
},
|
|
74
|
+
"/session": {
|
|
75
|
+
"description": "Manage conversation sessions",
|
|
76
|
+
"usage": ["/session", "/session save <name>", "/session load <name>"],
|
|
77
|
+
"details": """Sessions preserve conversation context. Save sessions to
|
|
78
|
+
continue work later or switch between different tasks.""",
|
|
79
|
+
"examples": [
|
|
80
|
+
"/session",
|
|
81
|
+
"/session save my-feature",
|
|
82
|
+
"/session load my-feature",
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
"/verify": {
|
|
86
|
+
"description": "Run verification checks on the codebase",
|
|
87
|
+
"usage": ["/verify", "/verify <check>"],
|
|
88
|
+
"details": """Runs configured verifiers (tests, linting, type checking)
|
|
89
|
+
to ensure code quality. Use /verify-loop for automatic fixing.""",
|
|
90
|
+
"examples": ["/verify", "/verify tests"],
|
|
91
|
+
},
|
|
92
|
+
"/verify-loop": {
|
|
93
|
+
"description": "Run verification loop with automatic fixing",
|
|
94
|
+
"usage": ["/verify-loop <task>"],
|
|
95
|
+
"details": """Runs verifiers repeatedly, letting the agent fix issues
|
|
96
|
+
until all checks pass or you stop the loop.""",
|
|
97
|
+
"examples": ["/verify-loop fix the failing tests"],
|
|
98
|
+
},
|
|
99
|
+
"/pr": {
|
|
100
|
+
"description": "Review or create pull requests",
|
|
101
|
+
"usage": ["/pr <url>", "/pr create"],
|
|
102
|
+
"details": """Review GitHub pull requests or create new ones.
|
|
103
|
+
Provides detailed analysis of changes and suggestions.""",
|
|
104
|
+
"examples": [
|
|
105
|
+
"/pr https://github.com/org/repo/pull/123",
|
|
106
|
+
"/pr create",
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
"/research": {
|
|
110
|
+
"description": "Research a topic using web search",
|
|
111
|
+
"usage": ["/research <query>"],
|
|
112
|
+
"details": """Searches the web for information and provides a summary.
|
|
113
|
+
Useful for finding documentation, examples, or solutions.""",
|
|
114
|
+
"examples": ["/research react hooks best practices"],
|
|
115
|
+
},
|
|
116
|
+
"/todos": {
|
|
117
|
+
"description": "View and manage task list",
|
|
118
|
+
"usage": ["/todos", "/todo-add <task>"],
|
|
119
|
+
"details": """Track tasks and progress. The agent can also add todos
|
|
120
|
+
during planning and implementation.""",
|
|
121
|
+
"examples": ["/todos", "/todo-add implement auth"],
|
|
122
|
+
},
|
|
123
|
+
"/context": {
|
|
124
|
+
"description": "View current context information",
|
|
125
|
+
"usage": ["/context"],
|
|
126
|
+
"details": """Shows token usage, context breakdown, and reranked items
|
|
127
|
+
in the current session.""",
|
|
128
|
+
"examples": ["/context"],
|
|
129
|
+
},
|
|
130
|
+
"/compact": {
|
|
131
|
+
"description": "Compact conversation context",
|
|
132
|
+
"usage": ["/compact"],
|
|
133
|
+
"details": """Summarizes the conversation to reduce context size while
|
|
134
|
+
preserving important information. Use when hitting limits.""",
|
|
135
|
+
"examples": ["/compact"],
|
|
136
|
+
},
|
|
137
|
+
"/status": {
|
|
138
|
+
"description": "Show current status and configuration",
|
|
139
|
+
"usage": ["/status"],
|
|
140
|
+
"details": """Displays current mode, model, session info, and
|
|
141
|
+
active configuration.""",
|
|
142
|
+
"examples": ["/status"],
|
|
143
|
+
},
|
|
144
|
+
"/doctor": {
|
|
145
|
+
"description": "Run diagnostic checks",
|
|
146
|
+
"usage": ["/doctor"],
|
|
147
|
+
"details": """Checks environment, dependencies, and configuration
|
|
148
|
+
for potential issues.""",
|
|
149
|
+
"examples": ["/doctor"],
|
|
150
|
+
},
|
|
151
|
+
"/auth": {
|
|
152
|
+
"description": "Manage authentication",
|
|
153
|
+
"usage": ["/auth login", "/auth logout", "/auth status"],
|
|
154
|
+
"details": """Connect or disconnect from GitHub. Authentication enables
|
|
155
|
+
PR reviews, issue management, and repository access.""",
|
|
156
|
+
"examples": ["/auth login", "/auth status"],
|
|
157
|
+
},
|
|
158
|
+
"/setup": {
|
|
159
|
+
"description": "Run interactive setup wizard",
|
|
160
|
+
"usage": ["/setup", "/setup rules", "/setup agents"],
|
|
161
|
+
"details": """AI-assisted setup for configuring rules, agents, skills,
|
|
162
|
+
and verifiers with templates and guidance.""",
|
|
163
|
+
"examples": ["/setup", "/setup rules"],
|
|
164
|
+
},
|
|
165
|
+
"/reset": {
|
|
166
|
+
"description": "Reset current session",
|
|
167
|
+
"usage": ["/reset"],
|
|
168
|
+
"details": """Clears the current session context. Use to start fresh
|
|
169
|
+
without closing the CLI.""",
|
|
170
|
+
"examples": ["/reset"],
|
|
171
|
+
},
|
|
172
|
+
"/quit": {
|
|
173
|
+
"description": "Exit emdash",
|
|
174
|
+
"usage": ["/quit", "/exit", "/q"],
|
|
175
|
+
"examples": ["/quit"],
|
|
176
|
+
},
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def show_command_help(command: str) -> None:
|
|
181
|
+
"""Show detailed help for a specific command."""
|
|
182
|
+
# Normalize command
|
|
183
|
+
if not command.startswith("/"):
|
|
184
|
+
command = "/" + command
|
|
185
|
+
|
|
186
|
+
help_info = COMMAND_HELP.get(command)
|
|
187
|
+
|
|
188
|
+
if not help_info:
|
|
189
|
+
console.print(f" [{Colors.ERROR}]Unknown command: {command}[/{Colors.ERROR}]")
|
|
190
|
+
console.print(f" [{Colors.DIM}]Type /help to see all commands[/{Colors.DIM}]")
|
|
191
|
+
return
|
|
192
|
+
|
|
193
|
+
console.print()
|
|
194
|
+
console.print(f"[{Colors.MUTED}]{header(command, SEPARATOR_WIDTH)}[/{Colors.MUTED}]")
|
|
195
|
+
console.print()
|
|
196
|
+
console.print(f" {help_info['description']}")
|
|
197
|
+
console.print()
|
|
198
|
+
|
|
199
|
+
# Usage
|
|
200
|
+
console.print(f" [{Colors.PRIMARY}]Usage:[/{Colors.PRIMARY}]")
|
|
201
|
+
for usage in help_info.get("usage", []):
|
|
202
|
+
console.print(f" {usage}")
|
|
203
|
+
console.print()
|
|
204
|
+
|
|
205
|
+
# Details
|
|
206
|
+
if "details" in help_info:
|
|
207
|
+
console.print(f" [{Colors.DIM}]{help_info['details']}[/{Colors.DIM}]")
|
|
208
|
+
console.print()
|
|
209
|
+
|
|
210
|
+
# Examples
|
|
211
|
+
if "examples" in help_info:
|
|
212
|
+
console.print(f" [{Colors.PRIMARY}]Examples:[/{Colors.PRIMARY}]")
|
|
213
|
+
for example in help_info["examples"]:
|
|
214
|
+
console.print(f" [{Colors.SUCCESS}]{example}[/{Colors.SUCCESS}]")
|
|
215
|
+
console.print()
|
|
216
|
+
|
|
217
|
+
console.print(f"[{Colors.MUTED}]{footer(SEPARATOR_WIDTH)}[/{Colors.MUTED}]")
|
|
218
|
+
console.print()
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def show_quick_tips() -> None:
|
|
222
|
+
"""Show quick tips for new users."""
|
|
223
|
+
console.print()
|
|
224
|
+
console.print(f"[{Colors.MUTED}]{header('Quick Tips', 35)}[/{Colors.MUTED}]")
|
|
225
|
+
console.print()
|
|
226
|
+
console.print(f" [{Colors.DIM}]Keyboard shortcuts:[/{Colors.DIM}]")
|
|
227
|
+
console.print(f" {DOT_BULLET} Ctrl+C to cancel")
|
|
228
|
+
console.print(f" {DOT_BULLET} Esc during execution to interrupt")
|
|
229
|
+
console.print(f" {DOT_BULLET} Alt+Enter for multiline input")
|
|
230
|
+
console.print()
|
|
231
|
+
console.print(f" [{Colors.DIM}]File references:[/{Colors.DIM}]")
|
|
232
|
+
console.print(f" {DOT_BULLET} Use @filename to include files")
|
|
233
|
+
console.print(f" {DOT_BULLET} Tab completion for @file paths")
|
|
234
|
+
console.print()
|
|
235
|
+
console.print(f"[{Colors.MUTED}]{footer(35)}[/{Colors.MUTED}]")
|
|
236
|
+
console.print()
|