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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@betagors/yama-cli

v0.1.0-alpha.0

Published

Yama CLI — global CLI tool for Yama framework

Downloads

78

Readme

@betagors/yama-cli

Global CLI tool for Yama - API framework toolkit.

Installation

npm install -g @betagors/yama-cli

Commands

Setup & Initialization

yama init

Initialize a new Yama project. Creates yama.yaml, src/handlers/ directory, and updates package.json with scripts.

yama init
yama init --name my-api --version 1.0.0

yama setup

Setup Yama in an existing project. Adds scripts to package.json and checks for dependencies.

yama setup
yama setup --skip-scripts

Development

yama dev

Start development server with watch mode.

yama dev
yama dev --port 3000
yama dev --no-watch
yama dev --config custom.yaml

Generation

yama generate

Generate SDK and TypeScript types from yama.yaml.

yama generate
yama generate --watch
yama generate --output src/lib/api.ts
yama generate --types-only
yama generate --sdk-only
yama generate --framework nextjs

yama types

Generate TypeScript types only.

yama types
yama types --output src/types.ts

yama sdk

Generate SDK only.

yama sdk
yama sdk --output src/lib/api.ts
yama sdk --framework react

Validation & Inspection

yama validate

Validate yama.yaml configuration.

yama validate
yama validate --strict
yama validate --config custom.yaml

yama config

Show current configuration.

yama config

yama endpoints

List all endpoints defined in yama.yaml.

yama endpoints

yama schemas

List all schemas defined in yama.yaml.

yama schemas

Features

  • Smart Project Detection: Automatically detects Next.js, React, Vite, or Node.js projects
  • Watch Mode: Auto-regenerate SDK/types when yama.yaml changes
  • Framework Helpers: Generates framework-specific hooks and helpers (Next.js, React)
  • Zero Configuration: Works out of the box with smart defaults

Workflow

First-time Setup

# 1. Install globally (one time)
npm install -g @betagors/yama-cli

# 2. Create new project
mkdir my-api
cd my-api
npm init -y

# 3. Initialize Yama
yama init

# 4. Install runtime
npm install @betagors/yama-runtime-node

# 5. Start developing
yama dev

Daily Development

# Edit yama.yaml
vim yama.yaml

# SDK auto-regenerates (watch mode)
# Server auto-restarts
# Everything stays in sync

Generate SDK for Frontend

# In backend project
yama generate --output ../frontend/src/lib/api.ts

# Or with framework helpers
yama generate --framework nextjs

Project Structure

After running yama init, your project will look like:

my-api/
├── yama.yaml          # Yama configuration
├── package.json       # Has @betagors/yama-* dependencies
├── src/
│   ├── handlers/      # Your handlers
│   └── generated/     # Auto-generated by Yama
│       ├── types.ts
│       └── sdk.ts
└── node_modules/
    └── @betagors/     # Published packages

Framework Support

Next.js

yama generate --framework nextjs

Generates:

  • lib/generated/types.ts
  • lib/generated/sdk.ts
  • lib/hooks/useApi.ts (React Query hooks)

React/Vite

yama generate --framework react

Generates:

  • src/lib/generated/types.ts
  • src/lib/generated/sdk.ts
  • src/hooks/useApi.ts (React hooks)

Node.js

yama generate

Generates:

  • lib/generated/types.ts
  • lib/generated/sdk.ts

License

MIT