Goal: Create a framework-agnostic, hybrid CLI tool for managing reusable code templates (called Bricks). Supports both local templates (stored on disk, fully mutable) and remote templates (fetched from GitHub on-demand). Developers can create, modify, inspect, and apply templates to new projects seamlessly.
Every developer has faced this workflow:
- Create a new project (e.g.,
nest new my-app) - Open an existing project with code you want to reuse
- Manually copy-paste files (auth module, pagination utils, config files)
- Adjust imports, fix paths, install missing dependencies
- Repeat for every new project
CodeBrick eliminates steps 2-4 entirely.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HYBRID WORKFLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β LOCAL TEMPLATES β β
β β β β
β β [Local Project] ββbrick saveβββΊ [~/.codebrick/templates/] β β
β β β β β
β β [New Project] βββbrick applyββββββββββββββ β β
β β β β
β β β Files stored on disk β Fully mutable β Offline access β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β REMOTE TEMPLATES (GitHub) β β
β β β β
β β [GitHub Repo] ββbrick linkβββΊ [Registry with metadata only] β β
β β β β β
β β [New Project] βββbrick applyββββββββββββββ (fetches on-demand) β β
β β β β
β β β No disk usage β Always latest β Team sharing via GitHub β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Local Brick: A reusable, mutable template with actual files stored on disk
- Remote Brick: A pointer to a GitHub repo/path β files fetched on-demand when applied
- Template Store: Local directory for local templates + registry for remote references
- Non-Destructive: Original codebase is never modified when saving templates
| Principle | Description |
|---|---|
| Hybrid Storage | Choose between local (files on disk) or remote (GitHub) per template |
| Local = Mutable | Local templates can be modified anytime without affecting source |
| Remote = Linked | Remote templates stay in sync with GitHub, always fetch latest or pinned ref |
| Framework Agnostic | Works with any language, framework, or file type |
| Non-Destructive | Original codebase is never modified when saving or updating templates |
| Version Aware | Smart dependency version management when applying templates |
| Use Case | Recommended Type |
|---|---|
| Personal utilities you modify frequently | Local |
| Team-shared templates via GitHub | Remote |
| Templates you want to customize per use | Local |
| Open-source boilerplates | Remote |
| Offline development | Local |
| Always want latest version | Remote |
CodeBrick works with any technology stack since it operates at the file level:
| Category | Examples |
|---|---|
| Frontend | React, Vue, Angular, Svelte, Solid, Astro |
| Backend | NestJS, Express, FastAPI, Django, Rails, Spring Boot |
| Mobile | React Native, Flutter, Swift, Kotlin |
| Languages | TypeScript, JavaScript, Python, Go, Rust, Java, C# |
| Infrastructure | Terraform, Pulumi, Docker, Kubernetes configs |
| Other | Markdown docs, config files, shell scripts, any files |
~/.codebrick/
βββ config.json # Global configuration (GitHub token, preferences)
βββ store.json # Template registry/index (both local & remote)
βββ templates/ # LOCAL templates only (actual files)
βββ nestjs-auth/
β βββ brick.json # Template metadata
β βββ auth.module.ts
β βββ auth.service.ts
β βββ auth.controller.ts
β βββ guards/
β β βββ jwt.guard.ts
β βββ strategies/
β βββ jwt.strategy.ts
βββ react-modal/
β βββ brick.json
β βββ Modal.tsx
β βββ Modal.styles.ts
β βββ index.ts
βββ fastapi-auth/
βββ brick.json
βββ auth.py
βββ dependencies.py
βββ schemas.py
# REMOTE templates are NOT stored here β only metadata in store.json
# Files are fetched from GitHub on-demand when applying
Each local template contains a brick.json file with metadata:
{
"name": "nestjs-auth",
"type": "local",
"version": "1.0.0",
"description": "JWT authentication module for NestJS",
"createdAt": "2026-01-11T10:30:00Z",
"updatedAt": "2026-01-11T14:20:00Z",
"source": {
"origin": "local",
"path": "/Users/dev/projects/my-backend/src/auth"
},
"files": [
"auth.module.ts",
"auth.service.ts",
"auth.controller.ts",
"guards/jwt.guard.ts",
"strategies/jwt.strategy.ts"
],
"dependencies": {
"@nestjs/jwt": "^10.0.0",
"@nestjs/passport": "^10.0.0",
"passport-jwt": "^4.0.0",
"bcrypt": "^5.1.0"
},
"devDependencies": {
"@types/passport-jwt": "^3.0.0",
"@types/bcrypt": "^5.0.0"
},
"tags": ["auth", "jwt", "nestjs", "security"]
}{
"version": "1.0",
"templates": {
"nestjs-auth": {
"type": "local",
"path": "templates/nestjs-auth",
"description": "JWT authentication module for NestJS",
"tags": ["auth", "jwt", "nestjs"],
"createdAt": "2026-01-11T10:30:00Z",
"updatedAt": "2026-01-11T14:20:00Z"
},
"react-modal": {
"type": "local",
"path": "templates/react-modal",
"description": "Reusable modal component with animations",
"tags": ["react", "modal", "ui"],
"createdAt": "2026-01-10T09:00:00Z",
"updatedAt": "2026-01-10T09:00:00Z"
},
"company-starter": {
"type": "remote",
"github": {
"owner": "mycompany",
"repo": "templates",
"path": "nestjs-starter",
"ref": "main",
"commit": "a1b2c3d4"
},
"description": "Company NestJS starter template",
"tags": ["nestjs", "starter", "company"],
"createdAt": "2026-01-08T15:00:00Z",
"updatedAt": "2026-01-08T15:00:00Z"
},
"oss-react-hooks": {
"type": "remote",
"github": {
"owner": "awesome-dev",
"repo": "react-utils",
"path": "src/hooks",
"ref": "v2.1.0",
"commit": null
},
"description": "Collection of useful React hooks",
"tags": ["react", "hooks", "utils"],
"createdAt": "2026-01-05T10:00:00Z",
"updatedAt": "2026-01-05T10:00:00Z"
}
}
}Key Differences:
| Property | Local Template | Remote Template |
|---|---|---|
type |
"local" |
"remote" |
path |
Path to ~/.codebrick/templates/ |
Not used |
github |
Not used | Owner, repo, path, ref, commit |
| Files stored? | Yes, on disk | No, fetched on-demand |
| Mutable? | Yes | No (re-link to update) |
| Component | Technology | Reason |
|---|---|---|
| Language | TypeScript | Type safety, better maintainability |
| Runtime | Node.js | Cross-platform, familiar ecosystem |
| CLI Framework | Commander.js | Industry standard, excellent DX |
| Prompts | @clack/prompts | Beautiful, modern interactive prompts |
| File Ops | fs-extra | Robust filesystem utilities |
| Styling | picocolors | Fast, lightweight terminal colors |
| Tree View | Custom / tree-cli | Display template structure |
| Diff | diff | Show changes when updating templates |
| Glob | fast-glob | Fast file pattern matching |
| GitHub API | Octokit (optional) | For GitHub import feature |
| Command | Description |
|---|---|
brick init |
Initialize CodeBrick in the system |
brick save <name> [path] |
Create a new LOCAL template from files |
brick apply <name> [destination] |
Apply template to current/specified directory |
brick list |
List all saved templates (local & remote) |
brick tree <name> |
Display template file structure |
brick info <name> |
Show detailed template information |
brick add <name> <files...> |
Add files to an existing LOCAL template |
brick remove-file <name> <files...> |
Remove files from a LOCAL template |
brick delete <name> |
Delete a template entirely |
brick update <name> [path] |
Update LOCAL template from source |
brick clone <name> <new-name> |
Duplicate a template |
brick export <name> [output] |
Export template as .brick archive |
brick import <file> |
Import template from .brick archive |
| Command | Description |
|---|---|
brick auth <token> |
Authenticate with GitHub PAT |
brick link <name> <github-url> |
Create a REMOTE template linked to GitHub |
brick unlink <name> |
Remove a remote template link |
brick refresh <name> |
Update remote template to latest commit |
brick pull <name> |
Convert remote template to local (download) |
Commands: brick init, brick save, brick list
Initializes the CodeBrick storage structure.
brick initBehavior:
- Creates
~/.codebrick/directory structure - Initializes empty
store.jsonandconfig.json - Displays welcome message with quick start guide
Output:
β CodeBrick initialized successfully!
Storage location: ~/.codebrick/
Quick Start:
brick save my-auth ./src/auth Save a template
brick list View all templates
brick apply my-auth Apply to current project
Creates a new template from local files.
# Save current directory as template
brick save nestjs-auth
# Save specific path as template
brick save nestjs-auth ./src/auth
# Save with description
brick save nestjs-auth ./src/auth --description "JWT auth module"
# Save with tags
brick save nestjs-auth ./src/auth --tags auth,jwt,nestjsOptions:
| Flag | Description |
|---|---|
--description |
Template description |
--tags |
Comma-separated tags for organization |
--include |
Glob patterns to include (default: all) |
--exclude |
Glob patterns to exclude |
--detect-deps |
Auto-detect dependencies from imports |
Behavior:
- Validate path exists
- Prompt for confirmation if template name already exists
- Copy all files to
~/.codebrick/templates/<name>/ - Scan files for dependencies (if
--detect-deps) - Generate
brick.jsonmetadata - Update
store.jsonregistry - Display success with file count
Output:
β Saving template: nestjs-auth
β
β Source: /Users/dev/projects/my-backend/src/auth
β Files: 5 files, 2 directories
β
β Detected dependencies:
β @nestjs/jwt, @nestjs/passport, passport-jwt, bcrypt
β
β Add these to template metadata? (Y/n)
β
β β Template 'nestjs-auth' saved successfully!
View structure: brick tree nestjs-auth
Apply template: brick apply nestjs-auth
Lists all saved templates (both local and remote).
brick list
# Filter by tag
brick list --tag auth
# Filter by type
brick list --local # Only local templates
brick list --remote # Only remote templates
# Show detailed view
brick list --detailedOutput (Default):
βββββββββββββββββββ¬βββββββββ¬βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββ
β Name β Type β Description β Files β
βββββββββββββββββββΌβββββββββΌβββββββββββββββββββββββββββββββββββββΌββββββββββββββ€
β nestjs-auth β local β JWT authentication module β 5 files β
β react-modal β local β Reusable modal component β 3 files β
β company-starter β remote β Company NestJS starter template β 8 files β
β oss-hooks β remote β Collection of React hooks β 12 files β
βββββββββββββββββββ΄βββββββββ΄βββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ
Total: 4 templates (2 local, 2 remote)
Output (Detailed):
LOCAL TEMPLATES
βββββββββββββββ
nestjs-auth
Type: local
Description: JWT authentication module
Files: 5 files, 2 directories
Tags: auth, jwt, nestjs
Created: 2026-01-11
Updated: 2026-01-11
react-modal
Type: local
Description: Reusable modal component
Files: 3 files
Tags: react, modal, ui
Created: 2026-01-10
Updated: 2026-01-10
REMOTE TEMPLATES (GitHub)
βββββββββββββββββββββββββ
company-starter
Type: remote
Source: github:mycompany/templates/nestjs-starter
Ref: main @ a1b2c3d4
Description: Company NestJS starter template
Tags: nestjs, starter, company
Linked: 2026-01-08
oss-hooks
Type: remote
Source: github:awesome-dev/react-utils/src/hooks
Ref: v2.1.0
Description: Collection of React hooks
Tags: react, hooks, utils
Linked: 2026-01-05
Total: 4 templates (2 local, 2 remote)
Commands: brick apply, brick tree, brick info
Applies a template to the current or specified directory.
# Apply to current directory
brick apply nestjs-auth
# Apply to specific path
brick apply nestjs-auth ./src/auth
# Apply with options
brick apply nestjs-auth --force --latestOptions:
| Flag | Description |
|---|---|
--force |
Overwrite existing files without prompting |
--skip-existing |
Skip files that already exist |
--dry-run |
Preview changes without writing files |
--latest |
Use @latest for all dependency versions |
--no-deps |
Don't prompt for dependency installation |
Interactive Flow:
β Applying template: nestjs-auth
β
β Destination: ./src/auth
β
β 5 files will be created:
β βββ auth.module.ts
β βββ auth.service.ts
β βββ auth.controller.ts
β βββ guards/jwt.guard.ts
β βββ strategies/jwt.strategy.ts
β
β Dependency versions:
β
β This template requires the following dependencies:
β
β βββββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββββ
β β Package β Template Ver β Action β
β βββββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββββ€
β β @nestjs/jwt β ^10.0.0 β install β
β β @nestjs/passport β ^10.0.0 β install β
β β passport-jwt β ^4.0.0 β install β
β β bcrypt β ^5.1.0 β install β
β βββββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββββ
β
β How would you like to handle versions?
β β Use template versions (recommended)
β β Use @latest for all packages
β β Specify versions manually
β β Skip dependency installation
β
β Proceed with installation? (Y/n)
β
β Creating files...
β β Created auth.module.ts
β β Created auth.service.ts
β β Created auth.controller.ts
β β Created guards/jwt.guard.ts
β β Created strategies/jwt.strategy.ts
β
β β Template applied successfully!
Run: npm install (to install dependencies)
Displays the file structure of a template.
brick tree nestjs-auth
# Show file sizes
brick tree nestjs-auth --size
# Show with content preview
brick tree nestjs-auth --previewOutput:
nestjs-auth
βββ brick.json
βββ auth.module.ts
βββ auth.service.ts
βββ auth.controller.ts
βββ guards/
β βββ jwt.guard.ts
βββ strategies/
βββ jwt.strategy.ts
5 files, 2 directories
Output (with --size):
nestjs-auth (12.4 KB)
βββ brick.json (0.8 KB)
βββ auth.module.ts (1.2 KB)
βββ auth.service.ts (3.1 KB)
βββ auth.controller.ts (2.8 KB)
βββ guards/
β βββ jwt.guard.ts (1.9 KB)
βββ strategies/
βββ jwt.strategy.ts (2.6 KB)
5 files, 2 directories, 12.4 KB total
Shows detailed information about a template.
brick info nestjs-authOutput:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β nestjs-auth β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Description: JWT authentication module for NestJS β
β Version: 1.0.0 β
β Created: 2026-01-11 10:30 AM β
β Updated: 2026-01-11 02:20 PM β
β β
β Source: /Users/dev/projects/my-backend/src/auth β
β Storage: ~/.codebrick/templates/nestjs-auth β
β β
β Tags: auth, jwt, nestjs, security β
β β
β Files: 5 files, 2 directories β
β β
β Dependencies: β
β @nestjs/jwt ^10.0.0 β
β @nestjs/passport ^10.0.0 β
β passport-jwt ^4.0.0 β
β bcrypt ^5.1.0 β
β β
β Dev Dependencies: β
β @types/passport-jwt ^3.0.0 β
β @types/bcrypt ^5.0.0 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Commands:
brick tree nestjs-auth View file structure
brick apply nestjs-auth Apply to project
brick add nestjs-auth Add files to template
Commands: brick add, brick remove-file, brick update, brick clone
Adds files to an existing template.
# Add single file
brick add nestjs-auth ./src/auth/dto/login.dto.ts
# Add multiple files
brick add nestjs-auth ./src/auth/dto/*.ts
# Add entire directory
brick add nestjs-auth ./src/auth/decorators/Output:
β Adding files to: nestjs-auth
β
β Files to add:
β βββ dto/login.dto.ts
β βββ dto/register.dto.ts
β βββ decorators/current-user.decorator.ts
β
β Confirm adding 3 files? (Y/n)
β
β β Added dto/login.dto.ts
β β Added dto/register.dto.ts
β β Added decorators/current-user.decorator.ts
β
β β Template updated! (8 files total)
Removes files from a template.
# Remove single file
brick remove-file nestjs-auth auth.controller.ts
# Remove multiple files
brick remove-file nestjs-auth dto/login.dto.ts dto/register.dto.ts
# Remove directory
brick remove-file nestjs-auth decorators/Output:
β Removing files from: nestjs-auth
β
β Files to remove:
β βββ auth.controller.ts
β
β Confirm removing 1 file? (Y/n)
β
β β Removed auth.controller.ts
β
β β Template updated! (4 files remaining)
Updates a template from its source or a new path.
# Update from original source (if tracked)
brick update nestjs-auth
# Update from new path
brick update nestjs-auth ./src/auth
# Preview changes without applying
brick update nestjs-auth --dry-runOutput:
β Updating template: nestjs-auth
β
β Source: /Users/dev/projects/my-backend/src/auth
β
β Changes detected:
β
β Modified:
β βββ auth.service.ts (15 lines changed)
β βββ guards/jwt.guard.ts (3 lines changed)
β
β Added:
β βββ dto/refresh-token.dto.ts (new file)
β
β Removed:
β βββ (none)
β
β Apply these changes? (Y/n)
β
β β Updated auth.service.ts
β β Updated guards/jwt.guard.ts
β β Added dto/refresh-token.dto.ts
β
β β Template 'nestjs-auth' updated!
Duplicates a template.
brick clone nestjs-auth nestjs-auth-v2Output:
β Template 'nestjs-auth' cloned to 'nestjs-auth-v2'
Edit the clone: brick tree nestjs-auth-v2
Commands: brick export, brick import, brick auth
Exports a template as a shareable .brick archive.
# Export to current directory
brick export nestjs-auth
# Export to specific path
brick export nestjs-auth ./exports/nestjs-auth.brick
# Export all templates
brick export --all ./backup/Output:
β Exported 'nestjs-auth' to ./nestjs-auth.brick (15.2 KB)
Share this file with your team or import on another machine:
brick import nestjs-auth.brick
Imports a template from a .brick archive or GitHub.
# Import from file
brick import ./nestjs-auth.brick
# Import from GitHub (requires auth)
brick import github:username/repo/path/to/folder
# Import with custom name
brick import ./nestjs-auth.brick --name my-authOutput:
β Importing template
β
β Source: ./nestjs-auth.brick
β Name: nestjs-auth
β Files: 5 files, 2 directories
β
β Template 'nestjs-auth' already exists. What would you like to do?
β β Overwrite existing template
β β Import as 'nestjs-auth-2'
β β Cancel import
β
β β Imported as 'nestjs-auth-2'
Authenticates with GitHub for remote imports.
brick auth ghp_xxxxxxxxxxxxOutput:
β Authenticated as @username
You can now import templates from GitHub:
brick import github:username/repo/path
Commands: brick delete, brick rename, brick edit
Deletes a template entirely.
brick delete nestjs-auth
# Skip confirmation
brick delete nestjs-auth --forceOutput:
β Delete template 'nestjs-auth'?
β
β This will permanently remove:
β - 5 files
β - All metadata
β
β Type 'nestjs-auth' to confirm:
β
β β Template 'nestjs-auth' deleted
Commands: brick link, brick unlink, brick refresh, brick pull
Creates a remote template linked to a GitHub repository path.
# Link to a specific path in a repo (uses default branch)
brick link company-auth github:mycompany/templates/nestjs-auth
# Link with specific branch
brick link company-auth github:mycompany/templates/nestjs-auth --ref main
# Link with specific tag
brick link company-auth github:mycompany/templates/nestjs-auth --ref v2.0.0
# Link with specific commit (pinned)
brick link company-auth github:mycompany/templates/nestjs-auth --commit a1b2c3d4
# Full URL format also supported
brick link oss-hooks https://github.com/awesome-dev/react-utils/tree/main/src/hooksOptions:
| Flag | Description |
|---|---|
--ref |
Branch or tag to track (default: main) |
--commit |
Pin to specific commit SHA |
--description |
Template description |
--tags |
Comma-separated tags |
Output:
β Linking remote template: company-auth
β
β Repository: mycompany/templates
β Path: nestjs-auth
β Ref: main
β
β Fetching repository info...
β
β Files found: 6 files, 2 directories
β Latest commit: a1b2c3d4 (2 days ago)
β
β Link this template? (Y/n)
β
β β Remote template 'company-auth' linked!
View structure: brick tree company-auth
Apply template: brick apply company-auth
Removes a remote template link (does not affect GitHub).
brick unlink company-authOutput:
β Remote template 'company-auth' unlinked
Updates a remote template reference to the latest commit.
# Refresh to latest commit on tracked branch/tag
brick refresh company-auth
# Refresh all remote templates
brick refresh --allOutput:
β Refreshing: company-auth
β
β Current commit: a1b2c3d4 (5 days ago)
β Latest commit: e5f6g7h8 (1 hour ago)
β
β Changes:
β + 2 files added
β ~ 3 files modified
β
β Update reference? (Y/n)
β
β β Template 'company-auth' refreshed to e5f6g7h8
Converts a remote template to a local template by downloading all files.
# Pull remote to local (keeps same name)
brick pull company-auth
# Pull with new name
brick pull company-auth --as my-local-authOutput:
β Pulling remote template: company-auth
β
β Source: github:mycompany/templates/nestjs-auth
β Commit: a1b2c3d4
β
β Downloading 6 files...
β
β β Downloaded auth.module.ts
β β Downloaded auth.service.ts
β β Downloaded auth.controller.ts
β β Downloaded guards/jwt.guard.ts
β β Downloaded strategies/jwt.strategy.ts
β β Downloaded brick.json
β
β Keep remote link as well? (y/N)
β
β β Template 'company-auth' is now local!
This template is now fully mutable.
Add files: brick add company-auth <files>
Remove files: brick remove-file company-auth <files>
When you run brick apply, the behavior differs based on template type:
Local Template:
β Reading files from ~/.codebrick/templates/nestjs-auth/
β Files copied instantly (no network)
Remote Template:
β Fetching files from GitHub...
β Repository: mycompany/templates
β Path: nestjs-auth
β Commit: a1b2c3d4
β Downloading 6 files...
β Files applied successfully
| ID | Requirement |
|---|---|
| FR-01 | Save local directories as templates (files on disk) |
| FR-02 | Apply templates to projects with file conflict handling |
| FR-03 | List all templates with filtering and search |
| FR-04 | Display template structure in tree format |
| FR-05 | Show detailed template information and metadata |
| FR-06 | Add files to existing local templates |
| FR-07 | Remove files from local templates |
| FR-08 | Update local templates from source with diff preview |
| FR-09 | Clone/duplicate templates |
| FR-10 | Export templates as shareable archives |
| FR-11 | Import templates from archives |
| ID | Requirement |
|---|---|
| FR-12 | Link templates to GitHub repository paths |
| FR-13 | Fetch files on-demand when applying remote templates |
| FR-14 | Support branch, tag, or commit pinning |
| FR-15 | Refresh remote templates to latest commit |
| FR-16 | Pull remote templates to convert to local |
| FR-17 | Authenticate with GitHub for private repositories |
| ID | Requirement |
|---|---|
| FR-18 | Manage dependency versions when applying templates |
| FR-19 | Auto-detect dependencies from file imports |
| FR-20 | Support @latest or specific version selection |
| ID | Requirement |
|---|---|
| NFR-01 | Template save/apply operations < 2 seconds |
| NFR-02 | Support templates up to 100MB |
| NFR-03 | Framework-agnostic β works with any file type |
| NFR-04 | Beautiful, colorized CLI output |
| NFR-05 | Graceful error handling with actionable messages |
| NFR-06 | No network required for local operations |
| NFR-07 | Cross-platform support (macOS, Linux, Windows) |
| NFR-08 | Secure storage with appropriate file permissions |
| ID | Story |
|---|---|
| US-01 | As a developer, I want to save code from my existing project as a reusable template |
| US-02 | As a developer, I want to apply templates to new projects without manual copy-paste |
| US-03 | As a developer, I want to see what files are in a template before applying it |
| US-04 | As a developer, I want to add or remove files from templates without affecting source |
| US-05 | As a developer, I want to control dependency versions when applying templates |
| US-06 | As a developer, I want to share templates with my team via exportable files |
| ID | Story |
|---|---|
| US-07 | As a developer, I want to link templates to GitHub repos so my team stays in sync |
| US-08 | As a developer, I want to pin templates to specific versions/commits for stability |
| US-09 | As a developer, I want to refresh remote templates to get the latest changes |
| US-10 | As a developer, I want to convert a remote template to local for customization |
| US-11 | As a developer, I want to use templates from private GitHub repos with authentication |
| ID | Story |
|---|---|
| US-12 | As a developer, I want templates to work with any framework or language |
| US-13 | As a developer, I want to preview changes before applying or updating templates |
| US-14 | As a developer, I want to organize templates with tags and descriptions |
| US-15 | As a developer, I want to choose between local storage or GitHub remote per template |
| Scenario | Message |
|---|---|
| Template not found | Error: Template 'xyz' not found. Run 'brick list' to see available templates. |
| Source path not found | Error: Path './src/auth' does not exist. |
| Template already exists | Warning: Template 'xyz' already exists. Use --force to overwrite. |
| File conflict on apply | Conflict: 'auth.ts' already exists. [overwrite / skip / diff / cancel] |
| Invalid .brick file | Error: Invalid archive. File may be corrupted. |
| GitHub auth required | Error: GitHub import requires authentication. Run 'brick auth <token>' |
| Empty template | Error: Cannot save empty template. No files found in path. |
| Feature | Description |
|---|---|
| Template Variables | Support {{projectName}}, {{author}} placeholders in files |
| Post-Apply Hooks | Run custom scripts after template application |
| Template Inheritance | Create templates that extend other templates |
| Version History | Track changes to templates over time with rollback |
| Cloud Sync | Sync templates across machines via cloud storage |
| Team Workspaces | Shared template registries for teams |
| AI Generation | Generate templates from natural language descriptions |
| IDE Extensions | VS Code / Cursor extensions for GUI management |
brick init- Initialize storagebrick save- Create local templatesbrick list- View templates (local)brick tree- View structurebrick apply- Apply local templatesbrick info- Template details
brick add- Add files to local templatesbrick remove-file- Remove files from local templatesbrick update- Update from sourcebrick delete- Delete templatesbrick clone- Duplicate templates
brick export- Export as .brick archivebrick import- Import from archive- Dependency version management (@latest vs pinned)
brick auth- GitHub authenticationbrick link- Create remote template linksbrick unlink- Remove remote linksbrick refresh- Update to latest commitbrick pull- Convert remote to local- Apply remote templates (fetch on-demand)
- Initialize TypeScript project with Commander.js
- Implement storage layer (
~/.codebrick/structure) - Build
brick init,brick save,brick list(local templates) - Add
brick tree,brick apply,brick info - Implement local template modification commands
- Add export/import functionality
- Implement GitHub authentication
- Add remote template commands (
link,refresh,pull) - Write comprehensive tests
- Publish to npm as
brick-cli
- Commander.js: https://github.com/tj/commander.js
- @clack/prompts: https://github.com/natemoo-re/clack
- fs-extra: https://github.com/jprichardson/node-fs-extra