# npx-cli

Builds and packages npx-runnable CLI tools using Bun for development while generating Node.js-compatible output for npm.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 304 installs · ★ 177
- Author: jwynia
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jwynia/agent-skills/tree/HEAD/skills/tech/development/tooling/npx-cli/SKILL.md
- Updated: 2026-02-24
- HTML: https://affpapa.org/en/nevibecode/skills/npx-cli

## What it does

This skill establishes a project structure for terminal utilities distributed through `npx`. It separates business logic from command-line plumbing. You get either a dual setup that exports an importable library alongside the executable binary, or a binary-only package. Argument parsing uses `citty`, output styling relies on `picocolors`, and bundling goes through `Bunup`.

Code quality relies on strict TypeScript settings, `Biome`, `ESLint`, and `Vitest` test suites. Release preparation is handled by `Changesets` with provenance flags for npm. The compiled output in `dist/` explicitly requires a `#!/usr/bin/env node` shebang. End users do not need Bun installed to run your published command.

This setup targets single-package repositories only. It breaks down in monorepos, and standalone libraries without a CLI need a separate configuration.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jwynia/agent-skills --skill npx-cli -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/npx-cli/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/npx-cli/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jwynia/agent-skills --skill npx-cli -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/npx-cli/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jwynia/agent-skills --skill npx-cli -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/npx-cli/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jwynia/agent-skills npx-cli
```

2. **Manually: put the files in place**
- File: `.github/skills/npx-cli/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jwynia/agent-skills --skill npx-cli -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jwynia/agent-skills --path skills/tech/development/tooling/npx-cli
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/npx-cli/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jwynia/agent-skills --skill npx-cli -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jwynia/agent-skills/tree/HEAD/skills/tech/development/tooling/npx-cli/SKILL.md

## When to use it
- scaffold a new CLI package executable via `npx`
- configure argument parsing and sub-commands with `citty`
- isolate domain logic from terminal entry points for unit testing
- bundle dual-entry packages with both library API and binary exports
- automate npm releases with `Changesets` and provenance checks

## Example prompts
- Scaffold a new CLI project for npx with input and output flags
- Set up sub-commands for my tool using citty and format terminal output
- Configure package.json and Bunup for publishing a CLI binary to npm

## Similar
- [bun-runtime](https://affpapa.org/en/nevibecode/skills/secondsky-bun-runtime.md) — skill · 414 installs
- [insforge-cli](https://affpapa.org/en/nevibecode/skills/insforge-cli.md) — skill · 60500 installs
- [bun-sqlite](https://affpapa.org/en/nevibecode/skills/bun-sqlite.md) — skill · 495 installs
- [typescript-scaffold](https://affpapa.org/en/nevibecode/commands/typescript-scaffold.md) — command · ★ 41823
- [javascript-testing-patterns](https://affpapa.org/en/nevibecode/skills/javascript-testing-patterns.md) — skill · 20472 installs
- [antfu](https://affpapa.org/en/nevibecode/skills/antfu.md) — skill · 16900 installs

From the same set: [jwynia/agent-skills](https://affpapa.org/en/nevibecode/by/jwynia/agent-skills.md) — 113 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
