-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (26 loc) · 1.65 KB
/
Makefile
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
# Load environment variables from .env file
ifneq (,$(wildcard .env))
include .env
export
endif
build:
tinygo build -target wasi -o plugin.wasm main.go
test-index:
@if [ -z "$(GREPTILE_API_KEY)" ] || [ -z "$(GITHUB_TOKEN)" ]; then \
echo "Error: GREPTILE_API_KEY and GITHUB_TOKEN must be set in .env file"; \
exit 1; \
fi
extism call plugin.wasm run --input '{"operation": "index", "repository": "openagentsinc/kb-wanix", "remote": "github", "branch": "main", "api_key": "$(GREPTILE_API_KEY)", "github_token": "$(GITHUB_TOKEN)"}' --wasi --allow-host="*.greptile.com"
test-query:
@if [ -z "$(GREPTILE_API_KEY)" ] || [ -z "$(GITHUB_TOKEN)" ]; then \
echo "Error: GREPTILE_API_KEY and GITHUB_TOKEN must be set in .env file"; \
exit 1; \
fi
extism call plugin.wasm run --input '{"operation": "query", "repository": "openagentsinc/kb-wanix", "remote": "github", "branch": "main", "api_key": "$(GREPTILE_API_KEY)", "github_token": "$(GITHUB_TOKEN)", "messages": [{"id": "1", "content": "What is WANIX?", "role": "user"}], "session_id": "test-session", "stream": false, "genius": true}' --wasi --allow-host="*.greptile.com"
test-search:
@if [ -z "$(GREPTILE_API_KEY)" ] || [ -z "$(GITHUB_TOKEN)" ]; then \
echo "Error: GREPTILE_API_KEY and GITHUB_TOKEN must be set in .env file"; \
exit 1; \
fi
extism call plugin.wasm run --input '{"operation": "search", "repository": "openagentsinc/kb-wanix", "remote": "github", "branch": "main", "api_key": "$(GREPTILE_API_KEY)", "github_token": "$(GITHUB_TOKEN)", "query": "What is WANIX?", "session_id": "test-session", "stream": false}' --wasi --allow-host="*.greptile.com"
.PHONY: build test-index test-query test-search