Skip to content

The agent that turns websites into APIs!

fix: @docs tag should not accept prompt parameter when standalone

kalil03216e874f095e0d
diff --git a/src/reverse_api/cli.py b/src/reverse_api/cli.py
index 6ec56c3..0f22903 100644
--- a/src/reverse_api/cli.py
+++ b/src/reverse_api/cli.py
@@ -373,8 +373,8 @@ def repl_loop():
# Handle empty input
if not raw_input:
console.print(" [dim]Usage:[/dim] @id <run_id> [instructions]")
- console.print(" [dim] [/dim] @docs <prompt> (latest run)")
- console.print(" [dim] [/dim] @id <run_id> @docs")
+ console.print(" [dim] [/dim] @docs (generate docs for latest run)")
+ console.print(" [dim] [/dim] @id <run_id> @docs [prompt]")
console.print(" [dim] [/dim] <run_id> (to switch context)")
continue
diff --git a/src/reverse_api/utils.py b/src/reverse_api/utils.py
index a3520e2..6087ea5 100644
--- a/src/reverse_api/utils.py
+++ b/src/reverse_api/utils.py
@@ -236,17 +236,15 @@ def parse_engineer_prompt(input_text: str) -> dict:
"is_tag_command": False,
}
- # Check for standalone @docs first
- if input_text.strip().startswith("@docs"):
- docs_match = re.match(r"@docs(?:\s+(.*))?", input_text.strip())
- if docs_match:
- return {
- "run_id": None, # Will use latest run
- "fresh": False,
- "docs": True,
- "prompt": docs_match.group(1) or "",
- "is_tag_command": True,
- }
+ # Check for standalone @docs first (no prompt parameter)
+ if input_text.strip() == "@docs":
+ return {
+ "run_id": None, # Will use latest run
+ "fresh": False,
+ "docs": True,
+ "prompt": "",
+ "is_tag_command": True,
+ }
# Enhanced regex for @id <run_id> [--fresh] [@docs] <prompt>
# Group 1: run_id