### Run OpenCode plugin tests with Bun Source: https://github.com/4q4r/tokenmill/blob/main/README.md Installs dependencies with frozen lockfile and runs the plugin test suite. ```bash bun install --frozen-lockfile bun test plugin/tokenmill.test.ts ``` -------------------------------- ### Build Tokenmill with go build Source: https://github.com/4q4r/tokenmill/blob/main/README.md Builds the tokenmill binary from the command-line entry point. ```bash go build ./cmd/tokenmill ``` -------------------------------- ### tokenmill.jsonc configuration file Source: https://github.com/4q4r/tokenmill/blob/main/README.md Configuration file for Tokenmill, read from tokenmill.jsonc or .opencode/tokenmill.jsonc. Contains tournament gates (minSavingsPercent, minSavingsTokens), dedup freshness, and technique settings. Defaults are in internal/config/config.go. ```jsonc { "enabled": true, "minSavingsPercent": 10, // tournament gate: minimum savings percent "minSavingsTokens": 32, // tournament gate: minimum saved tokens "freshnessTurns": 20, // dedup reference freshness "techniques": { "ansiStripping": true, "pathDict": { "enabled": true, "maxCodes": 5, "minCount": 3 }, "jton": { "enabled": true, "minRows": 10 }, "crossCallPack": false // session-wide dictionary (opt-in) } } ``` -------------------------------- ### Compress payload with tokenmill rewrite Source: https://github.com/4q4r/tokenmill/blob/main/README.md Runs the tournament compression on raw output from a command. The --raw flag takes the output of some-tool-output. ```bash tokenmill rewrite --raw "$(some-tool-output)" ``` -------------------------------- ### Run Go test suite with race detector Source: https://github.com/4q4r/tokenmill/blob/main/README.md Runs formatting, tests, build, vet, and lint checks for the Go codebase. The corpus package is limited to Linux amd64/arm64 by build constraint. ```bash test -z "$(gofmt -l internal cmd scripts)" go test -race ./... go build ./... go vet ./... golangci-lint run ./... ``` -------------------------------- ### Show cumulative savings with tokenmill gain Source: https://github.com/4q4r/tokenmill/blob/main/README.md Displays summary and daily/weekly/monthly history, or per-command records with --history. ```bash tokenmill gain # summary + daily/weekly/monthly history tokenmill gain --history # per-command records ``` -------------------------------- ### Import session store into redacted corpus Source: https://github.com/4q4r/tokenmill/blob/main/README.md Go code that discovers artifacts from an OpenCode session store and writes them to a corpus.jsonl file. Uses corpus.NewOpenCodeSource() and corpus.NewWriter(). The writer.Close() performs an atomic publish. ```go source := corpus.NewOpenCodeSource() // resolves via `opencode db path` artifacts, _ := source.Discover(ctx, corpus.Options{OutputPath: "corpus.jsonl"}) writer, _ := corpus.NewWriter(corpus.Options{OutputPath: "corpus.jsonl"}) for _, a := range artifacts { _ = source.Read(ctx, a, writer) } _ = writer.Close() // atomic publish or nothing ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.