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

@djodjonx/gwen-cli

v0.3.7

Published

GWEN Engine CLI with Citty and schema-based config validation

Readme

#@djodjonx/gwen-cli

GWEN CLI — Command-line interface for game development

Build, develop, and scaffold GWEN game projects from the command line.

Installation

npm install -D@djodjonx/gwen-cli
# or globally
npm install -g@djodjonx/gwen-cli

Quick Start

Create a New Project

npm create gwen-app@latest my-game
cd my-game
npm install
npm run dev

Commands

gwen dev

Start the development server with WASM hot-reload.

gwen dev

Options:

  • --port 3000 — Custom port (default: 5173)
  • --open — Auto-open in browser

gwen build

Build for production.

gwen build

Outputs optimized WASM and JavaScript to dist/.

gwen prepare

Prepare the project (one-time setup).

gwen prepare

gwen lint

Lint your code with oxlint.

gwen lint
# Fix issues
gwen lint --fix

gwen format

Format code with oxfmt.

gwen format --check  # Check only
gwen format          # Fix

Configuration

gwen.config.ts

Configure your game engine:

// gwen.config.ts
import { defineConfig } from '@djodjonx/gwen-kit';
import { InputPlugin } from '@djodjonx/gwen-plugin-input';
import { AudioPlugin } from '@djodjonx/gwen-plugin-audio';

export default defineConfig({
  // Canvas element ID
  canvas: 'game-canvas',

  // Engine configuration
  fps: 60,

  // Plugins
  plugins: [new InputPlugin(), new AudioPlugin()],
});

vite.config.ts

import { defineConfig } from 'vite';
import { gwen } from '@djodjonx/gwen-vite-plugin';

export default defineConfig({
  plugins: [
    gwen({
      cratePath: './crates/gwen-core',
      watch: true,
    }),
  ],
});

Project Structure

my-game/
├── src/
│   ├── main.ts              # Entry point
│   ├── scenes/              # Game scenes
│   │   └── GameScene.ts
│   ├── components/          # Component definitions
│   ├── systems/             # Game systems
│   └── prefabs/             # Entity prefabs
├── crates/
│   └── gwen-core/           # Rust WASM core
├── gwen.config.ts           # Engine config
├── vite.config.ts           # Build config
├── index.html               # HTML entry
└── package.json

Examples

Development Workflow

# Install dependencies
npm install

# Start dev server
npm run dev
# → http://localhost:5173
# → WASM auto-reloads on .rs changes

# Build for production
npm run build

# Preview production build
npm run preview

Create a Scene

// src/scenes/GameScene.ts
import { defineScene, defineComponent, Types } from '@djodjonx/gwen-engine-core';

const Position = defineComponent('Position', {
  x: Types.f32,
  y: Types.f32,
});

export const GameScene = defineScene({
  name: 'game',
  async onInit(api) {
    const engine = api.engine;

    // Create player entity
    const player = engine.createEntity();
    engine.addComponent(player, Position, { x: 100, y: 100 });
  },
  onUpdate(delta) {
    // Game logic
  },
});

Using Plugins

// gwen.config.ts
import { InputPlugin } from '@djodjonx/gwen-plugin-input';
import { AudioPlugin } from '@djodjonx/gwen-plugin-audio';

export default defineConfig({
  plugins: [new InputPlugin(), new AudioPlugin()],
});

// In your scene:
const input = api.services.get('input');
const audio = api.services.get('audio');

if (input.isJustPressed('Space')) {
  audio.play('jump');
}

Troubleshooting

Port Already in Use

gwen dev --port 3001

WASM Build Fails

  • Ensure Rust toolchain is installed: rustup target add wasm32-unknown-unknown
  • Check Cargo.toml in crates/gwen-core/
  • Try cargo build --target wasm32-unknown-unknown manually

Hot-Reload Not Working

  • Verify vite.config.ts has gwen() plugin registered
  • Check that .rs files are in the crate directory
  • Enable verbose logging: gwen({ verbose: true })

See Also