-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
367 lines (329 loc) · 15.8 KB
/
justfile
File metadata and controls
367 lines (329 loc) · 15.8 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# Justfile for Liaison Toolkit
# Modern replacement for Make with better syntax and features
# This is the main entry point that includes all modular justfiles
# Include modular justfiles
mod justfile_core "./justfile.core.just"
mod justfile_packages "./justfile.packages.just"
mod justfile_qa "./justfile.qa.just"
mod justfile_release "./justfile.release.just"
mod justfile_bd "./justfile.bd.just"
# BD (beads) Issue Tracker Commands
# Check for ready work
bd-ready:
#!/usr/bin/env sh
echo "📋 Checking for ready work..."
./scripts/bd-wrapper.sh ready
# Default recipe
default:
@echo "Liaison Toolkit"
@echo ""
@echo "Available recipes:"
@echo " setup - Initialize development environment"
@echo " bd-setup - Setup bd (beads) issue tracker"
@echo " bd-ready - Check for ready work"
@echo " bd-create - Create new bd issue"
@echo " build - Build all packages"
@echo " test - Run all tests"
@echo " lint - Lint all code"
@echo " format - Format all code"
@echo " clean - Clean build artifacts"
@echo " dev - Start development mode"
@echo " deploy - Deploy packages"
@echo ""
@echo "Package-specific recipes:"
@echo " cody-build - Build cody-beads-integration"
@echo " cody-test - Test cody-beads-integration"
@echo " opencode-test - Test opencode-config"
@echo ""
@echo "Task Management (Simple Commands):"
@echo " just list - List all tasks"
@echo " just create - Create a new task"
@echo " just update - Update a task"
@echo " just close - Close a task"
@echo " just next - Get next task"
@echo " just sync - Start synchronization"
@echo " just config - Show configuration"
@echo ""
@echo "Quality Assurance & Testing:"
@echo " just qa - Run QA checks (lint + test + security)"
@echo " just ci - Simulate CI/CD pipeline"
@echo " just pre-push - Run all pre-push validations (⭐ use before git push)"
@echo " just type-check - Run TypeScript type checking"
@echo " just security-scan - Run security scans"
@echo " just health - Health checks (parallel)"
@echo " just health-precise - Health checks (sequential)"
@echo " just health-sync - Sync status check"
@echo " just health-coordinator - Coordinator health"
@echo " just health-deps - Dependency verification"
@echo " just health-config - Configuration validation"
@echo " just smoke-test - Run CLI smoke tests"
@echo ""
@echo "Release Management:"
@echo " just release-patch - Create patch release"
@echo " just release-minor - Create minor release"
@echo " just release-major - Create major release"
@echo ""
@echo "Documentation:"
@echo " just docs - Generate documentation"
@echo " just help - Show this help"
@echo ""
@echo "Quick shortcuts:"
@echo " just b - Build"
@echo " just t - Test"
@echo " just l - Lint"
@echo " just f - Format"
@echo " just d - Dev mode"
@echo " just c - Clean"
# Package-specific recipes
cody-build:
echo "🏗️ Building cody-beads-integration..."
@cd packages/liaison && bun run build
cody-test:
echo "🧪 Testing cody-beads-integration..."
@cd packages/liaison && bun run test
opencode-test:
echo "🧪 Testing opencode-config..."
@cd packages && uv run pytest
# Liaison CLI Commands (Simple, descriptive names)
# Underlying command chain remains 'liaison', but just commands are simplified
# Task Commands
list:
node packages/liaison-coordinator/bin/liaison.js task list
create title description="":
node packages/liaison-coordinator/bin/liaison.js task create --title "{{title}}" --description "{{description}}"
update id status description="":
node packages/liaison-coordinator/bin/liaison.js task update --id "{{id}}" --status "{{status}}" --description "{{description}}"
close id description="":
node packages/liaison-coordinator/bin/liaison.js task update --id "{{id}}" --status "closed" --description "{{description}}"
# Configuration Commands
config-setup:
node packages/liaison-coordinator/bin/liaison.js config setup
config-test:
node packages/liaison-coordinator/bin/liaison.js config test
config-show:
node packages/liaison-coordinator/bin/liaison.js config show
# Sync Commands
sync:
# Check if GitHub is configured, skip if not
@if node -e "const config = require('./cody-beads.config.json'); process.exit(!(config.github && config.github.token && config.github.token !== '\${GITHUB_TOKEN}') ? 0 : 1)"; then \
echo "ℹ️ GitHub integration is not configured. Skipping GitHub sync."; \
echo " Use 'just config-setup' to configure GitHub integration when ready."; \
else \
node packages/liaison-coordinator/bin/liaison.js sync; \
fi
sync-dry-run:
# Check if GitHub is configured, skip if not
@if node -e "const config = require('./cody-beads.config.json'); process.exit(!(config.github && config.github.token && config.github.token !== '\${GITHUB_TOKEN}') ? 0 : 1)"; then \
echo "ℹ️ GitHub integration is not configured. Skipping GitHub sync."; \
echo " Use 'just config-setup' to configure GitHub integration when ready."; \
else \
node packages/liaison-coordinator/bin/liaison.js sync --dry-run; \
fi
# Health Check System
health:
# Run comprehensive health checks with parallel execution
@echo "🏥 Running comprehensive health checks..."
@python3 scripts/health-check.py --format=json | jq '.'
health-precise:
# Run precise health checks sequentially for accuracy
@echo "🔍 Running precise health checks (sequential)..."
@cd packages/liaison && bun run dist/cli.js health --sequential --format=json | jq '.'
health-sync:
# Check sync status and Beads integration
@echo "🔄 Checking sync status..."
@cd packages/liaison && bun run dist/cli.js health --component=sync --format=json | jq '.'
health-coordinator:
# Check liaison coordinator health
@echo "🎛️ Checking coordinator health..."
@node packages/liaison-coordinator/bin/liaison.js health --format=json
health-deps:
# Verify dependencies and build tools
@echo "📦 Verifying dependencies..."
@cd packages/liaison && bun run dist/cli.js health --component=deps --format=json | jq '.'
health-config:
# Validate configuration files
@echo "⚙️ Validating configuration..."
@cd packages/liaison && bun run dist/cli.js health --component=config --format=json | jq '.'
health-verbose:
# Run health checks with detailed output
@echo "🏥 Running detailed health checks..."
@cd packages/liaison && bun run dist/cli.js health --verbose --format=json | jq '.'
smoke-test:
# Run CLI smoke tests
@./scripts/cli_smoke_test.sh
# Aliases for backward compatibility and common usage patterns
next:
# Get the next available task (filter for open/pending tasks)
@uv run python scripts/get-next-task.py
# Quick shortcuts for task management
task-list: list
config: config-show
# Package Management:
# Global Installation Commands for liaison CLI
# Install liaison CLI globally using Bun workspace linking (recommended for development)
install-global:
@echo "🚀 Installing liaison CLI globally using Bun workspace linking..."
@cd packages/liaison && bun link --global
@echo "✅ liaison CLI installed globally"
@echo "💡 Test with: liaison --help"
# Install liaison CLI with bundled dependencies (production use)
install-global-prod:
@echo "📦 Installing liaison CLI with bundled dependencies (production)..."
@echo "ℹ️ This creates a self-contained global installation"
@cd packages/liaison && bun run build
@mkdir -p ~/.bun/install/global/node_modules/@pwarnock
@cp -r packages/core/dist ~/.bun/install/global/node_modules/@pwarnock/toolkit-core/
@cp -r packages/liaison/dist ~/.bun/install/global/node_modules/@pwarnock/liaison/
@echo "✅ Production installation complete"
@echo "💡 Test with: liaison --help"
# Setup development alias (fastest iteration)
install-global-dev:
@echo "⚡ Setting up development alias for liaison CLI..."
@mkdir -p ~/.local/bin
@echo '#!/usr/bin/env bash' > ~/.local/bin/liaison
@echo '# Development alias for liaison CLI' >> ~/.local/bin/liaison
@echo 'node /home/pwarnock/github/liaison-toolkit/packages/liaison/dist/cli.js "$@"' >> ~/.local/bin/liaison
@chmod +x ~/.local/bin/liaison
@echo "✅ Development alias created at ~/.local/bin/liaison"
@echo "💡 Test with: liaison --help"
# Test current global installation
install-global-test:
@echo "🧪 Testing current global liaison CLI installation..."
@if command -v liaison >/dev/null 2>&1; then \
echo "✅ liaison command found in PATH"; \
liaison --version; \
echo "✅ liaison --version works"; \
liaison --help >/dev/null 2>&1 && echo "✅ liaison --help works" || echo "❌ liaison --help failed"; \
else \
echo "❌ liaison command not found in PATH"; \
echo "💡 Try: just install-global or just install-global-dev"; \
exit 1; \
fi
# Clean global installation
install-global-clean:
@echo "🧹 Cleaning global liaison CLI installation..."
@if command -v liaison >/dev/null 2>&1; then \
bun remove --global @pwarnock/liaison 2>/dev/null || true; \
fi
@rm -f ~/.bun/bin/liaison
@rm -rf ~/.bun/install/global/node_modules/@pwarnock/liaison
@rm -rf ~/.bun/install/global/node_modules/@pwarnock/toolkit-core
@rm -f ~/.local/bin/liaison
@echo "✅ Global installation cleaned"
# Fix broken global installation (fixes silent failures)
install-global-fix:
@echo "🔧 Fixing broken liaison CLI global installation..."
@echo "🔄 This will fix silent failures and dependency issues"
# Clean any broken installation
just --unstable install-global-clean
# Create the working wrapper (same as what we implemented manually)
@mkdir -p ~/.local/bin
@echo '#!/usr/bin/env bun' > ~/.local/bin/liaison
@echo '' >> ~/.local/bin/liaison
@echo '// Fixed wrapper for liaison CLI with proper error handling' >> ~/.local/bin/liaison
@echo 'import { $ } from "bun";' >> ~/.local/bin/liaison
@echo 'import chalk from "chalk";' >> ~/.local/bin/liaison
@echo '' >> ~/.local/bin/liaison
@echo '// Enhanced error handling' >> ~/.local/bin/liaison
@echo 'process.on("uncaughtException", (error) => {' >> ~/.local/bin/liaison
@echo ' console.error(chalk.red("❌ Uncaught exception:"), error.message);' >> ~/.local/bin/liaison
@echo ' process.exit(1);' >> ~/.local/bin/liaison
@echo '});' >> ~/.local/bin/liaison
@echo '' >> ~/.local/bin/liaison
@echo 'process.on("unhandledRejection", (reason, promise) => {' >> ~/.local/bin/liaison
@echo ' console.error(chalk.red("❌ Unhandled rejection:"), reason);' >> ~/.local/bin/liaison
@echo ' process.exit(1);' >> ~/.local/bin/liaison
@echo '});' >> ~/.local/bin/liaison
@echo '' >> ~/.local/bin/liaison
@echo '// Execute the CLI directly using Bun' >> ~/.local/bin/liaison
@echo 'try {' >> ~/.local/bin/liaison
@echo ' const cliPath = "/home/pwarnock/github/liaison-toolkit/packages/liaison/dist/cli.js";' >> ~/.local/bin/liaison
@echo ' const args = process.argv.slice(2);' >> ~/.local/bin/liaison
@echo ' ' >> ~/.local/bin/liaison
@echo ' // Execute the CLI with all arguments' >> ~/.local/bin/liaison
@echo ' const result = await $`node ${cliPath} ${args}`;' >> ~/.local/bin/liaison
@echo ' ' >> ~/.local/bin/liaison
@echo ' // The $ operator already prints stdout and stderr' >> ~/.local/bin/liaison
@echo ' // Just exit with the result'"'"'s exit code' >> ~/.local/bin/liaison
@echo ' process.exit(result.exitCode);' >> ~/.local/bin/liaison
@echo ' ' >> ~/.local/bin/liaison
@echo '} catch (error) {' >> ~/.local/bin/liaison
@echo ' console.error(chalk.red("❌ Failed to execute CLI:"), error);' >> ~/.local/bin/liaison
@echo ' process.exit(1);' >> ~/.local/bin/liaison
@echo '}' >> ~/.local/bin/liaison
@chmod +x ~/.local/bin/liaison
# Update global symlink to point to our working wrapper
@rm -f ~/.bun/bin/liaison
@ln -s ~/.local/bin/liaison ~/.bun/bin/liaison
@echo "✅ Fixed liaison CLI wrapper created"
@echo "🧪 Testing the fix..."
@liaison --help >/dev/null 2>&1 && echo "✅ liaison --help works!" || echo "❌ liaison --help still failing"
@echo ""
@echo "🎉 liaison CLI global installation fixed!"
@echo "💡 All commands now work globally with proper error reporting"
@echo "💡 Test with: liaison --help"
# Help system
help:
@echo "Liaison Toolkit - Just Task Runner"
@echo ""
@echo "Core Development:"
@echo " just setup - Initialize development environment"
@echo " just build - Build all packages"
@echo " just test - Run all tests"
@echo " just lint - Lint all code"
@echo " just format - Format all code"
@echo " just clean - Clean build artifacts"
@echo " just dev - Start development mode"
@echo ""
@echo "BD (Beads) Commands:"
@echo " just bd-setup - Setup bd (beads) issue tracker"
@echo " just bd-ready - Check for ready work"
@echo " just bd-create - Create new bd issue"
@echo " just bd-update - Update bd issue"
@echo " just bd-close - Close bd issue"
@echo " just bd-list - List all bd issues"
@echo " just bd-show - Show bd issue details"
@echo ""
@echo "Task Management (Simple Commands):"
@echo " just list - List all tasks"
@echo " just create - Create a new task"
@echo " just update - Update a task"
@echo " just close - Close a task"
@echo " just next - Get next task"
@echo " just sync - Start synchronization"
@echo " just config - Show configuration"
@echo ""
@echo "Package Management:"
@echo " just cody-* - Cody-Beads integration commands"
@echo " just opencode-* - OpenCode config commands"
@echo " just install-global - Install liaison CLI globally using Bun workspace linking (⭐ recommended for development)"
@echo " just install-global-prod - Install liaison CLI with bundled dependencies (production)"
@echo " just install-global-dev - Setup development alias (fastest iteration)"
@echo " just install-global-test - Test current global installation"
@echo " just install-global-clean - Clean global installation"
@echo " just install-global-fix - Fix broken global installation (🔧 fixes silent failures)"
@echo ""
@echo "Quality Assurance & Testing:"
@echo " just qa - Run QA checks (lint + test + security)"
@echo " just ci - Simulate CI/CD pipeline"
@echo " just pre-push - Run all pre-push validations (⭐ use before git push)"
@echo " just type-check - Run TypeScript type checking"
@echo " just security-scan - Run security scans"
@echo " just health - Health checks"
@echo ""
@echo "Release Management:"
@echo " just release-patch - Create patch release"
@echo " just release-minor - Create minor release"
@echo " just release-major - Create major release"
@echo ""
@echo "Documentation:"
@echo " just docs - Generate documentation"
@echo " just help - Show this help"
@echo ""
@echo "Quick shortcuts:"
@echo " just b - Build"
@echo " just t - Test"
@echo " just l - Lint"
@echo " just f - Format"
@echo " just d - Dev mode"
@echo " just c - Clean"