A command-line tool to create a project directory structure based on a YAML file.
This CLI allows users to generate a predefined directory structure and files for a project using a simple YAML configuration. Users can either create the structure in the current directory or specify a root directory name to create the structure within.
- Create a directory structure and files based on a YAML configuration file.
- Option to create the project structure in the current directory.
- Specify a project root name when creating the structure.
- Go (version 1.16 or later) installed on your machine.
-
Clone the repository:
git clone [email protected]:johnretsas/structure.git cd structure
-
Build the binary:
go build -o structure
Run the CLI with the following command:
./structure [flags]
-
--here
Create the project structure directly in the current directory, ignoring the project root. -
--project-root <name>
Specify the name for the project root directory. This flag is required if--here
is not specified. -
--structure <filename>
Specify the YAML file containing the project structure (default isstructure.yaml
).
-
Create a project structure in the current directory:
./structure --here
-
Create a project structure with a specified project root:
./structure --project-root my_project
The YAML file should define the directory and file structure. Here is an example:
project:
main.go: file
pkg:
utils.go: file
helpers.go: file
cmd:
myapp.go: file
internal:
db:
connection.go: file
api:
handler.go: file
README.md: file
LICENSE: file
- Each item can either be a directory (denoted by a colon at the end of the name) or a file (indicated without a colon).
Contributions are welcome! Please submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for details.