# @dworac/cli

> Collection of dworac's CLI tools.

Latest version **2.10.2** (published 2023-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dworac/cli
pnpm add @dworac/cli
yarn add @dworac/cli
bun add @dworac/cli
```

Provides the command `cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.10.2 |
| Published | 2023-07-04 |
| First published | 2023-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dworac |
| Maintainers | dworac |
| Keywords | cli, typescript, dworac |

## Links

- npm: https://www.npmjs.com/package/@dworac/cli
- Repository: https://github.com/dworac/typescript-starter
- Homepage: https://github.com/dworac/typescript-starter#readme
- Issues: https://github.com/dworac/typescript-starter/issues
- npm.io page: https://npm.io/package/@dworac/cli

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [inquirer](https://npm.io/package/inquirer.md) ^9.2.5
- [commander](https://npm.io/package/commander.md) ^10.0.0
- [@dworac/logger](https://npm.io/package/@dworac/logger.md) ^1.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.10.2 (latest) — 2023-07-04
- 2.10.1 — 2023-05-26
- 2.10.0 — 2023-05-25
- 2.9.0 — 2023-05-24
- 2.8.0 — 2023-05-23
- 2.7.0 — 2023-05-19
- 2.6.0 — 2023-05-18
- 2.5.1 — 2023-05-18
- 2.5.0 — 2023-03-10
- 2.4.0 — 2023-03-10
- 2.3.0 — 2023-03-07
- 2.2.0 — 2023-03-06
- 2.1.2 — 2023-03-06
- 2.1.1 — 2023-03-06
- 2.1.0 — 2023-03-06
- … 1 more at https://npm.io/package/@dworac/cli/versions

## README

# @dworac/cli

![npm](https://img.shields.io/npm/v/@dworac/cli)
![npm](https://img.shields.io/npm/dw/@dworac/cli)
![GitHub issues](https://img.shields.io/github/issues/dworac/cli)
![GitHub](https://img.shields.io/github/license/dworac/cli)

This is dworac's CLI tool. It is used to create new projects from several templates and more....

# Usage
This is a command-line tool that generates a new project from a template. You can use it with `npx` or install it globally.

```shell
npx @dworac/cli
```

## Help
In order to get help, you can use the `--help` flag.

```shell
npx @dworac/cli --help
```

## Project generator

In order to obtain a list of available templates, you can use the `list` command.

```shell
npx @dworac/cli templates
```

To create a new project, run the following command:

```shell
npx @dworac/cli create <name> <template>
```

### Options
* -d, --description <string>: The description of the new project.
* -r, --repository <string>: The git repository of the new project.
* -k, --keywords <string>: The keywords of the new project.
* -a, --author <string>: The author of the new project.

## Examples
Generate a new project without options:

```shell
npx @dworac/cli create my-project typescript-lib-node
```

Generate a new project with a description, git repository, keywords, and author:
```shell
npx @dworac/cli create my-project typescript-lib-node -d "My project description" -r "https://github.com/dworac/cli" -k "cli template generator" -a "dworac <mail@dworac.com>"
```

## Developping

In order to develop this project, you can use the following commands:

Install dependencies:
```shell
yarn
```

Run
```shell
yarn start:dev
```

In order to test the project locally you must build it and link it globally, the following command does both things:
```shell
yarn publish:local
```

To test it run the following command:
```shell
npx @dworac/cli
```

To unlink the project, you can use the following command:
```shell
yarn publish:local:unlink
```

## Contributing
If you have any suggestions or improvements, please feel free to create a pull request or submit an issue.

### Add a template

Adding a new template is very simple:

- Create a new folder with the name of the template in the `templates` folder.
- Add a template.json file to your template folder
- If you have any `.gitignore` files rename them to `gitignore`

#### template.json

`template.json` file should be in each one of the templates folder and it should look something like this.

```json
{
  "name": "typescript-api",
  "description": "This template is used to create an express server with typescript, grahpql, typeorm, and postgres.",
  "commands": [
    {
      "name": "yarn",
      "description": "Install dependencies"
    }
  ],
  "secrets": [
    {
      "name": "DIGITALOCEAN_APP_NAME",
      "description": "Name of the digital ocean app the project will be deployed to."
    }
  ]
}
```

This file helps document the template for the cli's output.
All of the properties are optional but recommended: 

```typescript
interface TemplateInfo {
    name: string;
    description?: string;
    commands?: {
        name: string;
        description: string;
    }[]; // Recommended commands, starter commands.
    secrets?: {
        name: string;
        description: string;
    }[]; // Secrets needed for github workflows to work.
}
```


## License
This project is licensed under the MIT license. Please see the LICENSE file for more information.

---
_Source: https://npm.io/package/@dworac/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
