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

@sashimo/cli

v3.7.0

Published

CLI tool for installing and setting up Sashi in Next.js and Node.js projects

Readme

Sashi CLI

The official command-line interface for installing and managing Sashi AI admin companion in your Next.js and Node.js projects.

Installation

No installation required! Use npx to run commands directly:

npx @sashimo/cli setup
npx @sashimo/cli init my-app
npx @sashimo/cli check

Quick Start

For Existing Projects

# Setup Sashi in your existing project
npx @sashimo/cli setup

# Or with options
npx @sashimo/cli setup --framework nextjs --typescript --api-key sk-your-openai-key

For New Projects

# Create a new project with Sashi pre-configured
npx @sashimo/cli init my-admin-app

# Or with options
npx @sashimo/cli init my-admin-app --framework nodejs --typescript

Check Your Setup

# Verify your Sashi configuration
npx @sashimo/cli check

Commands

npx @sashimo/cli setup

Setup Sashi in an existing Next.js or Node.js project.

npx @sashimo/cli setup [options]

Options:

  • -f, --framework <framework> - Target framework (nextjs, nodejs, express, auto)
  • -t, --typescript - Use TypeScript setup
  • -y, --yes - Skip prompts and use defaults
  • --api-key <key> - OpenAI API key
  • --hub-url <url> - Sashi Hub URL (optional)

Example:

npx @sashimo/cli setup --framework nextjs --typescript --api-key sk-...

npx @sashimo/cli init [project-name]

Create a new project with Sashi pre-configured.

npx @sashimo/cli init [project-name] [options]

Options:

  • -f, --framework <framework> - Target framework (nextjs, nodejs, express)
  • -t, --typescript - Use TypeScript (default: true)
  • -y, --yes - Skip prompts and use defaults
  • --api-key <key> - OpenAI API key
  • --hub-url <url> - Sashi Hub URL (optional)

Example:

npx @sashimo/cli init my-app --framework nextjs --api-key sk-...

npx @sashimo/cli check

Check your Sashi setup and configuration.

npx @sashimo/cli check

This command will:

  • Check if Sashi packages are installed
  • Verify configuration files exist
  • Provide recommendations for setup issues

npx @sashimo/cli add

Add Sashi middleware to your project.

npx @sashimo/cli add [options]

Options:

  • -y, --yes - Skip prompts and use defaults

Example:

npx @sashimo/cli add --yes

npx @sashimo/cli update

Update Sashi packages to latest version.

npx @sashimo/cli update [options]

Options:

  • -y, --yes - Skip prompts and update all

Example:

npx @sashimo/cli update --yes

Framework Support

Next.js

Sashi CLI provides full support for Next.js projects:

  • Automatic detection of Pages Router vs App Router
  • Creates API routes for Sashi middleware
  • Sets up UI pages for admin interface
  • Configures Tailwind CSS integration

Generated Files:

  • pages/api/sashi/[[...slug]].ts - API route
  • pages/sashi/index.tsx - Admin UI page
  • sashi.config.ts - Configuration file
  • .env.local - Environment variables

Express.js

For Express.js applications:

  • Creates middleware integration example
  • Provides server setup templates
  • Configures CORS and routing

Generated Files:

  • sashi-example.ts - Integration example
  • sashi.config.ts - Configuration file
  • .env - Environment variables

Node.js (Generic)

For generic Node.js applications:

  • Creates HTTP server integration
  • Provides basic routing setup
  • Configures middleware handling

Configuration

Sashi CLI generates a sashi.config.ts file with all configuration options:

import type { SashiConfig } from "@sashimo/lib"

const config: SashiConfig = {
    openai: {
        apiKey: process.env.OPENAI_API_KEY!,
        model: "gpt-4",
    },
    middleware: {
        path: "/sashi",
        cors: {
            origin: process.env.NODE_ENV === "development" ? "*" : false,
        },
    },
    ui: {
        theme: "light",
        branding: {
            title: "Admin Panel",
        },
    },
    functions: {
        loadDefaults: false,
        hiddenFromUI: [],
    },
}

export default config

Environment Variables

The CLI sets up these environment variables:

# Required
OPENAI_API_KEY=your-openai-api-key

# Optional - defaults to https://hub.usesashi.com
SASHI_API_SECRET_KEY=your-sashi-api-secret-key
SASHI_HUB_URL=https://hub.usesashi.com

Package Manager Support

Sashi CLI automatically detects and uses your preferred package manager:

  • npm - Default
  • yarn - Detected by yarn.lock
  • pnpm - Detected by pnpm-lock.yaml
  • bun - Detected by bun.lockb

TypeScript Support

Sashi CLI provides excellent TypeScript support:

  • Automatic TypeScript detection
  • Type-safe configuration files
  • Proper import/export syntax
  • Type definitions for all APIs

Troubleshooting

Common Issues

  1. "No package.json found"

    • Run the command in a Node.js project directory
    • Initialize with npm init if needed
  2. "OpenAI API key is required"

    • Get an API key from OpenAI Platform
    • Pass it via --api-key flag or set in environment
  3. "Tailwind CSS not detected"

    • Install Tailwind CSS: npx tailwindcss init -p
    • Required for Sashi UI components

Getting Help

# Show help for any command
sashi --help
sashi setup --help
sashi init --help

# Check your setup
sashi check --verbose

Examples

Quick Setup for Next.js

# In your Next.js project
sashi setup --framework nextjs --typescript --api-key sk-your-key

# Start development server
npm run dev

# Visit http://localhost:3000/sashi

Create New Express App

# Create new Express app with Sashi
sashi init my-api --framework express --typescript

cd my-api
npm run dev

# Visit http://localhost:3000/sashi

Add Middleware to Existing Project

# Add Sashi middleware
sashi add

# Update Sashi packages
sashi update

Community

Contributing

See the main Sashi repository for contribution guidelines.

License

MIT License - see the LICENSE file for details.