@buzzr/dfs-cli
Advanced tools
+19
-4
| { | ||
| "name": "@buzzr/dfs-cli", | ||
| "version": "1.0.0", | ||
| "version": "5.0.0", | ||
| "description": "Command-line wrapper around @buzzr/dfs-engine — grade a DFS entry from JSON fixtures without writing code.", | ||
| "license": "MIT", | ||
| "author": "Sarvesh Chidambaram", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Buzzr-app/dfs-engine.git", | ||
| "directory": "packages/dfs-cli" | ||
| }, | ||
| "homepage": "https://github.com/Buzzr-app/dfs-engine/tree/main/packages/dfs-cli#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/Buzzr-app/dfs-engine/issues" | ||
| }, | ||
| "type": "module", | ||
@@ -35,11 +44,17 @@ "main": "./dist/index.js", | ||
| "dfs", | ||
| "buzzr", | ||
| "daily-fantasy-sports", | ||
| "cli", | ||
| "command-line", | ||
| "settlement", | ||
| "grading", | ||
| "prizepicks", | ||
| "underdog" | ||
| "underdog", | ||
| "pick-em", | ||
| "player-props", | ||
| "sports-betting", | ||
| "typescript", | ||
| "buzzr" | ||
| ], | ||
| "dependencies": { | ||
| "@buzzr/dfs-engine": "^4.0.0" | ||
| "@buzzr/dfs-engine": "^5.0.0" | ||
| }, | ||
@@ -46,0 +61,0 @@ "engines": { |
+105
-10
| # @buzzr/dfs-cli | ||
| Command-line wrapper around [`@buzzr/dfs-engine`](https://www.npmjs.com/package/@buzzr/dfs-engine). | ||
| Grade a DFS entry from JSON fixtures without writing any TypeScript. | ||
| [](https://www.npmjs.com/package/@buzzr/dfs-cli) | ||
| [](https://www.npmjs.com/package/@buzzr/dfs-cli) | ||
| [](https://github.com/Buzzr-app/dfs-engine/actions/workflows/ci.yml) | ||
| [](https://www.npmjs.com/package/@buzzr/dfs-cli) | ||
| [](https://github.com/Buzzr-app/dfs-engine/blob/main/LICENSE) | ||
| ## Install | ||
| **Grade a DFS pick'em entry from two JSON files — no code required.** A command-line wrapper around [`@buzzr/dfs-engine`](https://www.npmjs.com/package/@buzzr/dfs-engine), the settlement engine that grades PrizePicks/Underdog-style entries with book-accurate payout math and a full audit trail. | ||
| ## 30-second quick start | ||
| ```bash | ||
@@ -12,25 +17,115 @@ npm install -g @buzzr/dfs-cli | ||
| ## Usage | ||
| Create `entry.json` (the slip you want to grade): | ||
| ```json | ||
| { | ||
| "entryId": "entry-001", | ||
| "bookId": "prizepicks", | ||
| "playTypeId": "power", | ||
| "stake": 10, | ||
| "displayedMultiplier": 3, | ||
| "legs": [ | ||
| { | ||
| "legId": "leg-1", | ||
| "playerName": "Jayson Tatum", | ||
| "playerId": "athlete-a", | ||
| "league": "NBA", | ||
| "propType": "Points", | ||
| "line": 26.5, | ||
| "direction": "over", | ||
| "actual": null, | ||
| "status": "pending", | ||
| "gameDate": "2026-05-07T00:00:00.000Z" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| And `gamelogs.json` (what the players actually did, keyed by `legId`): | ||
| ```json | ||
| { | ||
| "leg-1": [ | ||
| { | ||
| "date": "2026-05-07T00:00:00.000Z", | ||
| "minutes": "38:00", | ||
| "points": "31", | ||
| "rebounds": "8", | ||
| "assists": "5", | ||
| "steals": "1", | ||
| "blocks": "0", | ||
| "turnovers": "2", | ||
| "threeP": "4" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
| Then grade it: | ||
| ```bash | ||
| dfs-grade ./entry.json --gamelogs ./gamelogs.json | ||
| dfs-grade entry.json --gamelogs gamelogs.json | ||
| ``` | ||
| `entry.json` is a `DfsEntryInput`. `gamelogs.json` is a map of `legId` to an | ||
| array of `PlayerGameLogEntryShape` rows. The settlement result is printed to | ||
| stdout as pretty JSON; non-zero exit code on any error. | ||
| The full `DfsSettlementResult` prints to stdout as JSON — status, payout split, per-leg decisions with provider provenance, a validation report, and an audit trail: | ||
| ```json | ||
| { | ||
| "entryId": "entry-001", | ||
| "bookId": "prizepicks", | ||
| "status": "won", | ||
| "effectiveMultiplier": 3, | ||
| "payout": { "total": 30, "withdrawable": 30, "bonus": 0 }, | ||
| "legs": [{ "legId": "leg-1", "status": "won", "actual": 31, "...": "..." }], | ||
| "auditTrail": [{ "code": "settlement.won", "...": "..." }] | ||
| } | ||
| ``` | ||
| Exit code is `0` on success and `1` on any error (bad JSON, invalid entry, unknown book policy), so it drops straight into shell scripts and CI pipelines. | ||
| ## Programmatic API | ||
| The same grading path is exported as plain async functions: | ||
| ```ts | ||
| import { runGrade } from '@buzzr/dfs-cli'; | ||
| import { runGrade, runGradeFromFiles } from '@buzzr/dfs-cli'; | ||
| // From in-memory objects | ||
| const result = await runGrade({ | ||
| entry, | ||
| entry, // DfsEntryInput | ||
| gameLogsByLegId: { 'leg-1': [gameLogRow] }, | ||
| }); | ||
| // Or straight from files | ||
| const fromFiles = await runGradeFromFiles({ | ||
| entryPath: './entry.json', | ||
| gameLogsPath: './gamelogs.json', | ||
| }); | ||
| ``` | ||
| | Export | Purpose | | ||
| | ----------------------- | -------------------------------------------------------------------- | | ||
| | `dfs-grade` (bin) | Grade an entry JSON against a gamelogs JSON, print settlement | | ||
| | `runGrade()` | Grade an in-memory `DfsEntryInput` against a `legId → gamelog[]` map | | ||
| | `runGradeFromFiles()` | Same, reading both inputs from file paths | | ||
| | `createDfsEngine` et al | Re-exported engine primitives for convenience | | ||
| ## When to use this vs siblings | ||
| | You want to… | Reach for | | ||
| | --------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | ||
| | Grade entries from the shell, CI, or a cron job | **this package** | | ||
| | Grade entries inside a TypeScript/JavaScript app | [`@buzzr/dfs-engine`](https://www.npmjs.com/package/@buzzr/dfs-engine) | | ||
| | Render results in a UI | [`@buzzr/dfs-react`](https://www.npmjs.com/package/@buzzr/dfs-react) | | ||
| | Build fixtures for your own tests | [`@buzzr/dfs-testkit`](https://www.npmjs.com/package/@buzzr/dfs-testkit) | | ||
| | Verify your integration grades identically to Buzzr | [`@buzzr/dfs-engine-test-vectors`](https://www.npmjs.com/package/@buzzr/dfs-engine-test-vectors) | | ||
| ## Links | ||
| - [Engine API docs](https://buzzr-app.github.io/dfs-engine/) | ||
| - [Monorepo & full package family](https://github.com/Buzzr-app/dfs-engine) | ||
| - [Issues](https://github.com/Buzzr-app/dfs-engine/issues) | ||
| ## License | ||
| MIT |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
No website
QualityPackage does not have a website.
21107
28.08%0
-100%0
-100%131
263.89%2
-33.33%+ Added
- Removed
Updated