From b040c1fec170b2f1a0de424b97a54ff94a44736b Mon Sep 17 00:00:00 2001 From: Leohearts Date: Mon, 23 Mar 2026 03:30:09 +0800 Subject: [PATCH] Fix output formatting in llm_cmd.py --- llm_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llm_cmd.py b/llm_cmd.py index 33b9d33..a3f4932 100644 --- a/llm_cmd.py +++ b/llm_cmd.py @@ -30,6 +30,7 @@ def cmd(args, model, system, key): if model_obj.needs_key: model_obj.key = llm.get_key(key, model_obj.needs_key, model_obj.key_env_var) result = model_obj.prompt(prompt, system=system or SYSTEM_PROMPT) + result = '\n'.join([i for i in str(result).splitlines() if not i.startswith('```')]) interactive_exec(str(result)) def interactive_exec(command): @@ -46,4 +47,4 @@ def interactive_exec(command): ) print(output.decode()) except subprocess.CalledProcessError as e: - print(f"Command failed with error (exit status {e.returncode}): {e.output.decode()}") \ No newline at end of file + print(f"Command failed with error (exit status {e.returncode}): {e.output.decode()}")