-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
136 lines (118 loc) · 3.13 KB
/
Copy pathTaskfile.yaml
File metadata and controls
136 lines (118 loc) · 3.13 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
version: "3"
vars:
BINARY: captain
BIN_DIR: .bin
tasks:
default:
cmds:
- task --list
build:
desc: Build the captain binary
vars:
VERSION:
sh: git describe --tags --always
COMMIT:
sh: git rev-parse --short HEAD
DATE:
sh: date -u '+%Y-%m-%dT%H:%M:%SZ'
DIRTY:
sh: |
if test -n "$(git status --porcelain)"
then
echo true
else
echo false
fi
LDFLAGS: -s -w -X main.version={{.VERSION}} -X main.commit={{.COMMIT}} -X main.date={{.DATE}} -X main.dirty={{.DIRTY}}
cmds:
- mkdir -p {{.BIN_DIR}}
- go build -ldflags "{{.LDFLAGS}}" -o {{.BIN_DIR}}/{{.BINARY}} ./cmd/captain
www:build:
desc: Build the embedded Captain web UI
dir: pkg/cli/webapp
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run build
- touch dist/.gitkeep
www:dev:
desc: Start Captain with the Vite dev proxy and open the browser
dir: pkg/cli/webapp
cmds:
- CI=true pnpm install --frozen-lockfile
- cd ../../.. && go run ./cmd/captain serve --dev --open
docs:build:
desc: Build the Captain Astro documentation site
dir: docs
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run build
docs:dev:
desc: Start the Captain Astro documentation site
dir: docs
cmds:
- CI=true pnpm install --frozen-lockfile
- pnpm run dev
lint:
desc: Run linters
cmds:
- golangci-lint run ./...
test:
desc: Run tests
cmds:
- go test ./...
test:verbose:
desc: Run tests with verbose output
cmds:
- go test -v ./...
test:e2e:mcp:
desc: Run the black-box MCP-to-CLI end-to-end test
cmds:
- go test -tags=e2e -count=1 -v -timeout=8m ./tests/e2e/mcp2cli
test:fixtures:
desc: Run gavel fixture tests
deps: [build]
cmds:
- PATH="$PWD/.bin:$PATH" gavel fixtures pkg/cli/testdata/history_test.md
install:
desc: Build and install captain to the default Go bin
vars:
VERSION:
sh: git describe --tags --always
COMMIT:
sh: git rev-parse --short HEAD
DATE:
sh: date -u '+%Y-%m-%dT%H:%M:%SZ'
DIRTY:
sh: |
if test -n "$(git status --porcelain)"
then
echo true
else
echo false
fi
LDFLAGS: -s -w -X main.version={{.VERSION}} -X main.commit={{.COMMIT}} -X main.date={{.DATE}} -X main.dirty={{.DIRTY}}
cmds:
- go install -ldflags "{{.LDFLAGS}}" ./cmd/captain
fmt:
desc: Format Go code
cmds:
- gofmt -w .
tidy:
desc: Tidy go modules
cmds:
- go mod tidy
models:update:
desc: Regenerate the embedded LLM model registry from models.dev + local patches
cmds:
- go run ./pkg/ai/internal/gen-model-registry --patches pkg/ai/internal/gen-model-registry/patches.json --output pkg/api/registry/models.json
clean:
desc: Remove build artifacts
cmds:
- rm -rf {{.BIN_DIR}}
all:
desc: Run fmt, lint, test, and build
cmds:
- task: fmt
- task: lint
- task: test
- task: build