feat: dedup and format the output

This commit is contained in:
ytshih committed 2026-09-05 22:35:23 +08:00
1 parent eadc7e806b
commit 521588f992
8 files changed
+153 -54

No files matched your search

+5 -5
View File
@@ -7,7 +7,7 @@ See [PLAN.md](PLAN.md) for the full design, cost analysis, and rationale.
## Build
```sh
go build -o stonks ./cmd/stonks
make build
```
## Configure
@@ -37,15 +37,15 @@ codex login
A failing or unauthenticated advisor is logged as a warning and simply excluded — it never fails the run. Remove an entry (or the whole `advisors:` list) to disable multi-agent mode.
### Archiving runs (optional)
### Archiving runs
Set `archive.enabled: true` in `config.yaml` to save each run's fetched data, full prompt (including any advisor section), raw and parsed analysis to `archive.dir` (default `~/.local/state/stonks/runs`), one timestamped subdirectory per run: `fetched.json`, `prompt.txt`, `analysis_raw.md`, `report.md`, `recommendations.json`. Useful for debugging prompt or parsing issues without reproducing a live run. Off by default — these accumulate over time with no automatic cleanup.
Every run saves its fetched data, full prompt (including any advisor section), raw and parsed analysis to `archive.dir` (default `~/.local/state/stonks/runs`), one timestamped subdirectory per run: `fetched.json`, `prompt.txt`, `analysis_raw.md`, `report.md`, `recommendations.json`. This is always on — besides being useful for debugging prompt or parsing issues, the next run reads back `report.md` from the most recent subdirectory so it can avoid repeating unchanged commentary from ~5 hours ago. These accumulate over time with no automatic cleanup.
## Install as a user-scope systemd service
```sh
mkdir -p ~/.local/bin ~/.config/systemd/user
go build -o ~/.local/bin/stonks ./cmd/stonks
mkdir -p ~/.config/systemd/user
make install # builds and installs to ~/.local/bin/stonks
cp systemd/stonks.service systemd/stonks.timer ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now stonks.timer