@podge/cli 0.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.printInfo = exports.printSuccess = exports.printJson = exports.printTable = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ function printTable(headers, rows) {
9
+ const widths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] || "").length)));
10
+ const headerLine = headers.map((h, i) => h.padEnd(widths[i])).join(" ");
11
+ console.log(chalk_1.default.bold(headerLine));
12
+ console.log(widths.map((w) => "─".repeat(w)).join("──"));
13
+ for (const row of rows) {
14
+ console.log(row.map((c, i) => (c || "").padEnd(widths[i])).join(" "));
15
+ }
16
+ }
17
+ exports.printTable = printTable;
18
+ function printJson(data) {
19
+ console.log(JSON.stringify(data, null, 2));
20
+ }
21
+ exports.printJson = printJson;
22
+ function printSuccess(message) {
23
+ console.log(chalk_1.default.green(`✓ ${message}`));
24
+ }
25
+ exports.printSuccess = printSuccess;
26
+ function printInfo(message) {
27
+ console.log(chalk_1.default.cyan(message));
28
+ }
29
+ exports.printInfo = printInfo;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@podge/cli",
3
+ "version": "0.2.0-beta.0",
4
+ "description": "CLI for Podge — manage workspaces, collections, and search",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "podge": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "dependencies": {
14
+ "axios": "^1.6.0",
15
+ "chalk": "^4.1.2",
16
+ "commander": "^12.0.0"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^20.0.0",
20
+ "typescript": "^5.0.0"
21
+ },
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/rudeluv/podge-cli.git"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsc --watch",
33
+ "clean": "rm -rf dist",
34
+ "start": "node dist/index.js"
35
+ }
36
+ }