Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: setup ingest server agent up down logs

setup:
uv sync
uv run pip install -e .

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
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ Requires [uv](https://docs.astral.sh/uv/).

```sh
uv sync # create .venv + install deps
uv run 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.

Expand Down