Custom CLI tool to help the user with different scenarios. It works as utility tool.
- Translate words, phrases, or paragraphs between languages.
- Convert date times between timezones.
- List and Get conversion rates for the Argentine peso and the US Dollar.
- TypeScript
- PNPM
- Yargs
.
├─ src/ # Source folder
│ ├─ commands/ # Commands folders
│ │ ├─ ctime/
│ │ │ ├─ ctime_commands/ # Sub Commands for ctime
│ │ │ │ ├─ convert.ts
│ │ │ │ └─ list.ts
│ │ │ ├─ ctime.outputs.ts
│ │ │ ├─ ctime.ts
│ │ │ └─ ctime.types.ts
│ │ ├─ trans/
│ │ │ ├─ trans_commands/ # Sub Commands for trans
│ │ │ │ ├─ list.ts
│ │ │ │ └─ translate.ts
│ │ │ ├─ trans.outputs.ts
│ │ │ ├─ trans.ts
│ │ │ └─ trans.types.ts
│ │ └─ usd/
│ │ ├─ usd_commands/ # Sub Commands for usd
│ │ │ ├─ get.ts
│ │ │ └─ list.ts
│ │ ├─ usd.outputs.ts
│ │ ├─ usd.ts
│ │ └─ usd.types.ts
│ ├─ cli.ts # CLI Tool entrypoint
│ ├─ handleError.ts # CLI error-handler helper
│ ├─ shared.ts # CLI shared constructors (builder, handler, options)
│ └─ util.ts # CLI utility class with functions
├─ .gitignore # Configuration files
├─ package.json
├─ pnpm-lock.yaml
├─ README.md # This file :)
└─ tsconfig.json# Convert PST Time to ART time
ccli ctime convert -f 'PST' -t 'ART'
# Output using current time
┌─────────────────────────┬─────────────────────────┐
│ From │ To │
├─────────────────────────┼─────────────────────────┤
│ PST │ ART │
├─────────────────────────┼─────────────────────────┤
│ 11:47 │ 15:47 │
└─────────────────────────┴─────────────────────────┘
ccli ct cv -f 'PST' -t 'ART' --specific '12:00'
# Output
┌─────────────────────────┬─────────────────────────┐
│ From │ To │
├─────────────────────────┼─────────────────────────┤
│ PST │ ART │
├─────────────────────────┼─────────────────────────┤
│ 12:00 │ 16:00 │
└─────────────────────────┴─────────────────────────┘# List supported languages
ccli trans list
# Output
┌─────────────────────────┬─────────────────────────┐
│ Language │ Abbreviation │
├─────────────────────────┼─────────────────────────┤
│ afrikaans │ af │
├─────────────────────────┼─────────────────────────┤
│ albanian │ sq │
├─────────────────────────┼─────────────────────────┤
│ amharic │ am │
├─────────────────────────┼─────────────────────────┤
│ arabic │ ar │
├─────────────────────────┼─────────────────────────┤
│ armenian │ hy │
├─────────────────────────┼─────────────────────────┤
│ azerbaijani │ az │
├─────────────────────────┼─────────────────────────┤
│ basque │ eu │
├─────────────────────────┼─────────────────────────┤
│ ... │ ... │
└─────────────────────────┴─────────────────────────┘# Translate phrase between languages
ccli trans translate -f 'es' -t 'ko' -d 'Hola'
# Output
안녕하세요# List all the conversion rates
ccli usd list
┌─────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┐
│ Currency │ Buy Conversion ra… │ Sell Conversion r… │ Last update │
├─────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┤
│ Official │ $348,96 │ $368,60 │ 01/11/2023 12:00:00 │
├─────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┤
│ Blue │ $890 │ $910 │ 01/11/2023 12:00:00 │
├─────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┤
│ CCL │ $775.23 │ $865.52 │ 01/11/2023 12:00:00 │
└─────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┘# Get specific conversion rate
usd get 'blue' # usd g <usdType>
┌─────────────────────────┬────────────────────┬────────────────────┬─────────────────────────┐
│ Currency │ Buy Conversion ra… │ Sell Conversion r… │ Last update │
├─────────────────────────┼────────────────────┼────────────────────┼─────────────────────────┤
│ Blue │ $890 │ $910 │ 01/11/2023 12:00:00 │
└─────────────────────────┴────────────────────┴────────────────────┴─────────────────────────┘npm i ccli
ccli --helpAgustin Magliano