Change personality to opencode agent and add interactive mode

This commit is contained in:
2026-03-03 19:46:41 -05:00
parent 3b0b1b2d20
commit e3ee142f2a
4 changed files with 52 additions and 51 deletions

View File

@ -1,17 +1,16 @@
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PERSONALITY_FILE="$SCRIPT_DIR/personality.md"
if [ ! -f "$PERSONALITY_FILE" ]; then
echo "Error: personality.md not found" >&2
exit 1
fi
PERSONALITY_CONTENT=$(cat "$PERSONALITY_FILE")
if [ $# -eq 0 ]; then
exec opencode run "Personality: $PERSONALITY_CONTENT"
# Check for non-interactive mode flag
if [ "$1" = "--non-interactive" ]; then
shift
opencode run --agent ernie "$*"
else
exec opencode run "Personality: $PERSONALITY_CONTENT. User request: $*"
# Interactive mode
if [ $# -eq 0 ]; then
opencode --agent ernie
else
opencode --agent ernie --prompt "$*"
fi
fi
echo "Process completed."