devi is a cli tool for managing your project templates
Project description
devi
devi is a cli tool for managing your project templates
With devi you can create, use, reuse and manage your project templates.
Usage
devi <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_TEMPLATES is the special directory where devi stores your templates.
By default is set to ~/.templates, but it is customizable to easy migrate
your existing templates!
Commands
Add a new template
The add command adds a new template to $DEVI_TEMPLATES.
devi add <path> [<template_name>]
devi add . my_new_template
# if template_name is not provided, devi will use the directory name
devi add ~/dev/my_template
Create a new project from a template
The create command creates a new project from an existing template.
devi create <template_name> [<destination>] [--name=<project-name>]
# or with syntactic sugar:
devi create <template_name> as <project_name> in <destination>
# this will create a new dir called "my_template"
devi create my_template .
# don't worry, you can give it a name
devi create my_template . --name=my_project
# equivalent to the following:
devi create my_template as my_project in .
Do you want more customization? we catch you!
Both parameters (project-name and destination) are optional. If not set,
devi will use the values defined in the template.devi.toml (see
template config).
Viewing and removing your templates
To see the list of available templates, run devi list. They are located on
$DEVI_TEMPLATES.
Don't want a template anymore? Remove it with
devi rm <template-name> [-y]
It will ask you to confirm the deletion, you can skip this with the -y flag.
Devi's templates
$DEVI_TEMPLATES is special, the place where devi finds and stores all your
templates. By default is set to ~/.templates or
%USERPROFILE%\templates on 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" >> ~/.bashrc
TODO: configuration file for devi is not ready yet
Template configuration file
The template.devi.toml file is used to customize the template. It is
autocreated by devi. 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 = true
description- 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)
After oncreate finishes 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 the template.devi.toml itself.
Note Currently
change_diris not implemented for Windows (see TODO.md)
Installation
devi is distributed as a pypi package
which exposes the devi binary.
pip install devi-cli
However, since devi is just a cli tool, is preferable to install it using
pipx, which will create a separate python environment that won't interfere
with your system's one.
pipx install devi-cli
If you don't have pipx already, go here, it's
very handy! This will also avoid possible environment errors on most linux distributions.
Development
Requires python >= 3.7.
# In the root project, install an editable version of devi
pip install -e .
# Or just invoque the __main__
alias devi="python3 devi"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file devi-cli-0.2.1.tar.gz.
File metadata
- Download URL: devi-cli-0.2.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
588c9db0e2ea857932ab41aeaa0d8a1dc779fff2f5b2f37eaa125874d928d962
|
|
| MD5 |
430c826a343d7c98007bbf8e25f8fc1a
|
|
| BLAKE2b-256 |
eef514f97b71a3c6e1e27a5d7525efd5ae93a8af8b6c5cf4e5e3b4f10ec6b01f
|
File details
Details for the file devi_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: devi_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
902bb87b0498d06fe29d226ffd1c8f98ea02e4005b45d2092998517941688bae
|
|
| MD5 |
d4d4fbc28017d6b2af90fa873d9520bd
|
|
| BLAKE2b-256 |
f37727790430fd2c2839210cbe5be05355541d24a5418c8342c9313ef6bd633f
|