Add user installer and CLI usage instructions

This commit is contained in:
ms2k 2026-10-05 19:19:05 +09:00
commit b552ec49cb
2 changed files with 23 additions and 0 deletions

15
README.md Normal file
View file

@ -0,0 +1,15 @@
# budget
Resource limits for desktop apps and terminal workloads. Requires Linux, cgroup v2, a systemd user session, and Go 1.26+.
Copy `profiles.example.toml` to `~/.config/budget/profiles.toml` and edit limits, app IDs, and terminal prefixes.
| Action | Command |
| ------------------------------ | -------------------------------- |
| Install and apply | `./install.sh` |
| Apply configuration edits | `budget apply` |
| Show configuration | `budget status` |
| Launch with a profile | `budget run compute -- COMMAND` |
| Override a running app or unit | `budget set unrestricted TARGET` |
| Test | `go test -race ./...` |
| Lint | `golangci-lint run` |

8
install.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -eu
cd -- "$(dirname -- "$0")"
CGO_ENABLED=0 go build -trimpath -o bin/budget ./cmd/budget
install -Dm755 bin/budget "$HOME/.local/bin/.budget.new"
mv "$HOME/.local/bin/.budget.new" "$HOME/.local/bin/budget"
test -f "$HOME/.config/budget/profiles.toml" || install -Dm644 profiles.example.toml "$HOME/.config/budget/profiles.toml"
"$HOME/.local/bin/budget" apply