# tg-commander

Latest version **1.0.17** (published 2019-01-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install tg-commander
pnpm add tg-commander
yarn add tg-commander
bun add tg-commander
```

Provides the command `tc`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.17 |
| Published | 2019-01-07 |
| First published | 2019-01-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | stone-jin |
| Keywords | commander, tiger, tiger-commander, cli, node |

## Links

- npm: https://www.npmjs.com/package/tg-commander
- Repository: https://github.com/stone-jin/tg-commander
- Homepage: https://github.com/stone-jin/tg-commander#readme
- Issues: https://github.com/stone-jin/tg-commander/issues
- npm.io page: https://npm.io/package/tg-commander

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^2.19.0
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.12

## 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

- 1.0.17 (latest) — 2019-01-07
- 1.0.16 — 2019-01-07
- 1.0.15 — 2019-01-07
- 1.0.13 — 2019-01-06
- 1.0.12 — 2019-01-06

## README

<p align="center"><img src="https://github.com/stone-jin/tg-commander/raw/master/assets/logo.png" alt="tg-commander logo" width="150px" height="150px"></p>

## tg-commander [![NPM version](https://img.shields.io/npm/v/tg-commander.svg?style=flat-square)](https://npmjs.com/package/tg-commander) [![NPM downloads](https://img.shields.io/npm/dm/tg-commander.svg?style=flat-square)](https://npmjs.com/package/tg-commander)

:dart: A laconic and Convenient tools for commander.

### who use tg-commander?

[Netease](https://www.163.com/)

### Use

example: [](https://github.com/stone-jin/tg-commander-template)

```bash
git clone https://github.com/stone-jin/tg-commander-template.git
npm install
ts-node ./src/index.ts g name

# publish
npm run package
cd publish && npm publish
```

let's see the code.

```typescript
import { Command, TgCommand, TgOptions } from "tg-commander";
import { HelloService } from "../service/hello";

@TgCommand
export class HelloCommand {

    @TgOptions("-p, --peppers [type]", "Add peppers")
    public type: string;

    @TgOptions("-t, --target [taget]", "Add peppers", "dev")
    public target: string;

    constructor(private helloService: HelloService) {

    }

    @Command("rmdir <cmd> [env]")
    public hello(cmd: any, env: any) {
        console.log(cmd, env);
        console.log(this.helloService.getName());
    }

    @Command({
        cmd: "g <module>",
        description: "create module",
    })
    public createModule(module: any) {
        console.log(this.type);
        console.log("you want to create module: " + module);
        console.log(this.target);
        console.log("====");
    }

    @Command({
        cmd: "new <product>",
        alias: "n",
        description: "new product",
    })
    public newProduct(product: string) {
        console.log(process.cwd());
        console.log("you want to create product: " + product);
    }
}
```

```bash
xxx g name
```

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