Skip to content

Commit b8a5124

Browse files
authored
Merge pull request #1341 from Kiln-AI/sfierro/wk-tui
wk tui config changes
2 parents 9a4d41d + bedbf66 commit b8a5124

6 files changed

Lines changed: 55 additions & 0 deletions

File tree

.agents/claude/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ cd "$REPO_ROOT"
1010
# Copy AGENTS.md to CLAUDE.md
1111
cp AGENTS.md CLAUDE.md
1212

13+
# Copy .worktreeinclude to repo root (worktrunk/Claude Code desktop require it there)
14+
rm -f .worktreeinclude
15+
cp .config/wt/.worktreeinclude .worktreeinclude
16+
1317
# Copy skills from the canonical .agents/skills/ location
1418
if [ -d ".agents/skills" ]; then
1519
mkdir -p .claude

.agents/cursor/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
88
cd "$REPO_ROOT"
99

10+
# Copy .worktreeinclude to repo root (worktrunk/Claude Code desktop require it there)
11+
rm -f .worktreeinclude
12+
cp .config/wt/.worktreeinclude .worktreeinclude
13+
1014
# Copy skills from the canonical .agents/skills/ location
1115
if [ -d ".agents/skills" ]; then
1216
mkdir -p .cursor

.config/wk.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
open_workspace_cmd: "./.config/wt/start.sh"
22
restart_workspace_cmd: "./.config/wt/start.sh --restart"
3+
4+
workspace_env_script: ".config/wt/env.sh"
5+
6+
workspace_windows:
7+
term: "echo \"\nWeb UI: $KILN_WEB_URL\nBackend: http://localhost:$KILN_PORT\n\nType 'web' to open in browser.\n\"; exec $SHELL"
8+
agent:
9+
command: "$KILN_CODER_CMD"
10+
backend:
11+
command: "uv run python -m app.desktop.dev_server"
12+
webui:
13+
command: "npm run dev -- --host --port $KILN_FRONTEND_PORT"
14+
cwd: "app/web_ui"

.config/wt/env.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Sourceable env setup for wk workspace windows.
3+
# Sets ports, env vars, and PATH for the current worktree.
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || (cd "$SCRIPT_DIR/../.." && pwd))"
7+
8+
BRANCH="$(git -C "$REPO_ROOT" branch --show-current 2>/dev/null)"
9+
[ -n "$BRANCH" ] || BRANCH="main"
10+
11+
hash_port() {
12+
printf '%s' "$1" | cksum | awk '{print ($1 % 10000) + 10000}'
13+
}
14+
15+
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
16+
export KILN_PORT=8757
17+
export KILN_FRONTEND_PORT=5173
18+
else
19+
PORT=$(hash_port "$BRANCH")
20+
export KILN_PORT="$PORT"
21+
export KILN_FRONTEND_PORT="$((PORT + 1))"
22+
fi
23+
export VITE_API_PORT="$KILN_PORT"
24+
export VITE_BRANCH_NAME="$BRANCH"
25+
export KILN_WEB_URL="http://localhost:$KILN_FRONTEND_PORT"
26+
export KILN_CODER_CMD="claude"
27+
28+
if [ -f "$REPO_ROOT/.config/wt/user_settings.sh" ]; then
29+
# shellcheck source=/dev/null
30+
source "$REPO_ROOT/.config/wt/user_settings.sh"
31+
fi
32+
33+
export WK_BIN_DIR="$REPO_ROOT/.config/wt/bin"
34+
[[ ":$PATH:" != *":$WK_BIN_DIR:"* ]] && export PATH="$WK_BIN_DIR:$PATH"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ test_output/
2525

2626
.specs_skill_state/
2727
.config/wt/user_settings.sh
28+
/.worktreeinclude
2829
.worktrees/
2930
reviews/
3031

0 commit comments

Comments
 (0)