forked from simple10/agents-observe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
110 lines (84 loc) · 3.27 KB
/
Copy pathjustfile
File metadata and controls
110 lines (84 loc) · 3.27 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Agents Observe
# Usage: just <recipe>
#
# AGENTS_OBSERVE_SERVER_PORT & AGENTS_OBSERVE_DEV_CLIENT_PORT are read from .env
# Allows for overriding the default ports
# Server port is used for both local dev & docker starts
# Client port is only for local dev
set dotenv-load := true
set export := true
set quiet := true
port := env("AGENTS_OBSERVE_SERVER_PORT", "4981")
dev_client_port := env("AGENTS_OBSERVE_DEV_CLIENT_PORT", "5174")
project_root := justfile_directory()
server := project_root / "app" / "server"
client := project_root / "app" / "client"
cli_script := project_root / "hooks" / "scripts" / "observe_cli.mjs"
# List available recipes
default:
@just --list
# ─── Docker ─────────────────────────────────────────────
# Build the Docker image locally
build:
docker build -t agents-observe:local .
# Start server (same path as plugin MCP)
start:
node {{ cli_script }} start
@just open
# Start the server locally without docker
start-local:
npm run start
# Stop server
stop:
node {{ cli_script }} stop
# Restart server
restart:
node {{ cli_script }} restart
# View container logs (follow)
logs:
node {{ cli_script }} logs -f
# ─── Development ─────────────────────────────────────────
# Start local server + client in dev mode (hot reload)
dev:
AGENTS_OBSERVE_RUNTIME=dev AGENTS_OBSERVE_SHUTDOWN_DELAY_MS=${AGENTS_OBSERVE_SHUTDOWN_DELAY_MS:-0} node {{ project_root }}/start.mjs
# ─── Testing ────────────────────────────────────────────
# Run all tests (server + client)
test:
npm test
# Send a test event to the server
test-event:
@echo '{"session_id":"test-1234","hook_event_name":"SessionStart","cwd":"/tmp","source":"new"}' \
| AGENTS_OBSERVE_PROJECT_NAME=test-project node {{ project_root }}/hooks/scripts/observe_cli.mjs hook
@echo "Event sent"
# ─── Database ────────────────────────────────────────────
# Delete the events database (stops server, deletes, restarts)
db-reset:
node {{ cli_script }} db-reset
# ─── Utilities ───────────────────────────────────────────
# Check server health
health:
node {{ cli_script }} health
# Run the CLI with a command (hook, health, start, stop, restart)
cli *args:
node {{ cli_script }} {{ args }}
# Open the dashboard in browser
open port=port:
open http://localhost:{{ port }}
# Run all tests + format (run before every commit)
check:
npm test
npm run fmt
cd app/client && npm install && npm run build
# Show client bundle size visualizer in browser
bundle-visualizer:
cd app/client && npx vite-bundle-visualizer
# Format all source files
fmt:
npm run fmt
# Tag and push a release (bumps versions, tests, builds, tags, pushes)
release version:
{{ project_root }}/scripts/release.sh {{ version }}
# Install all dependencies
install:
cd {{ server }} && npm install
cd {{ client }} && npm install