bun-shell

Solid

Bun shell scripting with Bun.$, Bun.spawn, subprocess management. Use for shell commands, template literals, or command execution.

Data & Documents 162 stars 25 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Bun Shell Bun provides powerful shell scripting capabilities with template literals and spawn APIs. ## Bun.$ (Shell Template) ### Basic Usage ```typescript 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 ```typescript 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 ```typescript 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 ```typescript import { $ } from "bun"; // Throws on non-zero exit try { await $`exit 1`; } catch (err) { console.log(err.exitCode); // 1 console.log(err.stderr); } // Quiet mode (no throw) const result = await $`exit 1`.quiet(); console.log(result.exitCode); // 1 // Check exit code const { exitCode } = await $`grep pattern file.txt`.quiet(); if (exitCode !== 0) { console.log("Pattern not found"); } ``` ### Output Types ```typescript import { $ } from "bun"; // Text const text = await $`echo hello`....

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category