feat(ai-coder): open in typora or terminal based on -t flag
This commit is contained in:
parent
e7e16ac3e4
commit
fe2d9514ce
1 changed files with 9 additions and 4 deletions
13
ai-coder.sh
13
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
|
||||
|
|
Loading…
Reference in a new issue