void-cmd
Version:
AI-powered CLI tool that converts natural language to shell commands using Cerebras API
98 lines ⢠4.71 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelpCommand = void 0;
const utils_1 = require("../utils");
const os = __importStar(require("os"));
class HelpCommand {
constructor() {
this.name = 'help';
this.description = 'Show help information';
}
async execute(options) {
(0, utils_1.log)('\nđ VCMD by VoidWorks.xyz');
(0, utils_1.log)('\nđ Usage:');
(0, utils_1.log)(' vcmd [your request] # Run a command using natural language');
(0, utils_1.log)(' vcmd can you [your request] # Alternative phrasing for commands');
(0, utils_1.log)(' vcmd -settings # Open interactive settings');
(0, utils_1.log)(' vcmd -e [your command] # Analyze a command interactively');
(0, utils_1.log)(' vcmd -update # Check for updates');
(0, utils_1.log)(' vcmd -help # Show this help message');
(0, utils_1.log)('\nđĄ Examples:');
(0, utils_1.log)(' vcmd list all files in the current directory');
(0, utils_1.log)(' vcmd make sure the IP 1.1.1.1 is online');
(0, utils_1.log)(' vcmd can you find all JavaScript files modified in the last 7 days');
(0, utils_1.log)(' vcmd can you create a backup of my home directory');
(0, utils_1.log)(' vcmd show disk usage for all mounted drives');
(0, utils_1.log)('\nâď¸ Settings:');
(0, utils_1.log)(' vcmd -settings # Configure your API key and preferences');
(0, utils_1.log)('\nđ ď¸ Command Analysis:');
(0, utils_1.log)(' vcmd -e # Enter interactive analysis mode');
(0, utils_1.log)(' vcmd -e "ping 1.1.1.1" # Analyze a specific command');
(0, utils_1.log)(' vcmd -e ping 1.1.1.1 # Analyze command without quotes');
(0, utils_1.log)('\nđ Updates:');
(0, utils_1.log)(' vcmd -update # Check for available updates');
(0, utils_1.log)(' vcmd -update --auto # Automatically update if a new version is found');
(0, utils_1.log)('\nđĄď¸ Safety Levels:');
(0, utils_1.log)(' â
SAFE - Read-only operations');
(0, utils_1.log)(' â ď¸ CAUTION - File modifications or system changes');
(0, utils_1.log)(' đ¨ DANGEROUS - Destructive or irreversible actions');
const platform = os.platform();
const osType = this.getOSType(platform);
(0, utils_1.log)(`\nđĽď¸ Detected OS: ${osType} (${platform})`);
(0, utils_1.log)('Commands will be generated for your operating system.');
(0, utils_1.log)('Version: 1.1.1');
}
getOSType(platform) {
switch (platform) {
case 'win32':
return 'Windows';
case 'darwin':
return 'macOS';
case 'linux':
return 'Linux';
case 'freebsd':
return 'FreeBSD';
case 'openbsd':
return 'OpenBSD';
case 'sunos':
return 'Solaris';
default:
return 'Unix-like';
}
}
}
exports.HelpCommand = HelpCommand;
//# sourceMappingURL=help.js.map