Package: devi-cli
devidevi is a cli tool for managing your project templatesWithdeviyou can create, use, reuse and manage your project templates.Usagedevi<command>[options]Available commands:add- Add a new template to your listcreate- Create a new project from a templatelist- List available templatesrm- remove a template$DEVI_TEMPLATESis the special directory wheredevistores your templates.
By default is set to~/.templates, but it is customizable to easy migrate
your existing templates!CommandsAdd a new templateTheaddcommand adds a new template to$DEVI_TEMPLATES.deviadd<path>[<template_name>]deviadd.my_new_template# if template_name is not provided, devi will use the directory namedeviadd~/dev/my_templateCreate a new project from a templateThecreatecommand creates a new project from an existing template.devicreate<template_name>[<destination>][--name=<project-name>]# or with syntactic sugar:devicreate<template_name>as<project_name>in<destination># this will create a new dir called "my_template"devicreatemy_template.# don't worry, you can give it a namedevicreatemy_template.--name=my_project# equivalent to the following:devicreatemy_templateasmy_projectin.Do you want more customization? we catch you!Both parameters (project-nameanddestination) are optional. If not set,deviwill use the values defined in thetemplate.devi.toml(seetemplate config).Viewing and removing your templatesTo see the list of available templates, rundevi list. They are located on$DEVI_TEMPLATES.Don't want a template anymore? Remove it withdevirm<template-name>[-y]It will ask you to confirm the deletion, you can skip this with the-yflag.Devi's templates$DEVI_TEMPLATESis special, the place wheredevifinds and stores all your
templates. By default is set to~/.templatesor%USERPROFILE%\templateson Windows.If you already have a templates folder or you want to make your templates more
accesible, you can override it, e.g, for bash:echo"export DEVI_TEMPLATES=~/my/templates">>~/.bashrcTODO:configuration file for devi is not ready yetTemplate configuration fileThetemplate.devi.tomlfile is used to customize the template. It isautocreatedbydevi. Here is an example of a template for web projects:description='my template for web projects'default_name='new-project'destination='~/projects/web'oncreate='npm init -y && npm install vite && npm run dev'change_dir=truedescription- it will be shown ondevi list(default:None).default_name- devi will use this name as default fordevi create(default: the template's name).destination- the destination directory where the project will be created in
(default:".").oncreate- a shell command that will be executed after the project has been
created. Commands will be relative to the newly created template
(default:None).change_dir- wheter you want to change your directory to the newly created
template or not (default:true)Afteroncreatefinishes its execution, all the files and directories with the*.devi.*extension will be removed from the project. e.g.:whatever.devi.sh,my_dir.devi/, and thetemplate.devi.tomlitself.NoteCurrentlychange_diris not implemented for Windows (seeTODO.md)Installationdeviis distributed as apypi packagewhich exposes thedevibinary.pipinstalldevi-cliHowever, sincedeviis just a cli tool, is preferable to install it usingpipx, which will create a separate python environment that won't interfere
with your system's one.pipxinstalldevi-cliIf you don't havepipxalready, gohere, it's
very handy! This will also avoid possibleenvironment errorson most linux distributions.DevelopmentRequires python>= 3.7.# In the root project, install an editable version of devipipinstall-e.# Or just invoque the __main__aliasdevi="python3 devi"