If you're writing shell scripts in Bun, this gives you the full arsenal: Bun.$'s template literal syntax for running commands with automatic escaping, Bun.spawn for subprocess control, and all the piping and error handling you'd expect. The template literal approach actually feels cleaner than traditional shell scripting since you get real variable interpolation and can chain to JavaScript functions. Covers the practical stuff like parallel execution, process management, and streaming output. Worth noting that it includes both async and sync APIs, so you can block when you need to. The examples show real deployment scenarios, not just toy commands.

skills.sh installs
331
GitHub stars
248
last updated
Aug 21, 2026

Install

$ npx -y skills add secondsky/claude-skills --skill bun-shell --agent claude-code

Installs into .claude/skills of the current project.

Files

Bun Shell

Bun provides powerful shell scripting capabilities with template literals and spawn APIs.

Bun.$ (Shell Template)

Basic Usage

import { $ } from "bun";

// Run command
await $`echo "Hello World"`;

// Get output
const result = await $`ls -la`.text();
console.log(result);

// JSON output
const pkg = await $`cat package.json`.json();
console.log(pkg.name);

Variable Interpolation

import { $ } from "bun";

const name = "world";
const dir = "./src";

// Safe interpolation (escaped)
await $`echo "Hello ${name}"`;
await $`ls ${dir}`;

// Array expansion
const files = ["a.txt", "b.txt", "c.txt"];
await $`touch ${files}`;

Piping

import { $ } from "bun";

// Pipe commands
const result = await $`cat file.txt | grep "pattern" | wc -l`.text();

// Chain with JavaScript
const files = await $`ls -la`.text();
const lines = files.split("\n").filter(line => line.includes(".ts"));

Error Handling

import { $ } from "bun";

// Throws on non-zero exit
try {
  await $`exit 1`;
} catch (err) {
  console.log(err.exitCode); // 1
  console.log(err.stderr);
}

Sponsors

Details

Repository
github.com/secondsky/claude-skills
Category
CLI & Terminal
First seen
Jun 3, 2026

More from secondsky/claude-skills

All 146
1agricidaniel avatarwiki-cliagricidaniel/claude-obsidianDefault vault-mutation transport for claude-obsidian v1.7+. Wraps the Obsidian CLI (Obsidian 1.12+) as the preferred way to read, write, search, and modify vaul317skills.sh installs
2incept5 avatareve-cli-primitivesincept5/eve-skillpacksCore Eve CLI primitives and capabilities for app developers. Use as the quick reference for commands and flows.302skills.sh installs
3bee-computer avatarbee-clibee-computer/bee-skillbee cli296skills.sh installs
4cinience avataralicloud-network-dns-cli-testcinience/alicloud-skillsMinimal smoke test for Alibaba Cloud DNS CLI skill. Validate aliyun-cli auth and describe-subdomain flow.292skills.sh installs
5wix avatarwix-cli-dashboard-modalwix/skillsUse when adding popup forms, confirmations, or detail views to Wix dashboards; creating reusable dialog components across dashboard pages; showing context-speci288skills.sh installs
6wix avatarwix-cli-dashboard-pagewix/skillsUse when building admin interfaces, management pages, CRUD operations, or dashboard configuration UIs. Triggers include dashboard, admin panel, data management,288skills.sh installs