{"id":17001640,"url":"https://github.com/shresht7/deno-cli-tools","last_synced_at":"2026-05-11T03:23:47.664Z","repository":{"id":39742368,"uuid":"453988636","full_name":"Shresht7/deno-cli-tools","owner":"Shresht7","description":"Command-line tools and utilities for Deno 🦕","archived":false,"fork":false,"pushed_at":"2024-05-04T09:58:31.000Z","size":286,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T09:09:37.250Z","etag":null,"topics":["ansi","cli","command-line","deno","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shresht7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-31T11:59:20.000Z","updated_at":"2024-05-04T09:58:35.000Z","dependencies_parsed_at":"2024-11-28T18:32:10.042Z","dependency_job_id":"b3ade57f-dfd7-4f22-bd3b-25248be7b5f0","html_url":"https://github.com/Shresht7/deno-cli-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Fdeno-cli-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Fdeno-cli-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Fdeno-cli-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2Fdeno-cli-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shresht7","download_url":"https://codeload.github.com/Shresht7/deno-cli-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931586,"owners_count":20534010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansi","cli","command-line","deno","terminal"],"created_at":"2024-10-14T04:25:38.440Z","updated_at":"2026-05-11T03:23:42.633Z","avatar_url":"https://github.com/Shresht7.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003edeno-cli-tools\u003c/h1\u003e\n\n\u003ch2 align='center'\u003e🚧 Work In Progress 🚧\u003c/h2\u003e\n\n---\n\nCommand-line tools and utilities for Deno 🦕 projects\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eTable of Contents\u003c/summary\u003e\n\n- [📦 ANSI Modules](#-ansi-modules)\n  - [🎨 Colors](#-colors)\n  - [💄 Styles](#-styles)\n  - [🏗 ANSI Builder](#-ansi-builder)\n  - [☝ Cursor](#-cursor)\n  - [🧼 Clear](#-clear)\n  - [RegEx](#regex)\n  - [Mix](#mix)\n- [📚 Helpers](#-helpers)\n  - [🏭 Composition](#-composition)\n  - [📄 Format](#-format)\n    - [Align](#align)\n    - [Pad](#pad)\n- [📐 Components](#-components)\n  - [Box](#box)\n  - [Progress-Bars](#progress-bars)\n  - [Spinners](#spinners)\n- [✔ Symbols](#-symbols)\n- [📑 License](#-license)\n\n\u003c/details\u003e\n\n---\n\n## 📦 ANSI Modules\n\n### 🎨 Colors\n\nThe colors package allows you to style text with colors.\n\n```ts\nimport { blue, red } from 'https://.../ansi/colors.ts'\nconsole.log(blue('Whale'))\nconsole.log(red('Skies'))\n```\n\nAll colors have `bg`, `bright` and `bgBright` variants. e.g. to use bright yellow call `yellow.bright(text)` and to use blue background call `blue.bg(text)`\n\n\u003cdiv align='center'\u003e\n  \u003cimg src=\"./screenshots/colors.png\" alt=\"ansi-colors\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\ncolors: `black` | `red` | `green` | `yellow` | `blue` | `magenta` | `cyan` | `white` | `default`\n\nThe `rgb` function colors a string with the given RGB value.\n\n```ts\nimport { rgb } from 'https://.../ansi/colors.ts'\nconst clr = rgb([125, 224, 65])\nconsole.log(clr('text'))\n```\n\n### 💄 Styles\n\nThe styles package allows you to format your text.\n\n```ts\nimport { bold, inverse } from 'https://.../ansi/styles.ts'\nconsole.log(bold('Claims'))\nconsole.log(inverse('Kinematics'))\n```\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"screenshots/styles.png\" alt=\"ansi-styles\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\nstyles: `bold` | `faint` | `italic` | `underline` | `blinking` | `inverse` | `hidden` | `strikethrough`\n\n### 🏗 ANSI Builder\n\nThe ANSI builder API makes use of the power of template string literals to provide a simple and clean way to write ANSI strings. Any ANSI helper function (or any function with `(s: string) =\u003e string` signature for that matter) can be passed in the template strings that will be called upon the following string section (and only that section).\n\n![ansi-builder](screenshots/builder.png)\n\n```ts\nimport { ansi } from 'https://.../ansi/builder.ts'\nimport { red } from 'https://.../ansi/colors.ts'\nconsole.log(ansi`This is ${red} dangerous! ${inverse} Are you sure? (Yes/No):`)\n```\n\nMultiple ANSI functions can be composed together using the composition helpers.\n\n```ts\nimport { blue } from 'https://.../ansi/colors.ts'\nimport { inverse } from 'https://.../ansi/styles.ts'\nimport { compose } from 'https://.../helpers/composition.ts'\nconsole.log(ansi`Yes, ${compose(blue, inverse)} yes it is!`)\n```\n\n### ☝ Cursor\n\nThe cursor package provides helper function for cursor manipulation.\n\n```ts\nimport cursor from 'https://.../ansi/cursor.ts'\nconsole.log(cursor.toColumn(0))\nconsole.log(cursor.right(10))\n```\n\n|                   Field | Description                                  |\n| ----------------------: | -------------------------------------------- |\n|                `toHome` | Moves the cursor to the Home position (0, 0) |\n|   `toPos(r = 0, c = 0)` | Move the cursor to given row and column      |\n|             `up(n = 1)` | Moves the cursor up by n lines               |\n|           `down(n = 1)` | Moves the cursor down by n lines             |\n|          `right(n = 1)` | Moves the cursor right by n lines            |\n|           `left(n = 1)` | Moves the cursor left by n lines             |\n|     `toNextLine(n = 1)` | Moves the cursor to the nth next line        |\n|     `toPrevLine(n = 1)` | Moves the cursor to the nth prev line        |\n|       `toColumn(n = 0)` | Moves the cursor to a given column position  |\n|       `requestPosition` | Returns the current cursor position          |\n|                  `show` | Makes the cursor visible                     |\n|                  `hide` | Makes the cursor invisible                   |\n|    `save(mode = 'DEC')` | Saves the current cursor position            |\n| `restore(mode = 'DEC')` | Restores the current cursor position         |\n\n### 🧼 Clear\n\nThe clear package provides helper functions to clear the terminal.\n\n```ts\nimport clear from 'https://.../ansi/clear.ts'\nconsole.log(clear.entireLine)\n```\n\n|            Field | Description                               |\n| ---------------: | ----------------------------------------- |\n|         `screen` | Clears the screen                         |\n| `cursorAndBelow` | Clears the cursor and everything below it |\n| `cursorAndAbove` | Clears the cursor and everything above it |\n|   `entireScreen` | Clear the entire screen                   |\n|     `savedLines` | Clears saved lines                        |\n|           `line` | Clears the line                           |\n| `lineFromCursor` | Clears the line from the cursor           |\n|   `lineToCursor` | Clears the line to the cursor             |\n|     `entireLine` | Clears the entire line                    |\n\n### RegEx\n\nRegular expression to capture ansi codes. The `strip` helper function can remove all ansi escape codes from a string.\n\n```ts\nimport { regex, strip } from 'https://.../ansi/regex.ts'\n\n// ...\ns = str.replace(regex, '')\n// or simply\ns = strip(str)\n```\n\nBased on:\n- ansi-regex: https://github.com/chalk/ansi-regex\n\n### Mix\n\nThe `mix` helper function allows you to create composite ansi codes that include style and colors.\n\n```ts\nimport { mix } from 'https://.../ansi/mix.ts'\n\nstyler = mix('bold', 'white', 'magenta')\nconsole.log(styler('  Mixology 101  '))\n```\n\n![mix](screenshots/mix.png)\n\n---\n\n## 📚 Helpers\n\n### 🏭 Composition\n\nComposition helpers provide two utility functions `compose` and `pipe` that allow you to combine many ansi functions together.\n\n```ts\nimport { compose } from 'https://.../helpers/composition.ts'\nimport { bold, inverse } from 'https://.../ansi/styles.ts'\nimport { blue } from 'https://.../ansi/colors.ts'\n\nconst str = compose(blue, bold, inverse)('Functional')\nconsole.log(str)\n\nconst header = compose(bold, inverse, pad(3))\nconsole.log(header('Reusable Header Style Component'))\n```\n\n\u003e This is an alternative to the [ansi mix](#mix) helper.\n\n### 📄 Format\n\n#### Align\n\nAlign text to the left, right or center.\n\n![align](screenshots/align.png)\n\n```ts\nimport { align } from 'https://.../format/mod.ts'\n\n//  Align to the right such that the width is 10 characters\nconsole.log(align('R', { align: 'right', width: 10 }))\n//  alternatively\nconsole.log(align.right('R', { width: 10 }))\n\nconsole.log(align('Title\\nDescription'))  //  Aligns to the center\n\n  //  Align to the left and use - to pad to the right\nconsole.log(align.left('L', { pad: '-', width: 5 }))\n```\n\n[Go to Source](format/align.ts)\n\n#### Pad\n\nApply padding around the text.\n\n![pad](screenshots/pad.png)\n\n```ts\nimport { pad } from 'https://.../format/mod.ts'\n\n//  Pad 5 spaces around\nconsole.log(pad(5)('WOW'))\n//  Pad 1 space to the left\nconsole.log(pad.left()('Subheading'))\n//  Pad 5 dashes to the right\nconsole.log(pad.right(5)('MOM'))\n```\n\n---\n\n## 📐 Components\n\n### Box\n\n```ts\nimport { box } from 'https://.../components/box/mod.ts'\nconsole.log(box('component', { type: 'round', alignment: 'center' }))\n```\n\n### Progress-Bars\n\n```ts\nimport ProgressBar from 'https://.../components/progressbar/mod.ts'\nconst progressbar = new ProgressBar()\n```\n\n[**Read more**](./components/progressbar/README.md)\n\n### Spinners\n\n```ts\nimport Spinner from 'https://.../components/spinners/mod.ts'\n\nconst spinner = new Spinner()\n\nlet count = 10\nspinner.start({ text: 'Preparing for Liftoff!' })\nconst interval = setInterval(() =\u003e {\n    spinner.setText(`Liftoff in ${count}`)\n    if (count \u003e 10) {\n        spinner.stop('Liftoff 🚀')\n        clearInterval(interval)\n    }\n}, 10_000)\n```\n\n[**Read more**](./components/spinner/README.md)\n\nInspired by and heavily borrows from the following projects:\n- ora: https://github.com/sindresorhus/ora\n- cli-spinners: https://github.com/sindresorhus/cli-spinners\n\n---\n\n## ✔ Symbols\n\nUnicode symbols for the terminal.\n\n```\n✔ ℹ ⚠ ✖ ☰ ↑ ↓ ← → ♪ ♫ ■ ● ․ … › ▲ ▴ ▼ ▾ ◂ ▸ ⌂ ♥ ↔ ↕ ≈ ≠ ≤ ≥ ≡ ∞ ෴ ★ ▶ ⬢\n```\n\n\u003e Uses a fallback set of characters on terminals that do not support unicode.\n\n```ts\nimport { symbol, status } from 'https://.../symbols/mod.ts'\n\nconsole.log(symbol.warning + \" Are you sure?\")\n//  ⚠ Are you sure?\n\nconsole.log(status.success, \"Done\")\n//  ✔ Done\n\nconsole.log(\"Controls: \", symbol.arrowUp, symbol.arrowDown, symbol.arrowLeft, symbol.arrowRight)\n//  Controls: ↑ ↓ ← →\n```\n\n`status` includes some commonly used symbols in color.\n\n![status](screenshots/status.png)\n\n\u003e status symbols obey the `no-color` flags.\n\nFor a list of all symbols, see the [Reference](symbols/reference.md)\n\nInspired by and heavily borrows from the following projects:\n\n- figures: https://github.com/sindresorhus/figures\n- log-symbols: https://github.com/sindresorhus/log-symbols\n\n---\n\n## 📑 License\n\n\u003e [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fdeno-cli-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshresht7%2Fdeno-cli-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fdeno-cli-tools/lists"}