Pattern Expand VS Code Extension
Create files and directories using brace expansion patterns.
Features
- Brace lists:
{a,b,c} → a, b, c
- Numeric ranges:
{1..5} → 1, 2, 3, 4, 5
- Zero-padded ranges:
{01..10} → 01, 02, ..., 10
- Descending ranges:
{5..1} → 5, 4, 3, 2, 1
- Character ranges:
{a..f} → a, b, c, d, e, f
- Multiple groups (cartesian product):
{a,b}-{1,2} → a-1, a-2, b-1, b-2
- Nested groups:
{a,{b,c}} → a, b, c
Usage
- Open Command Palette (
Ctrl+Shift+P / Cmd+Shift+P)
- Run Pattern New File
- Enter a pattern like
src/{components,utils}/{index,types}.ts
- Files and directories are created, and the first file opens in the editor
Build Instructions
# Install dependencies
npm install
# Compile TypeScript
npm run compile
Development
- Open this folder in VS Code
- Press
F5 to launch the Extension Development Host
- In the new window, run the "Pattern New File" command
Watch Mode
npm run watch
This will recompile on file changes.
CI
This project includes a GitHub Actions workflow (.github/workflows/ci.yml) that runs on push and pull requests to main:
- Installs dependencies
- Compiles TypeScript
- Runs linting

Examples
| Pattern |
Expanded Files |
test.txt |
test.txt |
{a,b}.txt |
a.txt, b.txt |
src/{foo,bar}/index.ts |
src/foo/index.ts, src/bar/index.ts |
file{1..3}.txt |
file1.txt, file2.txt, file3.txt |
file{01..03}.txt |
file01.txt, file02.txt, file03.txt |
{a..c}.txt |
a.txt, b.txt, c.txt |
{x,y}/{1..2}.ts |
x/1.ts, x/2.ts, y/1.ts, y/2.ts |
| |