Name | devi-cli JSON |
Version |
0.2.1
JSON |
| download |
home_page | |
Summary | devi is a cli tool for managing your project templates |
upload_time | 2023-03-18 20:19:48 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.7 |
license | |
keywords |
templates
project
cli tool
organization
productivity
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<h1 align="center">devi</h1>
</p>
<p align="center">
<code>devi is a cli tool for managing your project templates</code>
</p>
<p align="center">
<img src="https://img.shields.io/badge/pipx%20install-devi--cli-blue"/>
<img src="https://shields.io/pypi/v/devi-cli"/>
<img src="https://shields.io/pypi/l/devi-cli"/>
</p>
With `devi` you can create, use, reuse and manage your project templates.
## Usage
<div align="justify">
<div align="center">
```bash
devi <command> [options]
```
</div>
</div>
Available commands:
- `add` - Add a new template to your list
- `create` - Create a new project from a template
- `list` - List available templates
- `rm` - 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
<!-- here might be a showcase video -->
### Add a new template
The `add` command adds a new template to `$DEVI_TEMPLATES`.
```bash
devi add <path> [<template_name>]
```
```bash
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.
<!-- Aliases: `new`, `n`-->
```bash
devi create <template_name> [<destination>] [--name=<project-name>]
# or with syntactic sugar:
devi create <template_name> as <project_name> in <destination>
```
```bash
# 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](#template-configuration-file)).
## 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
```bash
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:
```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:
```toml
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 on `devi list` (default: `None`).
- `default_name` - devi will use this name as default for `devi 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_dir` is not implemented for Windows (see [TODO.md](./TODO.md))
## Installation
`devi` is distributed as a [pypi package](https://pypi.org/project/devi-cli/)
which exposes the `devi` binary.
```bash
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.
```bash
pipx install devi-cli
```
If you don't have `pipx` already, go [here](https://pypa.github.io/pipx/), it's
very handy! This will also avoid possible [environment errors](https://github.com/python/cpython/issues/102134) on most linux distributions.
## Development
Requires python `>= 3.7`.
```bash
# In the root project, install an editable version of devi
pip install -e .
# Or just invoque the __main__
alias devi="python3 devi"
```
Raw data
{
"_id": null,
"home_page": "",
"name": "devi-cli",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "templates,project,cli tool,organization,productivity",
"author": "",
"author_email": "Paolo Flores <paolo.flores2@unmsm.edu.pe>",
"download_url": "https://files.pythonhosted.org/packages/ee/f5/14f97b71a3c6e1e27a5d7525efd5ae93a8af8b6c5cf4e5e3b4f10ec6b01f/devi-cli-0.2.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <h1 align=\"center\">devi</h1>\n</p>\n<p align=\"center\">\n <code>devi is a cli tool for managing your project templates</code>\n</p>\n\n<p align=\"center\">\n<img src=\"https://img.shields.io/badge/pipx%20install-devi--cli-blue\"/>\n<img src=\"https://shields.io/pypi/v/devi-cli\"/>\n<img src=\"https://shields.io/pypi/l/devi-cli\"/>\n</p>\n\nWith `devi` you can create, use, reuse and manage your project templates.\n\n## Usage\n\n<div align=\"justify\">\n<div align=\"center\">\n\n```bash\ndevi <command> [options]\n```\n\n</div>\n</div>\n\nAvailable commands:\n\n- `add` - Add a new template to your list\n- `create` - Create a new project from a template\n- `list` - List available templates\n- `rm` - remove a template\n\n`$DEVI_TEMPLATES` is the special directory where `devi` stores your templates.\nBy default is set to `~/.templates`, but it is customizable to easy migrate\nyour existing templates!\n\n---\n\n## Commands\n\n<!-- here might be a showcase video -->\n\n### Add a new template\n\nThe `add` command adds a new template to `$DEVI_TEMPLATES`.\n\n```bash\ndevi add <path> [<template_name>]\n```\n\n```bash\ndevi add . my_new_template\n\n# if template_name is not provided, devi will use the directory name\ndevi add ~/dev/my_template\n```\n\n### Create a new project from a template\n\nThe `create` command creates a new project from an existing template.\n\n<!-- Aliases: `new`, `n`-->\n\n```bash\ndevi create <template_name> [<destination>] [--name=<project-name>]\n\n# or with syntactic sugar:\ndevi create <template_name> as <project_name> in <destination>\n```\n```bash\n# this will create a new dir called \"my_template\"\ndevi create my_template .\n# don't worry, you can give it a name\ndevi create my_template . --name=my_project\n# equivalent to the following:\ndevi create my_template as my_project in .\n```\n\nDo you want more customization? we catch you!\n\nBoth parameters (`project-name` and `destination`) are optional. If not set,\n`devi` will use the values defined in the `template.devi.toml` (see\n[template config](#template-configuration-file)).\n\n## Viewing and removing your templates\n\nTo see the list of available templates, run `devi list`. They are located on\n`$DEVI_TEMPLATES`.\n\nDon't want a template anymore? Remove it with\n\n```bash\ndevi rm <template-name> [-y]\n```\n\nIt will ask you to confirm the deletion, you can skip this with the `-y` flag.\n\n## Devi's templates\n\n`$DEVI_TEMPLATES` is special, the place where `devi` finds and stores all your\ntemplates. By default is set to `~/.templates` or\n`%USERPROFILE%\\templates` on Windows.\n\nIf you already have a templates folder or you want to make your templates more\naccesible, you can override it, e.g, for bash:\n\n```bash\necho \"export DEVI_TEMPLATES=~/my/templates\" >> ~/.bashrc\n```\n\n`TODO:` configuration file for devi is not ready yet\n\n### Template configuration file\n\nThe `template.devi.toml` file is used to customize the template. It is\n**autocreated** by `devi`. Here is an example of a template for web projects:\n\n```toml\ndescription = 'my template for web projects'\ndefault_name = 'new-project'\ndestination = '~/projects/web'\noncreate = 'npm init -y && npm install vite && npm run dev'\nchange_dir = true\n```\n\n- `description` - it will be shown on `devi list` (default: `None`).\n- `default_name` - devi will use this name as default for `devi create`\n (default: the template's name).\n- `destination` - the destination directory where the project will be created in\n (default: `\".\"`).\n- `oncreate` - a shell command that will be executed after the project has been\n created. Commands will be relative to the newly created template\n (default: `None`).\n- `change_dir` - wheter you want to change your directory to the newly created\n template or not (default: `true`)\n\nAfter `oncreate` finishes its execution, all the files and directories with the\n`*.devi.*` extension will be removed from the project. e.g.:\n`whatever.devi.sh`, `my_dir.devi/`, and the `template.devi.toml` itself.\n\n> **Note**\n> Currently `change_dir` is not implemented for Windows (see [TODO.md](./TODO.md))\n\n## Installation\n\n`devi` is distributed as a [pypi package](https://pypi.org/project/devi-cli/)\nwhich exposes the `devi` binary.\n\n```bash\npip install devi-cli\n```\n\nHowever, since `devi` is just a cli tool, is preferable to install it using\n`pipx`, which will create a separate python environment that won't interfere\nwith your system's one.\n\n```bash\npipx install devi-cli\n```\n\nIf you don't have `pipx` already, go [here](https://pypa.github.io/pipx/), it's\nvery handy! This will also avoid possible [environment errors](https://github.com/python/cpython/issues/102134) on most linux distributions.\n\n## Development\n\nRequires python `>= 3.7`.\n\n```bash\n# In the root project, install an editable version of devi\npip install -e .\n# Or just invoque the __main__\nalias devi=\"python3 devi\"\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "devi is a cli tool for managing your project templates",
"version": "0.2.1",
"split_keywords": [
"templates",
"project",
"cli tool",
"organization",
"productivity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f37727790430fd2c2839210cbe5be05355541d24a5418c8342c9313ef6bd633f",
"md5": "d4d4fbc28017d6b2af90fa873d9520bd",
"sha256": "902bb87b0498d06fe29d226ffd1c8f98ea02e4005b45d2092998517941688bae"
},
"downloads": -1,
"filename": "devi_cli-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d4d4fbc28017d6b2af90fa873d9520bd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 14752,
"upload_time": "2023-03-18T20:19:47",
"upload_time_iso_8601": "2023-03-18T20:19:47.114707Z",
"url": "https://files.pythonhosted.org/packages/f3/77/27790430fd2c2839210cbe5be05355541d24a5418c8342c9313ef6bd633f/devi_cli-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eef514f97b71a3c6e1e27a5d7525efd5ae93a8af8b6c5cf4e5e3b4f10ec6b01f",
"md5": "430c826a343d7c98007bbf8e25f8fc1a",
"sha256": "588c9db0e2ea857932ab41aeaa0d8a1dc779fff2f5b2f37eaa125874d928d962"
},
"downloads": -1,
"filename": "devi-cli-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "430c826a343d7c98007bbf8e25f8fc1a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 13418,
"upload_time": "2023-03-18T20:19:48",
"upload_time_iso_8601": "2023-03-18T20:19:48.958969Z",
"url": "https://files.pythonhosted.org/packages/ee/f5/14f97b71a3c6e1e27a5d7525efd5ae93a8af8b6c5cf4e5e3b4f10ec6b01f/devi-cli-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-18 20:19:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "devi-cli"
}