Skip to content

Commit 3dbd237

Browse files
authored
Merge pull request #1206 from Kiln-AI/leonard/kil-508-chore-add-some-commands-in-makefile
chore: add makefile with commands for common scripts
2 parents aa61b47 + 13d7496 commit 3dbd237

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ To run the API server, Studio server, and Studio Web UI with auto-reload for dev
4141

4242
3. Open the app: http://localhost:5173/run
4343

44+
### Makefile
45+
46+
The root `Makefile` provides convenient shortcuts for commonly used scripts (`make dev`, `make ui`, `make package`, ...).
47+
4448
### Running and Building the Desktop App
4549

4650
See the [desktop README](app/desktop/README.md) instructions for running the desktop app locally.

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.PHONY: dev ui schema annotations check package
2+
3+
# Run the development API server (desktop dev server with hot reload on port 8757).
4+
dev:
5+
uv run python -m app.desktop.dev_server
6+
7+
# Run the Vite dev server for the web UI (http://localhost:5173 by default).
8+
ui:
9+
cd app/web_ui && npm run dev --
10+
11+
# Regenerate api_schema.d.ts from the running server's OpenAPI spec (server must be up on :8757).
12+
schema:
13+
cd app/web_ui/src/lib && ./generate_schema.sh
14+
15+
# Dump agent-check annotation JSON files from the running server's OpenAPI (server must be up on :8757).
16+
annotations:
17+
uv run python -m kiln_server.utils.agent_checks.dump_annotations http://localhost:8757/openapi.json libs/server/kiln_server/utils/agent_checks/annotations
18+
19+
# Run formatting, linting, typechecking, tests, and builds via the repo checks script.
20+
check:
21+
uv run ./checks.sh
22+
23+
# Package a project to a zip via kiln_ai package_project. Example: make package ARGS='~/KilnProjects/demo/project.kiln --all-tasks -o ./kiln_export.zip'
24+
package:
25+
@if [ -z "$(strip $(ARGS))" ]; then \
26+
if [ -t 1 ]; then \
27+
e=$$(printf '\033'); \
28+
U="$${e}[1;33m"; H="$${e}[1;36m"; D="$${e}[90m"; N="$${e}[33m"; L="$${e}[34m"; R="$${e}[0m"; \
29+
else \
30+
U=; H=; D=; N=; L=; R=; \
31+
fi; \
32+
printf '%s\n' "$${U}Usage:$${R} make package ARGS='<path/to/project.kiln> [options]'"; \
33+
printf '%s\n' "$${H}Example:$${R}"; \
34+
printf '%s\n' " $${D}make package ARGS='~/Kiln\\ Projects/demo/project.kiln --all-tasks -o /tmp/kiln_export.zip'$${R}"; \
35+
printf '%s\n' " $${D}make package ARGS='~/Kiln\\ Projects/demo/project.kiln --task 314310835537 -o \"/tmp/kiln_export.zip\"'$${R}"; \
36+
printf '%s\n' "$${N}Note:$${R} Remember to escape spaces and apostrophes or quotes in the path."; \
37+
printf '%s\n' "$${L}See also:$${R} uv run kiln_ai package_project --help"; \
38+
fi
39+
uv run kiln_ai package_project $(ARGS)

0 commit comments

Comments
 (0)