templeme
v0.0.7
Published
A CLI tool to generate code structure templates
Readme
TempleMe
Create your code temples (base and sacred folder and file templates that you need to repeat across the entire project) and share them!
CLI for creating your code temples, base structures that should be repeated across the project
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
init Create a new templeme folder
create [name] Create a new templeme
list Lists all available temples
copy [options] [source] [destination] [name]
help [command] display help for commandSee it in action
https://github.com/user-attachments/assets/acd3d850-8617-40c8-af14-a4c1971bedd9
How to install
# For NPM:
npm i templeme -g
# For Yarn:
yarn i templeme -g
# For PNPM:
pnpm i templeme -gHow to use
First, you need to initialize TempleMe with the following command. It will create a .templeme folder at the root of your project.
# Initializes .temples folder in your project
templeme initAfter that, you can create your first template by running:
# Create your first temple
templeme create react-componentWith you template created, you can edit the files inside .templeme/react-component and add your code structure. Here's a exemple file:
// .templeme/react-component/placeholder-value.component.tsx
export type PlaceholderValueProps = {};
export const PlaceholderValue = (props: PlaceholderValueProps) => (
<div>Hello from Placeholder Value Component!</div>
);This means that, when you want to create your component from react-component template, everywhere that TempleMe finds PlaceholderValue, it will replace with your component name, keeping the casing.
So, if you run now:
# Replicate your temples into your project easily
# Anywhere in your file name or contents that TempleMe finds "Placeholder Value", it will replace to "Button", keeping the casing
templeme copy react-component src/components/ui cool-buttonYou will see that a new file will be created, like this:
// src/components/ui/cool-button.component.tsx
export type CoolButtonProps = {};
export const CoolButton = (props: CoolButtonProps) => (
<div>Hello from Cool Button Component!</div>
);You can put as many files inside your Template as you wish :)
Other useful commands are
# Outputs available commands
templeme help
# Outputs command details
templeme help init|create|list|copy
# Outputs to the terminal the new files instead of creating them
templeme copy react-component src/components/ui/button --dry-run
# Copies only the subfolder of your Temple, instead of the entire code
templeme copy react-component src/components/ui/button --f subfolder
# Copies the temple from a Github Repo and Subfolder
templeme copy [email protected]:githubuser/githubrepo.git src/components/ui/button --f subfolder