From fe2d9514ce1d467fe5020ca160e029a54983ce03 Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 25 Aug 2025 16:40:01 +0200 Subject: [PATCH] feat(ai-coder): open in typora or terminal based on -t flag --- ai-coder.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ai-coder.sh b/ai-coder.sh index b1243b8..8a10dd1 100644 --- a/ai-coder.sh +++ b/ai-coder.sh @@ -37,16 +37,21 @@ if [[ -n "$other_args" ]]; then fi fi - if ! [ "$other_args" = "" ]; then if [ "$other_args" = "sleep" ]; then ollama stop $model elif [ "$other_args" = "init" ]; then ollama create "$model" -f "$modelfile" else - tempfile="$(mktemp)" - ollama run $model "$other_args" --hidethinking > $tempfile - typora $tempfile + # If -t flag is set, use typora to display output + if [ "$typora_flag" = true ]; then + tempfile="$(mktemp)" + ollama run $model "$other_args" --hidethinking > $tempfile + typora $tempfile + else + # If no -t flag, just run the command normally + ollama run $model "$other_args" --hidethinking + fi fi else ollama run $model --hidethinking