From bbc44bec520f718496ddc47f7e2ad23e61c403c4 Mon Sep 17 00:00:00 2001 From: synt-xerror <169557594+synt-xerror@users.noreply.github.com> Date: Thu, 9 Apr 2026 01:15:00 -0300 Subject: [PATCH] feat: initial CLI structure - init: create plugin boilerplate - install: install from local path with deps - list: show installed plugins - validate: check manyplug.json syntax --- README.md | 61 + bin/manyplug.js | 43 + node_modules/.package-lock.json | 70 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 83 + node_modules/chalk/readme.md | 297 +++ node_modules/chalk/source/index.d.ts | 325 +++ node_modules/chalk/source/index.js | 225 ++ node_modules/chalk/source/utilities.js | 33 + .../source/vendor/ansi-styles/index.d.ts | 236 ++ .../chalk/source/vendor/ansi-styles/index.js | 223 ++ .../source/vendor/supports-color/browser.d.ts | 1 + .../source/vendor/supports-color/browser.js | 34 + .../source/vendor/supports-color/index.d.ts | 55 + .../source/vendor/supports-color/index.js | 190 ++ node_modules/commander/LICENSE | 22 + node_modules/commander/Readme.md | 1148 +++++++++ node_modules/commander/esm.mjs | 16 + node_modules/commander/index.js | 26 + node_modules/commander/lib/argument.js | 145 ++ node_modules/commander/lib/command.js | 2179 +++++++++++++++++ node_modules/commander/lib/error.js | 43 + node_modules/commander/lib/help.js | 462 ++++ node_modules/commander/lib/option.js | 329 +++ node_modules/commander/lib/suggestSimilar.js | 100 + node_modules/commander/package-support.json | 16 + node_modules/commander/package.json | 80 + node_modules/commander/typings/esm.d.mts | 3 + node_modules/commander/typings/index.d.ts | 884 +++++++ node_modules/fs-extra/LICENSE | 15 + node_modules/fs-extra/README.md | 294 +++ node_modules/fs-extra/lib/copy/copy-sync.js | 176 ++ node_modules/fs-extra/lib/copy/copy.js | 180 ++ node_modules/fs-extra/lib/copy/index.js | 7 + node_modules/fs-extra/lib/empty/index.js | 39 + node_modules/fs-extra/lib/ensure/file.js | 66 + node_modules/fs-extra/lib/ensure/index.js | 23 + node_modules/fs-extra/lib/ensure/link.js | 64 + .../fs-extra/lib/ensure/symlink-paths.js | 101 + .../fs-extra/lib/ensure/symlink-type.js | 34 + node_modules/fs-extra/lib/ensure/symlink.js | 92 + node_modules/fs-extra/lib/esm.mjs | 68 + node_modules/fs-extra/lib/fs/index.js | 146 ++ node_modules/fs-extra/lib/index.js | 16 + node_modules/fs-extra/lib/json/index.js | 16 + node_modules/fs-extra/lib/json/jsonfile.js | 11 + .../fs-extra/lib/json/output-json-sync.js | 12 + node_modules/fs-extra/lib/json/output-json.js | 12 + node_modules/fs-extra/lib/mkdirs/index.js | 14 + node_modules/fs-extra/lib/mkdirs/make-dir.js | 27 + node_modules/fs-extra/lib/mkdirs/utils.js | 21 + node_modules/fs-extra/lib/move/index.js | 7 + node_modules/fs-extra/lib/move/move-sync.js | 55 + node_modules/fs-extra/lib/move/move.js | 59 + .../fs-extra/lib/output-file/index.js | 31 + .../fs-extra/lib/path-exists/index.js | 12 + node_modules/fs-extra/lib/remove/index.js | 17 + node_modules/fs-extra/lib/util/async.js | 29 + node_modules/fs-extra/lib/util/stat.js | 159 ++ node_modules/fs-extra/lib/util/utimes.js | 36 + node_modules/fs-extra/package.json | 71 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 143 ++ node_modules/graceful-fs/clone.js | 23 + node_modules/graceful-fs/graceful-fs.js | 448 ++++ node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 53 + node_modules/graceful-fs/polyfills.js | 355 +++ node_modules/jsonfile/LICENSE | 15 + node_modules/jsonfile/README.md | 230 ++ node_modules/jsonfile/index.js | 88 + node_modules/jsonfile/package.json | 40 + node_modules/jsonfile/utils.js | 14 + node_modules/universalify/LICENSE | 20 + node_modules/universalify/README.md | 76 + node_modules/universalify/index.js | 24 + node_modules/universalify/package.json | 34 + package-lock.json | 83 + package.json | 20 + src/commands/init.js | 75 + src/commands/install.js | 99 + src/commands/list.js | 63 + src/commands/validate.js | 72 + 83 files changed, 11356 insertions(+) create mode 100644 README.md create mode 100755 bin/manyplug.js create mode 100644 node_modules/.package-lock.json create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/source/index.d.ts create mode 100644 node_modules/chalk/source/index.js create mode 100644 node_modules/chalk/source/utilities.js create mode 100644 node_modules/chalk/source/vendor/ansi-styles/index.d.ts create mode 100644 node_modules/chalk/source/vendor/ansi-styles/index.js create mode 100644 node_modules/chalk/source/vendor/supports-color/browser.d.ts create mode 100644 node_modules/chalk/source/vendor/supports-color/browser.js create mode 100644 node_modules/chalk/source/vendor/supports-color/index.d.ts create mode 100644 node_modules/chalk/source/vendor/supports-color/index.js create mode 100644 node_modules/commander/LICENSE create mode 100644 node_modules/commander/Readme.md create mode 100644 node_modules/commander/esm.mjs create mode 100644 node_modules/commander/index.js create mode 100644 node_modules/commander/lib/argument.js create mode 100644 node_modules/commander/lib/command.js create mode 100644 node_modules/commander/lib/error.js create mode 100644 node_modules/commander/lib/help.js create mode 100644 node_modules/commander/lib/option.js create mode 100644 node_modules/commander/lib/suggestSimilar.js create mode 100644 node_modules/commander/package-support.json create mode 100644 node_modules/commander/package.json create mode 100644 node_modules/commander/typings/esm.d.mts create mode 100644 node_modules/commander/typings/index.d.ts create mode 100644 node_modules/fs-extra/LICENSE create mode 100644 node_modules/fs-extra/README.md create mode 100644 node_modules/fs-extra/lib/copy/copy-sync.js create mode 100644 node_modules/fs-extra/lib/copy/copy.js create mode 100644 node_modules/fs-extra/lib/copy/index.js create mode 100644 node_modules/fs-extra/lib/empty/index.js create mode 100644 node_modules/fs-extra/lib/ensure/file.js create mode 100644 node_modules/fs-extra/lib/ensure/index.js create mode 100644 node_modules/fs-extra/lib/ensure/link.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 node_modules/fs-extra/lib/esm.mjs create mode 100644 node_modules/fs-extra/lib/fs/index.js create mode 100644 node_modules/fs-extra/lib/index.js create mode 100644 node_modules/fs-extra/lib/json/index.js create mode 100644 node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 node_modules/fs-extra/lib/json/output-json.js create mode 100644 node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 node_modules/fs-extra/lib/mkdirs/make-dir.js create mode 100644 node_modules/fs-extra/lib/mkdirs/utils.js create mode 100644 node_modules/fs-extra/lib/move/index.js create mode 100644 node_modules/fs-extra/lib/move/move-sync.js create mode 100644 node_modules/fs-extra/lib/move/move.js create mode 100644 node_modules/fs-extra/lib/output-file/index.js create mode 100644 node_modules/fs-extra/lib/path-exists/index.js create mode 100644 node_modules/fs-extra/lib/remove/index.js create mode 100644 node_modules/fs-extra/lib/util/async.js create mode 100644 node_modules/fs-extra/lib/util/stat.js create mode 100644 node_modules/fs-extra/lib/util/utimes.js create mode 100644 node_modules/fs-extra/package.json create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/clone.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100644 node_modules/jsonfile/LICENSE create mode 100644 node_modules/jsonfile/README.md create mode 100644 node_modules/jsonfile/index.js create mode 100644 node_modules/jsonfile/package.json create mode 100644 node_modules/jsonfile/utils.js create mode 100644 node_modules/universalify/LICENSE create mode 100644 node_modules/universalify/README.md create mode 100644 node_modules/universalify/index.js create mode 100644 node_modules/universalify/package.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/commands/init.js create mode 100644 src/commands/install.js create mode 100644 src/commands/list.js create mode 100644 src/commands/validate.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..dba2144 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# ManyPlug + +CLI plugin manager for ManyBot. + +## Install + +```bash +npm install -g manyplug +# or +npm link # for development +``` + +## Usage + +```bash +# Create new plugin +manyplug init my-plugin --category games + +# Install plugin from local path +manyplug install --local ../my-plugin + +# List installed plugins +manyplug list + +# Validate manyplug.json +manyplug validate +manyplug validate ./my-plugin +``` + +## Commands + +| Command | Description | +|---------|-------------| +| `init ` | Create new plugin boilerplate | +| `install [name]` | Install from registry or `--local ` | +| `list` | List installed plugins | +| `validate [path]` | Validate manyplug.json | + +## Plugin Structure + +``` +my-plugin/ +├── manyplug.json # Plugin metadata +├── index.js # Entry point +└── locale/ # Translations + └── pt.json +``` + +### manyplug.json + +```json +{ + "name": "my-plugin", + "version": "1.0.0", + "category": "games", + "service": false, + "dependencies": {} +} +``` + +**Categories:** games, media, utility, service, admin, fun diff --git a/bin/manyplug.js b/bin/manyplug.js new file mode 100755 index 0000000..494aeed --- /dev/null +++ b/bin/manyplug.js @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +import { program } from 'commander'; +import { createRequire } from 'module'; +import { initCommand } from '../src/commands/init.js'; +import { installCommand } from '../src/commands/install.js'; +import { listCommand } from '../src/commands/list.js'; +import { validateCommand } from '../src/commands/validate.js'; + +const require = createRequire(import.meta.url); +const pkg = require('../package.json'); + +program + .name('manyplug') + .description('CLI plugin manager for ManyBot') + .version(pkg.version); + +program + .command('init ') + .description('Create a new plugin boilerplate') + .option('-c, --category ', 'Plugin category', 'utility') + .action(initCommand); + +program + .command('install [plugin]') + .description('Install a plugin from registry or local path') + .option('-l, --local ', 'Install from local path') + .option('-g, --global', 'Install to global registry') + .action(installCommand); + +program + .command('list') + .alias('ls') + .description('List installed plugins') + .option('-a, --all', 'Include disabled plugins') + .action(listCommand); + +program + .command('validate [path]') + .description('Validate manyplug.json syntax') + .action(validateCommand); + +program.parse(); diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..367ef44 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,70 @@ +{ + "name": "manyplug", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/fs-extra": { + "version": "11.3.4", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.4.tgz", + "integrity": "sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + } + } +} diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 0000000..c9e0dc5 --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,83 @@ +{ + "name": "chalk", + "version": "5.6.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "funding": "https://github.com/chalk/chalk?sponsor=1", + "type": "module", + "main": "./source/index.js", + "exports": "./source/index.js", + "imports": { + "#ansi-styles": "./source/vendor/ansi-styles/index.js", + "#supports-color": { + "node": "./source/vendor/supports-color/index.js", + "default": "./source/vendor/supports-color/browser.js" + } + }, + "types": "./source/index.d.ts", + "sideEffects": false, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "scripts": { + "test": "xo && c8 ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "source", + "!source/index.test-d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "@types/node": "^16.11.10", + "ava": "^3.15.0", + "c8": "^7.10.0", + "color-convert": "^2.0.1", + "execa": "^6.0.0", + "log-update": "^5.0.0", + "matcha": "^0.7.0", + "tsd": "^0.19.0", + "xo": "^0.57.0", + "yoctodelay": "^2.0.0" + }, + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "@typescript-eslint/consistent-type-imports": "off", + "@typescript-eslint/consistent-type-exports": "off", + "@typescript-eslint/consistent-type-definitions": "off", + "unicorn/expiring-todo-comments": "off" + } + }, + "c8": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "source/vendor" + ] + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 0000000..5754e7c --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,297 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Coverage Status](https://codecov.io/gh/chalk/chalk/branch/main/graph/badge.svg)](https://codecov.io/gh/chalk/chalk) +[![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) +[![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) + +![](media/screenshot.png) + +## Info + +- [Why not switch to a smaller coloring package?](https://github.com/chalk/chalk?tab=readme-ov-file#why-not-switch-to-a-smaller-coloring-package) +- See [yoctocolors](https://github.com/sindresorhus/yoctocolors) for a smaller alternative + +## Highlights + +- Expressive API +- Highly performant +- No dependencies +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~115,000 packages](https://www.npmjs.com/browse/depended/chalk) as of July 4, 2024 + +## Install + +```sh +npm install chalk +``` + +**IMPORTANT:** Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now. [Read more.](https://github.com/chalk/chalk/releases/tag/v5.0.0) + +## Usage + +```js +import chalk from 'chalk'; + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +import chalk from 'chalk'; + +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +import chalk from 'chalk'; + +const error = chalk.bold.red; +const warning = chalk.hex('#FFA500'); // Orange color + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +import chalk from 'chalk'; + +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + +## API + +### chalk.`