-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent
More file actions
executable file
·47 lines (37 loc) · 980 Bytes
/
Copy pathagent
File metadata and controls
executable file
·47 lines (37 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Simple agent command - just run with any prompt
# Usage: agent "your prompt here"
set -e
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if we got a prompt
if [ $# -eq 0 ]; then
echo "🤖 Percepta"
echo ""
echo "Usage:"
echo " agent \"your prompt here\""
echo ""
echo "Examples:"
echo " agent \"open calculator\""
echo " agent \"take a screenshot\""
echo " agent \"create a new file called hello.txt\""
echo ""
exit 1
fi
# Combine all arguments into one prompt
PROMPT="$*"
echo "🚀 Running agent with prompt: \"$PROMPT\""
echo ""
# Navigate to project directory and run
cd "$PROJECT_DIR"
# Check if dependencies are installed
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies first..."
npm install
fi
# Check if built
if [ ! -f "dist/cli.js" ]; then
echo "🔨 Building project first..."
npm run build
fi
# Run the agent
npx tsx src/cli.ts "$PROMPT"