Change personality to opencode agent and add interactive mode
This commit is contained in:
@ -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."
|
||||
|
||||
Reference in New Issue
Block a user