-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.toml
More file actions
534 lines (490 loc) · 13.8 KB
/
config.toml
File metadata and controls
534 lines (490 loc) · 13.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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
#:schema https://jj-vcs.github.io/jj/latest/config-schema.json
# ============================================================================
# JJ Configuration - Version 1.1.0-mcp-integration
# Created: 2025-11-07
#
# Additional configurations available in:
# - ~/.config/jj/aliases/ (Command aliases - tier2, tier3, advanced, community)
# - ~/.config/jj/revsets/ (Revset aliases - tier2, tier3, community)
# - ~/.config/jj/git-configs/ (Git settings - tier2, tier3)
# - ~/.config/jj/ui-configs/ (UI settings, Synthwave84 colors - tier2, tier3)
# - ~/.config/jj/template-configs/ (Template aliases - tier2, tier3, community)
# - ~/.config/jj/revsets-config/ (Revsets section settings - tier2, tier3, willhbr)
# - ~/.config/jj/templates/ (Hook templates, workflow templates)
# ============================================================================
# User Information
[user]
name = "Thomo1318"
email = "YOUR_EMAIL@example.com"
# UI Settings
[ui]
editor = "micro"
diff-editor = "jj-fzf"
diff-formatter = ":color-words"
graph.style = "curved"
pager = ":builtin"
log-word-wrap = true
default-command = "log"
color = "always"
# Git Integration
[git]
sign-on-push = true
#
fetch = "glob:*"
private-commits = "description(glob:'wip:*') | description(glob:'private:*')"
auto-track-bookmarks = "glob:*"
# Commit Signing (1Password SSH Agent)
[signing]
behavior = "own"
backend = "ssh"
key = "~/.ssh/id_ed25519.pub"
sign-all = true
# Templates
[templates]
log = "builtin_log_comfortable"
show = "builtin_log_detailed"
op_log = "builtin_op_log_comfortable"
git_push_bookmark = '"Thomo1318/push-" ++ change_id.short()'
draft_commit_description = '''
concat(
description,
"\n",
"# <type>(<scope>): <description>\n",
"# Types: feat, fix, docs, style, refactor, perf, test, chore\n",
)
'''
# Template Aliases
[template-aliases]
'format_short_id(id)' = "id.shortest()"
'format_short_change_id(id)' = "format_short_id(id)"
'format_timestamp(timestamp)' = "timestamp.ago()"
'format_short_signature(signature)' = "signature.email().local()"
'format_short_operation_id(id)' = "id.shortest()"
'format_field(key, value)' = 'key ++ ": " ++ value ++ "\n"'
# Revset Aliases
[revset-aliases]
'mine()' = 'author("YOUR_EMAIL@example.com") | committer("YOUR_EMAIL@example.com")'
'trunk()' = 'latest(remote_bookmarks(exact:"main") | remote_bookmarks(exact:"master") | remote_bookmarks(exact:"trunk"))'
'work' = "ancestors(mutable() & ~empty(), 2) | trunk()"
'recent()' = "ancestors(@, 10)"
'p(n)' = "@-n"
'p(r, n)' = "r-n"
'active(rev)' = "ancestors(rev) | descendants(rev) | rev"
# Revsets Section
[revsets]
log = "@ | ancestors(immutable_heads().., 2) | trunk()"
short-prefixes = "(trunk()..@)::"
# Command Aliases
[aliases]
# GitHub integration aliases (v1.1.1-gh-integration)
# Uses external script for better maintainability and error handling
gh-create = [
"util",
"exec",
"--",
"bash",
"-c",
"~/.config/jj/scripts/gh-helper.sh create",
]
init-github = [
"util",
"exec",
"--",
"bash",
"-c",
"~/.config/jj/scripts/gh-helper.sh init-github",
]
gh-clone = [
"util",
"exec",
"--",
"bash",
"-c",
"~/.config/jj/scripts/gh-helper.sh clone \"$@\"",
"--",
]
# Basic operations
st = ["status"]
d = ["diff"]
ds = ["diff", "--stat"]
s = ["show"]
c = ["commit"]
ci = ["commit", "--interactive"]
# Log viewing
l = ["log"]
ll = ["log", "--limit", "20"]
lll = ["log", "--limit", "50"]
# Editing
e = ["edit"]
amend = ["squash"]
# Rebase
r = ["rebase"]
# Git integration
pull = ["git", "fetch"]
push = ["git", "push", "--allow-new"]
sync = ["git", "fetch", "--all-remotes"]
# New changes
n = ["new"]
co = ["new"]
# TUI launchers
fzf = ["!jj-fzf"]
tui = ["!lazyjj"]
ui = ["!gg"]
# Repository Initialization (v1.1.2 - MCP-enabled + git-confirm)
init = [
"util",
"exec",
"--",
"bash",
"-c",
'''
set -e
echo "Initializing jj repository with GitMCP integration..."
# Initialize jj repo
jj git init --colocate
# Force usage of local hooks (override global ggshield/other configs)
git config core.hooksPath .git/hooks
# Install GitMCP hooks
mkdir -p .git/hooks
# Install post-commit hook
cp ~/.config/jj/templates/mcp-hooks/post-commit .git/hooks/post-commit
chmod +x .git/hooks/post-commit
# Install post-merge hook
cp ~/.config/jj/templates/mcp-hooks/post-merge .git/hooks/post-merge
chmod +x .git/hooks/post-merge
# Install post-checkout hook
cp ~/.config/jj/templates/mcp-hooks/post-checkout .git/hooks/post-checkout
chmod +x .git/hooks/post-checkout
# Install Repomix hooks
cp ~/.config/jj/templates/repomix-hooks/post-commit .git/hooks/post-commit-repomix
chmod +x .git/hooks/post-commit-repomix
# Install security hooks
cp ~/.config/jj/templates/security-hooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
# Install git-confirm pre-commit hook
echo "Installing git-confirm hook..."
if curl -sSfL https://cdn.rawgit.com/pimterry/git-confirm/v0.2.2/hook.sh > .git/hooks/pre-commit-confirm 2>/dev/null; then
chmod +x .git/hooks/pre-commit-confirm
echo "✓ git-confirm hook installed"
else
echo "⚠️ git-confirm hook installation failed (continuing without it)"
fi
# Generate initial MCP context
.git/hooks/post-commit
echo "✓ Repository initialized"
echo "✓ GitMCP hooks installed"
echo "✓ Security hooks installed"
# Show MCP URL if GitHub repo
REMOTE=$(git remote get-url origin 2>/dev/null | sed "s/.*github.com[:/]//" | sed "s/.git$//" || echo "")
if [ -n "$REMOTE" ]; then
echo "✓ GitMCP URL: https://gitmcp.io/$REMOTE"
echo ""
echo "AI Context files created in .mcp/"
echo "See .mcp/README.md for integration instructions"
else
echo "ℹ Local repo - MCP context generated for local use"
fi
# Generate mise.toml if not exists
if [ ! -f mise.toml ]; then
echo "Generating mise.toml..."
cat > mise.toml <<EOF
[tools]
node = "lts"
python = "latest"
# go = "latest"
# rust = "latest"
[tasks]
build = "echo 'No build command defined'"
test = "echo 'No test command defined'"
EOF
echo "✓ mise.toml created"
else
echo "ℹ mise.toml already exists"
fi
''',
]
# Short version (same as init)
i = [
"util",
"exec",
"--",
"bash",
"-c",
'''
set -e
jj git init --colocate
mkdir -p .git/hooks
cp ~/.config/jj/templates/mcp-hooks/post-commit .git/hooks/post-commit
cp ~/.config/jj/templates/mcp-hooks/post-merge .git/hooks/post-merge
cp ~/.config/jj/templates/mcp-hooks/post-checkout .git/hooks/post-checkout
chmod +x .git/hooks/post-*
.git/hooks/post-commit
REMOTE=$(git remote get-url origin 2>/dev/null | sed "s/.*github.com[:/]//" | sed "s/.git$//" || echo "")
[ -n "$REMOTE" ] && echo "GitMCP: https://gitmcp.io/$REMOTE" || echo "Local repo initialized"
if [ ! -f mise.toml ]; then
echo "[tools]\nnode = \"lts\"\npython = \"latest\"" > mise.toml
echo "mise.toml created"
fi
''',
]
# Initialize without MCP (fallback)
init-simple = ["git", "init", "--colocate"]
# Install MCP hooks in existing repo
mcp-update = [
"util",
"exec",
"--",
"bash",
"-c",
'''
set -e
echo "Installing GitMCP hooks in existing repository..."
# Force usage of local hooks
git config core.hooksPath .git/hooks
mkdir -p .git/hooks
cp ~/.config/jj/templates/mcp-hooks/post-commit .git/hooks/post-commit
cp ~/.config/jj/templates/mcp-hooks/post-merge .git/hooks/post-merge
cp ~/.config/jj/templates/mcp-hooks/post-checkout .git/hooks/post-checkout
chmod +x .git/hooks/post-*
# Install Repomix hooks
cp ~/.config/jj/templates/repomix-hooks/post-commit .git/hooks/post-commit-repomix
chmod +x .git/hooks/post-commit-repomix
# Install security hooks
cp ~/.config/jj/templates/security-hooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
# Generate initial context
.git/hooks/post-commit
echo "✓ GitMCP hooks installed"
REMOTE=$(git remote get-url origin 2>/dev/null | sed "s/.*github.com[:/]//" | sed "s/.git$//" || echo "")
[ -n "$REMOTE" ] && echo "✓ GitMCP URL: https://gitmcp.io/$REMOTE"
''',
]
# Show GitMCP URL for current repo
mcp-url = [
"util",
"exec",
"--",
"bash",
"-c",
'''
REMOTE=$(git remote get-url origin 2>/dev/null | sed "s/.*github.com[:/]//" | sed "s/.git$//" || echo "")
if [ -n "$REMOTE" ]; then
echo "GitMCP URL: https://gitmcp.io/$REMOTE"
echo ""
echo "Copy this URL to your AI tool config:"
echo " - Cursor: ~/.cursor/mcp.json"
echo " - Claude: ~/Library/Application Support/Claude/claude_desktop_config.json"
echo " - VS Code: MCP extension settings"
else
echo "Not a GitHub repository"
fi
''',
]
# Open GitMCP URL in browser
mcp-open = [
"util",
"exec",
"--",
"bash",
"-c",
'''
REMOTE=$(git remote get-url origin 2>/dev/null | sed "s/.*github.com[:/]//" | sed "s/.git$//" || echo "")
if [ -n "$REMOTE" ]; then
open "https://gitmcp.io/$REMOTE"
else
echo "Not a GitHub repository"
fi
''',
]
# Repomix Integration (v1.2.0)
# Install/update repomix hooks
repomix-update = [
"util",
"exec",
"--",
"bash",
"-c",
'''
set -e
echo "Installing Repomix hooks..."
mkdir -p .git/hooks
cp ~/.config/jj/templates/repomix-hooks/post-commit .git/hooks/post-commit-repomix
chmod +x .git/hooks/post-commit-repomix
# Generate initial repomix file
if command -v repomix &> /dev/null; then
.git/hooks/post-commit-repomix
echo "✓ Repomix hooks installed and initial file generated"
else
echo "⚠️ repomix not installed. Install with: npm install -g repomix"
fi
''',
]
# Show repomix status
repomix-status = [
"util",
"exec",
"--",
"bash",
"-c",
'''
if [ -f .repomix/context.json ]; then
echo "Repomix Status:"
cat .repomix/context.json | grep -E "(repository|generated_at|latest_file)" || cat .repomix/context.json
echo ""
if [ -f .repomix/repomix-latest.txt ]; then
echo "Latest file:"
ls -lh .repomix/repomix-latest.txt
echo ""
echo "Line count:"
wc -l .repomix/repomix-latest.txt
fi
else
echo "Repomix not initialized. Run: jj repomix-update"
fi
''',
]
# Generate repomix file manually
repomix-generate = ["util", "exec", "--", "bash", "-c", '''
if command -v repomix &> /dev/null; then
.git/hooks/post-commit-repomix
echo "✓ Repomix file generated"
else
echo "⚠️ repomix not installed. Install with: npm install -g repomix"
fi
''']
# View latest repomix file
repomix-view = ["util", "exec", "--", "bash", "-c", '''
if [ -f .repomix/repomix-latest.txt ]; then
${EDITOR:-micro} .repomix/repomix-latest.txt
else
echo "No repomix file found. Run: jj repomix-generate"
fi
''']
# Show token counts
repomix-tokens = ["util", "exec", "--", "bash", "-c", '''
if command -v repomix &> /dev/null; then
repomix --token-count-tree 50 .
else
echo "⚠️ repomix not installed. Install with: npm install -g repomix"
fi
''']
# Security Integration (v1.2.0)
# Install/update security hooks
security-update = ["util", "exec", "--", "bash", "-c", '''
set -e
echo "Installing security hooks..."
mkdir -p .git/hooks
cp ~/.config/jj/templates/security-hooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
echo "✓ Security hooks installed"
echo ""
echo "Pre-push hook will check for:"
echo " - Personal email addresses"
echo " - Sensitive credentials (future)"
echo ""
echo "To sanitize existing files:"
echo " python3 .build-artifacts/sanitize_email.py"
''']
# Check for sensitive information
security-check = [
"util",
"exec",
"--",
"bash",
"-c",
'''
echo "Checking for sensitive information..."
echo ""
FOUND=false
# Check for email
if grep -r "YOUR_EMAIL@example.com" --exclude-dir=.git --exclude-dir=backups --exclude-dir=.build-artifacts . 2>/dev/null; then
echo ""
echo "⚠️ Found sensitive email address"
FOUND=true
fi
if [ "$FOUND" = false ]; then
echo "✓ No sensitive information found"
else
echo ""
echo "Run sanitization: python3 .build-artifacts/sanitize_email.py"
fi
''',
]
# Sanitize email addresses
security-sanitize = ["util", "exec", "--", "bash", "-c", '''
if [ -f .build-artifacts/sanitize_email.py ]; then
python3 .build-artifacts/sanitize_email.py
else
echo "⚠️ Sanitization script not found"
echo " Expected: .build-artifacts/sanitize_email.py"
fi
''']
# Versioning (git-semver)
semver = ["util", "exec", "--", "git-semver", "-match", "v*"]
next-patch = [
"util",
"exec",
"--",
"git-semver",
"-target",
"patch",
"-match",
"v*",
]
next-minor = [
"util",
"exec",
"--",
"git-semver",
"-target",
"minor",
"-match",
"v*",
]
next-major = [
"util",
"exec",
"--",
"git-semver",
"-target",
"major",
"-match",
"v*",
]
# Synthwave84 Color Scheme
[colors]
"commit_id" = { fg = "#24decd", bold = true }
"commit_id prefix" = { fg = "#24decd", bold = true }
"change_id" = { fg = "#f15bb5", bold = true }
"change_id prefix" = { fg = "#f15bb5", bold = true }
"working_copy" = { fg = "#fe28a2", bold = true }
"working_copy commit_id" = { fg = "#fe28a2", underline = true }
"working_copy change_id" = { fg = "#fe28a2", underline = true }
"bookmark" = { fg = "#480ca8" }
"bookmark present" = { fg = "#480ca8", bold = true }
"tag" = { fg = "#f15bb5" }
"git_head" = { fg = "#24decd", bold = true }
"node" = { fg = "#480ca8" }
"node current_operation" = { fg = "#fe28a2", bold = true }
"node immutable" = { fg = "#261838" }
"node working_copy" = { fg = "#fe28a2" }
"diff header" = { fg = "#480ca8", bold = true }
"diff file_header" = { fg = "#f15bb5", bold = true }
"diff hunk_header" = { fg = "#24decd" }
"diff removed" = { fg = "#ff0080" }
"diff added" = { fg = "#24decd" }
"diff removed token" = { fg = "#ff0080", bg = "#261838", underline = false }
"diff added token" = { fg = "#24decd", bg = "#261838", underline = false }
"error" = { fg = "#fe28a2", bold = true }
"warning" = { fg = "#f15bb5", bold = true }
"hint" = { fg = "#24decd" }
"description placeholder" = { fg = "#480ca8", italic = true }
"empty" = { fg = "#261838" }
"conflict" = { fg = "#fe28a2", bold = true }
"email" = { fg = "#24decd" }
"timestamp" = { fg = "#480ca8" }
"rest" = { fg = "#f15bb5" }
[remotes.origin]
auto-track-bookmarks = "glob:*"
[remotes.upstream]
auto-track-bookmarks = "glob:*"