From 6ebb614d90412d87caf37fd0f99ff41992e45c50 Mon Sep 17 00:00:00 2001 From: Hannes Hapke Date: Thu, 14 May 2026 10:09:53 -0700 Subject: [PATCH 1/2] Added makefile for quick use --- Makefile | 19 +++++++++++++++++++ README.md | 14 +++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2569ed5 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +.PHONY: ingest server agent up down logs + +ingest: + .venv/bin/python -m tracker.ingest -v + +agent: + ./scripts/install-launchagent.sh + +server: + ./scripts/run-server.sh + +# Ensure the periodic-ingest launchd agent is loaded, then serve the UI. +up: agent server + +down: + ./scripts/uninstall-launchagent.sh + +logs: + tail -f ~/Library/Logs/token-tracker.log diff --git a/README.md b/README.md index 66ddae9..077470c 100644 --- a/README.md +++ b/README.md @@ -24,18 +24,22 @@ input from cached input so the two tools line up on the same axes. ```sh python3 -m venv .venv .venv/bin/pip install -e . -.venv/bin/python -m tracker.ingest -v # first run -./scripts/run-server.sh # http://127.0.0.1:8732 +make ingest # first run +make server # http://127.0.0.1:8732 ``` ## Periodic ingest (macOS launchd) ```sh -./scripts/install-launchagent.sh # ingests every 5 minutes -tail -f ~/Library/Logs/token-tracker.log -./scripts/uninstall-launchagent.sh +make agent # ingests every 5 minutes +make logs # tail ~/Library/Logs/token-tracker.log +make down # uninstall the agent ``` +`make up` loads the launchd agent and then starts the server in one step. +The raw scripts (`scripts/run-server.sh`, `scripts/install-launchagent.sh`, +`scripts/uninstall-launchagent.sh`) still work if you'd rather skip make. + The web UI also has a **re-ingest** button that triggers `POST /api/reingest` if you don't want to wait. From fb71613fee85b64c05d09c276230aecc9f01563d Mon Sep 17 00:00:00 2001 From: Hannes Hapke Date: Thu, 14 May 2026 16:34:04 -0700 Subject: [PATCH 2/2] added Setup --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2569ed5..83d89d9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ -.PHONY: ingest server agent up down logs +.PHONY: setup ingest server agent up down logs + +setup: + uv sync + uv run pip install -e . ingest: .venv/bin/python -m tracker.ingest -v