@filearchitect/cli

0.0.6 • Public • Published

@filearchitect/cli

Command-line interface for File Architect - create file and directory structures from text descriptions.

Installation

# Global installation
npm install -g @filearchitect/cli

# Local installation
npm install @filearchitect/cli

Usage

# Create a directory structure from a file
filearchitect create structure.txt output


# Create a structure with file name replacements
filearchitect create structure.txt output --fileReplacements user:admin

# Create a structure with folder name replacements
filearchitect create structure.txt output --folderReplacements api:rest

# Validate a structure file
filearchitect validate structure.txt

# Show help
filearchitect --help

# Show version
filearchitect --version

Structure File Format

# Simple directory structure
src/
  components/
    Button.tsx
    Card.tsx
  styles/
    global.css

# Copy files/directories
config/
  [~/configs/base.json] > base.json   # Copy file
  [~/templates/react/] > template/    # Copy directory

# Move files/directories
src/
  (~/old-project/components/) > components/  # Move directory
  (~/old-project/config.json) > config.json  # Move file

# Replace in file/folder names
src/
  user-profile.tsx     # With --fileReplacements user:admin -> admin-profile.tsx
  api/                 # With --folderReplacements api:rest -> rest/

Options

  • --fileReplacements <pattern>: Replace text in file names (e.g. --fileReplacements user:admin)
  • --folderReplacements <pattern>: Replace text in folder names (e.g. --folderReplacements api:rest)
  • -h, --help: Show help message
  • -v, --version: Show version

Local Development

  1. Clone and navigate to the repository:
git clone https://github.com/filearchitect/filearchitect.git
cd filearchitect
  1. Install dependencies:
pnpm install
  1. Build the packages:
pnpm build
  1. Use the CLI locally:
# Using the root package script
pnpm cli create structure.txt output

# Link globally
cd packages/cli
pnpm link --global
filearchitect create structure.txt output

# Run directly
node dist/cli.js create structure.txt output

Related Packages

Readme

Keywords

none

Package Sidebar

Install

npm i @filearchitect/cli

Weekly Downloads

13

Version

0.0.6

License

none

Unpacked Size

176 kB

Total Files

52

Last publish

Collaborators

  • seblavoie