📂 project-structure-cli
A simple CLI tool to generate a project structure tree and save it to project-structure.txt
. It automatically updates the structure every time you run it and supports ignoring specific files and directories.
✨ Features
✅ Generate a project structure tree
✅ Save the structure in project-structure.txt
in the root directory
✅ Supports ignoring specific files and directories
✅ Automatically excludes node_modules and folders/files starting with dot(.) eg: .next .git directory by default
✅ use --include to exclusively include folders which are ignored by default
✅ Works with any project setup
🚀 Installation
Use without installing
Run directly using npx
:
npx project-structure-cli
Install globally (optional)
npm install -g project-structure-cli
Then, you can run:
proj-structure
📌 Usage
Basic Usage (Full Structure)
To generate project-structure.txt
in the root of your project:
npx project-structure-cli
or
proj-structure
Make your own customised project structure
To generate project-structure.txt
along with the folders which are excluded by default
npx project-structure-cli --include .next
Exclude Files/Folders from Structure
You can exclude files and directories by passing them as arguments:
npx project-structure-cli --exclude api .env
or
proj-structure --exclude api .env
📝 Example Output
If your project structure is:
my-project
│── src
│ │── components
│ │ │── Header.tsx
│ │ │── Footer.tsx
│ │── pages
│ │ │── index.tsx
│ │ │── about.tsx
│── public
│ │── favicon.ico
│── package.json
│── tsconfig.json
│── README.md
│── .git
│── node_modules
Running
npx project-structure-cli --exclude public
or
npx project-structure-cli
will generate project-structure.txt
as:
my-project
├── src
│ ├── components
│ │ ├── Header.tsx
│ │ ├── Footer.tsx
│ ├── pages
│ │ ├── index.tsx
│ │ ├── about.tsx
├── package.json
├── tsconfig.json
└── README.md
(.git
and node_modules
are excluded)
🛠 Development
-
Clone the repo:
git clone https://github.com/anups1ngh/project-structure-generator.git
cd project-structure-generator
-
Install dependencies:
npm install
-
Test locally:
node index.js
-
Link the package globally for local testing:
npm link
proj-structure
📦 Publishing to npm
To publish the package:
npm login
npm publish
🔗 License
This project is licensed under the MIT License (soon will be open Source).
Reach out to developer
Anup Kumar Singh
anupsingh.work@gmail.com