π½οΈ A CLI tool to quickly initialize new projects with custom templates! π¦οΈ
- π§© Create projects from custom templates
- π Define project structure with simple YAML files
- π§ Execute commands as part of the setup process
- π§° Modify JSON files automatically
- π Support for variables within templates
- βοΈ Multiple version formats (v1 and v2)
bun install -g @piarre/idev2
Templates are stored in ~/.ide/
folder. Create this folder if it doesn't exist yet:
mkdir -p ~/.ide
Create a YAML file in the ~/.ide/
directory with your template definition:
# ~/.ide/ts.yml
name: ts
description: Create a TypeScript project
commands:
- "npm init -y"
- "npm i -D typescript @types/node tsup ts-node"
options:
- name: "name"
command: "-n, --name <n>"
description: "Project name"
- name: "git"
command: "-g, --git"
description: "Initialize git repository"
execute:
- "git init"
files:
- path: src/index.ts
content: |
console.log("Hello, {{ name }}!");
- path: tsconfig.json
content: |
{
"compilerOptions": {
"module": "CommonJS",
"target": "ESNext",
"outDir": "./out",
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
# Create a new project in a new directory
ide ts -n my-project
# Create a project in the current directory
cd my-empty-project
ide ts
You can use variables in your templates using the {{ variable }}
syntax. These variables correspond to the options defined in your template.
options:
- name: "username"
command: "-u, --username <username>"
description: "Your username"
files:
- path: README.md
content: |
# Project by {{ username }}
When running the command with -u john
, the template will replace {{ username }}
with john
.
For more detailed documentation, visit ide.piarre.app.
This project is MIT licensed.
Piarre - GitHub