DEV Community

Cover image for Stop Copy-Pasting Boilerplate: Scaffold Projects & Snippets Fast with BScaff
Akash Nag
Akash Nag

Posted on AI-assisted

Stop Copy-Pasting Boilerplate: Scaffold Projects & Snippets Fast with BScaff

How many times have you started a new feature or microservice, only to spend the first 20 minutes copy-pasting .eslintrc, tsconfig.json, Dockerfiles, and boilerplate directory structures from an older project?

Or worse—you find an awesome directory structure generated by Claude or ChatGPT, and you sit there manually mkdir-ing and touch-ing every single file?

We've all been there:

  • Boilerplate Fatigue: Re-creating the same folder hierarchy and setup logic across multiple repositories.
  • Context Switching: Hunting through old codebases or browser tabs to find that one reusable snippet or setup script.
  • Messy Template Repositories: Maintaining dozens of heavy, single-purpose GitHub starter templates for tiny scripts or components.

There has to be a better way to capture, store, and recreate developer resources without leaving the terminal.

Enter BScaff.


What is BScaff?

BScaff is a light, lightning-fast CLI tool designed to store, manage, and scaffold reusable developer resources. Think of it as a personal, command-line vault for:

  • Entire project directory trees (tree)
  • Multi-file bundles (files)
  • Code and text snippets (snippet)
  • Template packages with variable substitution (template)
  • Web URLs (url)

Everything in BScaff revolves around a snapshot—a uniquely named key (-k) storing your saved content locally under ~/.bscaff.

Installation

Getting started takes seconds. Install BScaff globally via npm:

npm install -g @akashnag/bscaff
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

bscaff --version
Enter fullscreen mode Exit fullscreen mode

5-Minute Quickstart Walkthrough

Let's dive into three everyday workflows where BScaff instantly saves you time.

1. Snapshotted Project Scaffolding

Say you have a starter React or Node.js template configured just the way you like it. Instead of creating a GitHub template repository or manually zip-copying folders, save it as a directory snapshot:

# Save your base project as a snapshot named 'node-base'
bscaff -k node-base --desc "Base Node.js Express setup" --tags node,express save tree ~/projects/my-node-starter
Enter fullscreen mode Exit fullscreen mode

When you are ready to start a new service, extract it anywhere:

# Extract the snapshot into a new folder
bscaff -k node-base extract ./my-new-api
Enter fullscreen mode Exit fullscreen mode

Boom! Your full directory structure and file contents are instantly created.


2. Turn AI-Generated Trees into Real Files instantly

AI coding assistants are great at generating project structures like this:

my-service/
├── src/
│   ├── controllers/
│   │   └── user.controller.ts
│   ├── routes/
│   │   └── user.routes.ts
│   └── index.ts
├── tests/
│   └── user.test.ts
└── package.json
Enter fullscreen mode Exit fullscreen mode

Instead of manually creating these folders and files, copy that ASCII diagram directly to your clipboard and run:

bscaff create tree ./my-service --prompt-for-content
Enter fullscreen mode Exit fullscreen mode

BScaff parses the tree diagram directly from your clipboard, constructs the complete directory hierarchy on disk, and interactively prompts you to supply content for each generated file.


3. Smart Snippets & Variable Substitutions

Need dynamic placeholders in your files? BScaff supports Mustache variable templates ({{ variable }}).

Suppose you have a component template containing:

// {{ componentName }}.tsx
export const {{ componentName }} = () => {
    return <div>Hello from {{ componentName }}</div>;
};
Enter fullscreen mode Exit fullscreen mode

When extracting or generating from this snapshot, BScaff will automatically detect {{ componentName }}, prompt you for its value, and replace it across file paths and file contents seamlessly!


Feature Overview & Command Cheat Sheet

Here is a quick command reference to keep in your back pocket:

Action Command Syntax
Save Directory Tree bscaff -k <key> save tree <path>
Save Git Repo bscaff -k <key> save tree <repo-url> --git
Save Snippet from File bscaff -k <key> save snippet <file-path>
Save Clipboard Snippet bscaff -k <key> save snippet --memory --type ts
Extract Snapshot bscaff -k <key> extract <dest-path>
Dry Run Extraction bscaff -k <key> extract <dest-path> --dry-run
List Saved Snapshots bscaff list
Search Snapshots bscaff search --tags react
Copy Snippet to Clipboard bscaff -k <key> copy
Delete Snapshot bscaff -k <key> delete

Bonus: BScaff's Hidden Superpowers

BScaff isn't just for project scaffolding—it has a few unexpected capabilities that can streamline your daily workflow.

1. Terminal URL Bookmarking

Stop cluttering your browser bookmark bar with docs you only use during development. Save URLs straight in BScaff:

# Bookmark official documentation or dashboards
bscaff -k go-docs save url https://go.dev/doc/
Enter fullscreen mode Exit fullscreen mode

Whenever you need to jump back in, run:

# Automatically launches the URL in your default browser
bscaff -k go-docs open
Enter fullscreen mode Exit fullscreen mode

2. Terminal Markdown Note-Taking

You can use BScaff as a persistent, zero-friction markdown scratchpad:

# Create a blank markdown note snapshot
bscaff -k sprint-notes save snippet --type md
Enter fullscreen mode Exit fullscreen mode

Whenever you want to view or edit your notes, use the update content or open commands:

# Edit your markdown notes directly in your configured terminal text editor
bscaff -k sprint-notes update content
Enter fullscreen mode Exit fullscreen mode

Ready to Streamline Your Workflow?

BScaff was built to eradicate repetitive setup tasks so you can focus on writing actual code.

Give it a try on your next project:

If you find it helpful, drop a star on GitHub, share it with your team, and happy scaffolding! 🚀

Top comments (1)

Collapse
 
launchgatecheck profile image
Launch Gate •

The dry-run command is the part I'd use before extracting into an existing repo. One fixture worth showing: two template paths become the same filename after substitution, and that filename already has local edits. Does dry-run show both collisions, and does the real extraction refuse before writing any of the other files? A temporary-directory run with before/after hashes would make the overwrite policy clear without risking a working project. I'd also make the preview distinguish created files from replaced files rather than listing paths alone.