Skip to content

Commit e2cbe11

Browse files
committed
feat: add Taskfile targets for update-tools command
- Add build:update-tools target to build the tool - Add update-tools target for updating single spec files - Add update-tools:dry-run for previewing changes - Add update-tools:all for batch updating all specs - Add update-tools:all:dry-run for batch preview Usage examples: - task update-tools SPEC=registry/fetch/spec.yaml - task update-tools:dry-run SPEC=registry/github/spec.yaml - task update-tools:all:dry-run
1 parent a7f3381 commit e2cbe11

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

Taskfile.yml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tasks:
2626

2727
build:
2828
desc: Build all binaries
29-
deps: [build:registry-builder, build:import-tool]
29+
deps: [build:registry-builder, build:import-tool, build:update-tools]
3030

3131
build:registry-builder:
3232
desc: Build the registry-builder tool
@@ -56,6 +56,20 @@ tasks:
5656
generates:
5757
- "{{.BUILD_DIR}}/import-from-toolhive"
5858

59+
build:update-tools:
60+
desc: Build the update-tools tool
61+
cmds:
62+
- echo "🔨 Building update-tools..."
63+
- mkdir -p {{.BUILD_DIR}}
64+
- go build {{.LDFLAGS}} -o {{.BUILD_DIR}}/update-tools ./cmd/update-tools
65+
sources:
66+
- cmd/update-tools/**/*.go
67+
- pkg/**/*.go
68+
- go.mod
69+
- go.sum
70+
generates:
71+
- "{{.BUILD_DIR}}/update-tools"
72+
5973
import:
6074
desc: Import the existing ToolHive registry
6175
deps: [build:import-tool]
@@ -70,6 +84,52 @@ tasks:
7084
- echo "👀 Preview import (dry run)..."
7185
- ./{{.BUILD_DIR}}/import-from-toolhive --dry-run
7286

87+
update-tools:
88+
desc: Update tool lists for a specific MCP server spec file
89+
deps: [build:update-tools]
90+
cmds:
91+
- echo "🔧 Updating tools for {{.SPEC}}..."
92+
- ./{{.BUILD_DIR}}/update-tools {{.SPEC}} {{.CLI_ARGS}}
93+
vars:
94+
SPEC: '{{.SPEC | default ""}}'
95+
preconditions:
96+
- sh: test -n "{{.SPEC}}"
97+
msg: "Please specify a spec file with SPEC=path/to/spec.yaml"
98+
99+
update-tools:dry-run:
100+
desc: Preview tool list updates for a specific MCP server spec file
101+
deps: [build:update-tools]
102+
cmds:
103+
- echo "👀 Preview tool updates for {{.SPEC}}..."
104+
- ./{{.BUILD_DIR}}/update-tools {{.SPEC}} --dry-run -v
105+
vars:
106+
SPEC: '{{.SPEC | default ""}}'
107+
preconditions:
108+
- sh: test -n "{{.SPEC}}"
109+
msg: "Please specify a spec file with SPEC=path/to/spec.yaml"
110+
111+
update-tools:all:
112+
desc: Update tool lists for all MCP server spec files
113+
deps: [build:update-tools]
114+
cmds:
115+
- echo "🔧 Updating tools for all spec files..."
116+
- |
117+
find {{.REGISTRY_DIR}} -name "spec.yaml" -o -name "spec.yml" | while read spec; do
118+
echo "Processing $spec..."
119+
./{{.BUILD_DIR}}/update-tools "$spec" -v || echo "Failed to update $spec"
120+
done
121+
122+
update-tools:all:dry-run:
123+
desc: Preview tool list updates for all MCP server spec files
124+
deps: [build:update-tools]
125+
cmds:
126+
- echo "👀 Preview tool updates for all spec files..."
127+
- |
128+
find {{.REGISTRY_DIR}} -name "spec.yaml" -o -name "spec.yml" | while read spec; do
129+
echo "Processing $spec..."
130+
./{{.BUILD_DIR}}/update-tools "$spec" --dry-run -v || echo "Failed to process $spec"
131+
done
132+
73133
validate:
74134
desc: Validate all registry entries
75135
deps: [build:registry-builder]

0 commit comments

Comments
 (0)