Skip to content
popupiePublic

About

A standalone command line tool for KiriKiri games. It can inspect xp3 archives, prepare a KiriKiri Z website, and pack/unpack supported archives.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

krkrtools (WIP)

krkrtools is a command line tool for KiriKiri games. It can check game files, unpack supported archives, pack folders into archives, and create a website with KiriKiri Z Web.

Use krkrtools only with games you own or have permission to work with.

Choose a command

  • inspect identifies the engine, framework versions, and archive contents.
  • unpack extracts original named assets from XP3 files or embedded EXEs.
  • pack creates a standard XP3 archive from a folder.
  • list lists the files in one archive without extracting it.
  • plugins lists known plugins and their web compatibility.
  • web creates a website with loose game assets and a browser runtime.
  • serve starts a local web server for testing or playing an export.

Install

Requires Node.js 22+ and pnpm 10+. There are no third-party JavaScript dependencies to install. Make the krkrtools command available on your computer:

pnpm link -g

Show command help or the installed krkrtools version:

krkrtools --help
krkrtools --version

The short forms are -h and -v.

The hello example is a small source project for trying the commands without game's assets.

Inspect a game

krkrtools inspect "/path/to/Game"
krkrtools inspect "/path/to/data.xp3" --json
krkrtools list "/path/to/data.xp3"

The report shows engine and KAG versions with the supporting file and field or script declaration. Inspect the original game folder when possible: XP3 or KAG alone cannot identify the engine generation. Detection does not establish browser compatibility.

Create a website

For a game folder or a project containing startup.tjs:

krkrtools web "/path/to/Game"

The default, --separate true, creates a sibling folder named Game web. Use --out (-o) to choose a different output folder:

krkrtools web "/path/to/Game" --out "/path/to/My website"

Use --separate false or -s false to keep the desktop game and website in the same folder:

krkrtools web "/path/to/Game" --separate=false
krkrtools serve "/path/to/Game"

Runtime selection follows this order:

  1. Use an existing build supplied with --runtime (-r).
  2. Otherwise check upstream and reuse the matching build if it is already cached.
  3. Download a new build when upstream changes, keeping previous builds cached.

The default cache is ~/.cache/krkrtools, with XDG_CACHE_HOME and --cache-dir overrides. Use --offline to skip network access and use the last complete cached build.

The converter automatically loads a root data.xp3, other root asset archives (such as chara.xp3, dungeon.xp3, and voice.xp3), then contiguous patch.xp3, patch2.xp3, etc., or patch_0.xp3, patch_1.xp3, etc., in numeric order. A detected KAG3 declaration enables its compatibility adapters and flat patch lookup.

For conflicting base archives, nested archives, gaps, or mixed patch naming conventions, select every required archive in load order, base first and patches last:

krkrtools web "/path/to/Game" \
  --archive data.xp3 --archive patch.xp3

Web conversion is experimental. Native Windows plugins are not converted, and KiriKiri1 playback is not established. KiriKiri2 compatibility depends on the scripts and plugins working with the Z runtime.

Test or play a website

krkrtools serve "/path/to/Game web"
krkrtools serve "/path/to/Game web" --port 8080
krkrtools serve "/path/to/Game"

Open the printed URL. The default port is 4178.

Unpack assets

krkrtools unpack "/path/to/data.xp3"
krkrtools unpack "/path/to/Game" --out "/path/to/Game archives"

The default output is a sibling folder named data extracted for data.xp3, or Game extracted for a game folder. An EXE with a standard embedded XP3 is also accepted. For a game folder, each archive is extracted into its own subfolder.

The output for data.xp3 contains its original named assets:

data extracted/
  startup.tjs
  scenario/start.ks
  background/room.png
  voice/001.ogg

Original bytes and formats are preserved. Compiled or encoded scripts are not automatically decoded. Long filenames may need a reversible mapping recorded in .krkrtools-paths.json.

Pack assets

krkrtools pack "/path/to/data"
krkrtools pack "/path/to/data" --out "/path/to/new/data.xp3"

The default output is a sibling file named data.xp3. Packing keeps filenames and subdirectories and compresses files when useful. Use --no-compress to store all files directly.

Privacy and licenses

Game files stay local and are never uploaded. Automatic network access checks upstream runtime metadata and downloads engine files and notices when needed. --offline disables both. Runtime binaries are not included in this package. Exports keep downloaded notices under licenses/.

About

A standalone command line tool for KiriKiri games. It can inspect xp3 archives, prepare a KiriKiri Z website, and pack/unpack supported archives.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages