npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rppdice/cli

v1.1.0

Published

Developer CLI for RppDice TRPG system authors: validate, trace, and replay-test TOML systems.

Downloads

523

Readme

@rppdice/cli

RppDice TRPG システム作者向け開発支援 CLI。

想定読者

このパッケージが必要なのは、新しいプラグインを 作成 するか、CI でフィクスチャを回す場合だけです。 アプリケーションでプラグインを利用するなら @rppdice/core を直接使ってください。

インストール

npm install --save-dev @rppdice/cli @rppdice/core

(プレアルファ — 公開 API が固まるまで npm への publish は保留しています。)

コマンド

rppdice validate <file.toml>            スキーマ検証 (パス付きエラー)
rppdice trace <file.toml> <command>     ステップ単位トレース
                                          --seed <n>      決定論的 RNG
                                          --locale <tag>  i18n ラベル
rppdice test <system.toml> <fixtures.toml>
                                        seeded リプレイ
                                          exit 0 pass / 1 fail

rppdice validate

npx rppdice validate packages/example/src/systems/three-band-2d6.toml
# OK three-band-2d6

失敗時はパス付きで返ります: commands[0].steps[2].when: must not be empty

rppdice trace

npx rppdice trace packages/example/src/systems/three-band-2d6.toml "TB+3" --seed 42
# [0] eval    mod_val = 3
# [1] roll    r = [4, 6]
# [2] eval    total = 13
# [3] outcome verdict = "strong"
# [4] output  text = "2D6 [4, 6] mod=3 total=13 → Strong"
#
# success=true failure=false critical=false fumble=false secret=false

rppdice test

フィクスチャファイルは TOML です:

[[fixture]]
name = "TB+3 で大成功になる"
command = "TB+3"
seed = 1
expects.success = true
expects.text_includes = "Strong"

[[fixture]]
name = "TB-5 で失敗になる"
command = "TB-5"
seed = 1
expects.failure = true
npx rppdice test system.toml fixtures.toml
# pass  TB+3 で大成功になる
# pass  TB-5 で失敗になる
# 2/2 passing

ライブラリ API

CLI の内部実装はライブラリ関数としても export されており、カスタム CI スクリプト・VS Code 拡張・Web プレイグラウンドなどから直接呼び出せます:

| Export | 対応 CLI コマンド | | ----------------------------------------- | ------------------ | | validate(src): ValidationResult | rppdice validate | | trace(registry, id, command, opts?) | rppdice trace | | traceFromToml(toml, command, opts?) | rppdice trace | | runFixtures(registry, id, fixtures) | rppdice test | | parseFixtureFile(src): Fixture[] | rppdice test | | runFixtureFile(systemToml, fixtureToml) | rppdice test |

import { validate, trace, runFixtureFile } from "@rppdice/cli";

const r = validate(tomlSource);
if (!r.ok) console.error(r.issues[0]!.message);

const { frames, outcome } = trace(registry, "three-band-2d6", "TB+3", { seed: 42n });

const { results } = runFixtureFile(systemToml, fixtureToml);
const failed = results.filter((r) => !r.ok);

ライセンス

MIT。LICENSE を参照。