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

@craftware/crafty-cli

v0.3.0

Published

Crafty Hosting CLI — deploy your frontend build to Crafty Hosting

Readme

@craftware/crafty-cli

Crafty Hosting CLI — deploy your frontend build to Crafty Hosting with a single command. The CLI talks to your Crafty CMS tenant; the underlying hosting provider is fully abstracted (you never deal with it directly).

Install

npm i -g @craftware/crafty-cli

Requires Node.js 20+.

Quick start

From your frontend project (the one that already consumes the Crafty API):

crafty login     # opens a browser to approve the CLI (OAuth device flow)
crafty init      # writes crafty.json (site + environment + build dir)
npm run build    # produce ./dist (framework-specific)
crafty deploy    # zips the build, uploads it, prints the live URL

The CLI reads CRAFTY_API_URL from your project's .env to know which tenant to talk to, so there is nothing else to configure. Hosting must be enabled for your tenant, site and environment (in the Crafty panel) before a deploy is allowed.

Multiple tenants

The CLI keeps one session per tenant host, so you stay logged into all of your tenants at once. Each project's CRAFTY_API_URL selects which stored session is used — switching directories never forces a re-login. Log into a tenant without entering its project with crafty login --host=<url>.

Commands

| Command | Description | | --- | --- | | crafty login [--host=<url>] | Authenticate via the OAuth 2.0 Device Authorization Grant. Without --host, the tenant comes from CRAFTY_API_URL. The token (scope deploy) is stored per host in ~/.crafty/credentials (mode 600). | | crafty init [--site=<slug> --environment=<env> --build-dir=<dir>] | Create crafty.json in the project. | | crafty deploy [dir] | Package and deploy a build directory (default: the buildDir from crafty.json, i.e. dist). | | crafty status | Show the status of the project's last deployment. | | crafty logout | Revoke and remove the session for the current project's tenant. | | crafty update (crafty --update / -u) | Self-update the globally installed CLI to the latest version on npm. | | crafty --version / crafty help | Print version / usage. |

crafty.json

{
  "site": "acme",
  "environment": "production",
  "buildDir": "dist"
}

Set buildDir to your framework's output: Vite/CRA/Astro dist, Next.js static export out, Nuxt .output/public, SvelteKit (static adapter) build.

How it resolves context

  1. CRAFTY_API_URL from the project .env (or the environment) → tenant base URL.
  2. crafty.jsonsite, environment, buildDir.
  3. ~/.crafty/credentials → the access token stored for that tenant host.

For safety, the token is only ever sent to the host it was issued for, https is required (except localhost), and .git / .env* / node_modules / symlinks are excluded from the uploaded build.

Deployed URL & custom domains

A successful deploy is served at a tenant-scoped subdomain {tenant}-{site}-{environment}.pages.crafty.do (DNS + TLS set up automatically). To use your own domain, add it in the Crafty panel under Site → Hosting; it returns a CNAME record to create at your registrar.

Agent skill

This package ships a crafty-deploy skill (under skills/) that teaches coding agents how to use the CLI — when to run login/init/deploy, how to set buildDir per framework, and how to troubleshoot. Agents that load skills from installed packages pick it up automatically.

Development

npm install
npm run build      # tsc → dist
npm test           # builds, then runs node:test
npm run typecheck

Publishing

Published as a public, scoped package under the @craftware org. publishConfig.access is already public and prepublishOnly rebuilds dist, so no extra flags are needed.

Prerequisites: an npm account that is a member of the craftware org with publish rights, and your 2FA device if enabled.

# 1. authenticate
npm login
npm whoami

# 2. from this package, install exact deps and validate
cd sdk/cli
npm ci
npm test
npm run typecheck

# 3. preview the exact tarball (no upload)
npm publish --dry-run
#    expect: dist/**, skills/**, LICENSE, README.md, package.json
#    (never src/, tests/ or node_modules/)

# 4. publish
npm publish            # add --otp=123456 if 2FA is enabled

# 5. verify
npm view @craftware/crafty-cli
npm i -g @craftware/crafty-cli && crafty --version

Releasing a new version

cd sdk/cli
npm version patch      # or minor / major — creates a commit + git tag
git push --follow-tags
npm publish

Notes:

  • A given version can only be published once; bump the version for any change.
  • Publish from a clean tree at the intended commit.
  • The crafty bin is dist/bin/crafty.js (with a #!/usr/bin/env node shebang).