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

@tonk/cli

v0.3.3

Published

The Tonk stack command line utility

Readme

Tonk CLI

Command line utilities for your Tonk network

Installation

npm install -g @tonk/cli

Commands

Create a new Tonk app

tonk create my-app

Development

Run your Tonk app in development mode:

tonk dev

Serve

Serve your built Tonk app locally:

tonk serve

Bundle Management

Tonk supports managing application bundles through the following commands:

Push a bundle to the server

Package your dist folder and upload it to the Tonk server:

# Push with defaults (from ./dist folder, using package name)
tonk push

# Push with custom options
tonk push -n my-bundle -d ./build -s

Options:

  • -u, --url <url> - URL of the Tonk server (default: http://localhost:7777)
  • -n, --name <name> - Name for the bundle (defaults to directory name or package name)
  • -d, --dir <dir> - Directory to bundle (defaults to ./dist)
  • -s, --start - Start the bundle after upload

List available bundles

List all bundles available on the server:

tonk ls

Options:

  • -u, --url <url> - URL of the Tonk server (default: http://localhost:7777)

List running bundle servers

Show all currently running bundle servers:

tonk ps

Options:

  • -u, --url <url> - URL of the Tonk server (default: http://localhost:7777)

Start a bundle server

Start a bundle server for a specific bundle:

tonk start my-bundle

# Specify a port
tonk start my-bundle -p 8080

Options:

  • -u, --url <url> - URL of the Tonk server (default: http://localhost:7777)
  • -p, --port <port> - Port for the bundle server (optional)

Kill a running bundle server

Stop a running bundle server by its ID:

tonk kill <server-id>

Options:

  • -u, --url <url> - URL of the Tonk server (default: http://localhost:7777)

Configure AWS Deployment

Configure your AWS EC2 instance for deployment:

# Interactive configuration (with existing instance)
tonk config

# Provision a new EC2 instance
tonk config --provision [--key-name my-key]

# Configure with existing EC2 instance
tonk config --instance ec2-xx-xx-xx-xx.compute-1.amazonaws.com --key ~/path/to/key.pem

Options:

  • -i, --instance <address> - EC2 instance address
  • -k, --key <path> - Path to SSH key file
  • -u, --user <n> - SSH username (default: ec2-user)
  • -p, --provision - Provision a new EC2 instance
  • -n, --key-name <n> - AWS key pair name (for provisioning)

Deploy to AWS

Deploy your Tonk app to an EC2 instance:

tonk deploy

Options:

  • -i, --instance <address> - EC2 instance address
  • -k, --key <path> - Path to SSH key file
  • -u, --user <n> - SSH username (default: ec2-user)
  • -t, --token <token> - Pinggy.io access token for public URL
  • -b, --backblaze - Enable Backblaze B2 storage for document backup
  • -f, --filesystem - Enable filesystem storage for document backup

Persistence Features

Tonk supports multiple options for persisting your documents:

  1. Backblaze B2 Storage: Cloud-based backup for your documents

    • Secure, scalable cloud storage
    • Automatic synchronization at configurable intervals
    • Requires a Backblaze B2 account with bucket and application keys
  2. Filesystem Storage: Local file-based storage on your server

    • Store documents directly on the server's filesystem
    • Configurable storage path and sync intervals
    • Automatic directory creation
  3. Dual Storage: Use both Backblaze and filesystem storage

    • Configure a primary storage option
    • Automatic fallback to secondary storage

During deployment, you'll be guided through setting up your preferred storage options interactively if not specified via command-line options.

Development

  1. Clone the repository
  2. Install dependencies: npm install
  3. Run the dev mode: npm run dev

Troubleshooting

Permission Denied Error During Installation

If you encounter a permission denied error when installing the Tonk CLI globally:

npm install -g @tonk/cli
# Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'

This is a common npm issue on Unix systems. Here are several solutions:

Option 1: Fix npm permissions

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

Option 2: Configure npm to use a different directory

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
npm install -g @tonk/cli

License

Simplicity and freedom.

MIT © Tonk