Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Structure to Files and FoldersNew to Visual Studio Code? Get it now.
Structure to Files and Folders

Structure to Files and Folders

Cygnuxxs

|
3 installs
| (0) | Free
Adds files and folders with the input string
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Structure to Files and Folders

A VS Code extension that converts text-based folder structures into actual files and folders in your workspace.

Features

  • Quick Structure Generation: Paste any text-based folder structure and instantly create the corresponding files and folders
  • Smart Parsing: Automatically detects files vs folders based on file extensions and trailing slashes
  • Tree Format Support: Works with various tree structure formats including those with tree characters (├, └, │, ─)
  • Comment Filtering: Ignores comments (lines starting with #) in your structure input
  • Workspace Integration: Creates structure directly in your current workspace folder

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Structure to Files and Folders"
  4. Click Install

Usage

  1. Open a workspace folder in VS Code (the extension requires an active workspace)
  2. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  3. Run the command: Type "Create Structure" and select Structure to Files and Folders: Create Structure
  4. Paste your structure: Enter your folder/file structure in the input box
  5. Generate: Press Enter to create the structure in your workspace

Supported Structure Formats

The extension supports various text-based folder structure formats:

Basic Format

src/
  components/
    Header.js
    Footer.js
  utils/
    helpers.js
public/
  index.html
  style.css
package.json
README.md

Tree Format with Characters

├── src/
│   ├── components/
│   │   ├── Header.js
│   │   └── Footer.js
│   └── utils/
│       └── helpers.js
├── public/
│   ├── index.html
│   └── style.css
├── package.json
└── README.md

With Comments

src/
  components/  # React components
    Header.js
    Footer.js
  utils/       # Utility functions
    helpers.js
public/        # Static assets
  index.html
  style.css
package.json   # Dependencies
README.md      # Documentation

How It Works

The extension intelligently parses your input structure:

  • Folders: Identified by trailing slashes (/) or lack of file extensions
  • Files: Identified by file extensions (e.g., .js, .html, .css)
  • Indentation: Uses spaces and tree characters to determine nesting levels
  • Comments: Lines starting with # are ignored
  • Empty Files: Creates empty files that you can populate later

Requirements

  • VS Code 1.74.0 or higher
  • An open workspace folder

Commands

Command Description
Structure to Files and Folders: Create Structure Opens input dialog to create folder/file structure

Error Handling

The extension includes robust error handling:

  • No Workspace: Shows error if no workspace folder is open
  • Empty Input: Validates that input is not empty
  • File System Errors: Catches and displays any file creation errors
  • Invalid Format: Gracefully handles malformed structure input

Examples

React Project Structure

my-react-app/
  src/
    components/
      App.js
      Header.js
      Sidebar.js
    hooks/
      useApi.js
      useAuth.js
    pages/
      Home.js
      About.js
    styles/
      App.css
      globals.css
  public/
    index.html
    favicon.ico
  package.json
  README.md

Node.js API Structure

api/
  controllers/
    userController.js
    authController.js
  middleware/
    auth.js
    validation.js
  models/
    User.js
    Post.js
  routes/
    users.js
    auth.js
  config/
    database.js
    server.js
  package.json
  .env
  server.js

Tips

  • Use consistent indentation (spaces or tabs) for best results
  • Add trailing slashes to folder names to ensure they're recognized as directories
  • Include file extensions to ensure items are created as files, not folders
  • Test with small structures first to verify the format works as expected

Contributing

Found a bug or have a feature request? Please open an issue on our GitHub repository.

License

This extension is licensed under the MIT License. See the LICENSE file for details.

Release Notes

1.0.0

  • Initial release
  • Basic structure generation from text input
  • Support for various tree formats
  • Comment filtering
  • Workspace integration

Enjoy creating your project structures with ease! 🚀

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft