# nimpak/cli/help.nim # Help system for NimPak CLI commands import std/[strutils, strformat] proc showMainHelp*() = ## Show main nip command help echo """ 🌱 NimPak (nip) - Universal Package Manager for NexusOS USAGE: nip [options] [arguments] CORE COMMANDS: install Install a package remove Remove a package update Update package lists upgrade Upgrade all packages search Search for packages info Show package information list List installed packages GRAFTING COMMANDS (🚀 NEW!): graft Import package from external ecosystem convert Convert grafted package to .npk format grafting status Show grafting engine status ENVIRONMENT COMMANDS: cell create Create new user environment cell activate Activate user environment cell list List available environments REPRODUCIBILITY COMMANDS: lock Generate lockfile for current state restore Restore from lockfile diff Show environment drift VERIFICATION COMMANDS: verify Verify package integrity track Show package provenance CONFIGURATION COMMANDS: config show Show current configuration config validate Validate configuration files setup Setup NIP environment GLOBAL OPTIONS: --output Output format: human, json, yaml, kdl --log-level Log level: debug, info, warn, error --dry-run Simulate without making changes --no-color Disable colored output GRAFTING SOURCES: pacman, arch Arch Linux packages (official repos + AUR) nix, nixpkgs Nix packages (80,000+ packages!) pkgsrc, netbsd NetBSD packages (25,000+ packages!) EXAMPLES: nip install htop # Install from NexusOS repos nip graft pacman neofetch # Import from Arch Linux nip graft nix firefox # Import from Nix (🔥 GAME CHANGER!) nip convert neofetch # Convert to .npk format nip cell create dev-env # Create development environment nip lock # Create reproducible lockfile For detailed help on a specific command: nip help 🚀 NimPak: Universal compatibility, cryptographic integrity, superior configuration! """ proc showGraftHelp*() = ## Show detailed help for grafting commands echo """ 🌱 NimPak Grafting System - Universal Package Compatibility The grafting system allows you to import packages from external ecosystems and convert them to NexusOS .npk format for seamless integration. GRAFTING COMMANDS: nip graft [options] Import a package from an external package manager Sources: pacman, arch - Arch Linux official repositories and AUR nix, nixpkgs - Nix packages (nixos-unstable channel) pkgsrc, netbsd - NetBSD packages (binary + source builds) Options: --convert Automatically convert to .npk after grafting --verify Verify package integrity after grafting --output Output format: human, json, yaml, kdl Examples: nip graft pacman htop # Import htop from Arch nip graft nix firefox --convert # Import Firefox from Nix and convert nip graft arch yay --verify # Import AUR helper with verification nip grafting status [options] Show current grafting engine status and cached packages Options: --verbose, -v Show detailed information --output Output format: human, json, yaml, kdl Example: nip grafting status --verbose nip convert [options] Convert a grafted package to native .npk format Options: --verify Verify converted package --output Save .npk to specific path Examples: nip convert firefox # Convert to .npk nip convert htop --output ~/htop.npk GRAFTING WORKFLOW: 1. 🌱 GRAFT: Import package from external ecosystem → Package is downloaded and cached with full provenance → Metadata is extracted and stored → Build logs and source information preserved 2. 🔄 CONVERT: Transform to native .npk format → Files are reorganized to GoboLinux structure → Build hash is calculated for reproducibility → ACUL compliance metadata is added 3. ✅ VERIFY: Ensure integrity and compliance → Cryptographic verification of all files → License compliance checking → Provenance chain validation SUPPORTED ECOSYSTEMS: 📦 Arch Linux (pacman/AUR) • 13,000+ official packages • 85,000+ AUR packages • Automatic PKGBUILD parsing • Signature verification 📦 Nix (nixpkgs) 🔥 GAME CHANGER! • 80,000+ packages • Reproducible builds • Binary cache support • Declarative package definitions 📦 PKGSRC (NetBSD) ✅ IMPLEMENTED! • 25,000+ NetBSD packages • Binary packages + source builds • Cross-platform compatibility • Mature, stable package collection CACHE MANAGEMENT: Grafted packages are cached in ~/.nip/graft-cache/ with: • Original package archives • Extracted file structures • Metadata and provenance information • Build logs and conversion history Use 'nip grafting status' to see cache usage and cleanup options. 🚀 The grafting system gives NexusOS access to 205,000+ packages from mature ecosystems while maintaining our superior architecture! """ proc showCellHelp*() = ## Show detailed help for NexusCell commands echo """ 🏠 NipCells - Isolated User Environments NipCells provide per-user isolated package environments, allowing users to install and manage packages without affecting the system or other users. CELL COMMANDS: nip cell create [options] Create a new user environment Options: --isolation Isolation level: none, standard, strict --description Description for the cell Examples: nip cell create dev-env nip cell create gaming --isolation strict nip cell activate Activate a user environment (updates PATH, etc.) Example: nip cell activate dev-env nip cell list [options] List available user environments Options: --verbose, -v Show detailed information --output Output format: human, json, yaml, kdl nip cell delete Delete a user environment and all its packages Example: nip cell delete old-env CELL-SPECIFIC INSTALLATION: nip install --cell= Install package to specific cell Examples: nip install --cell=dev-env nodejs nip graft --cell=gaming nix steam ISOLATION LEVELS: none - No isolation, shares system environment standard - Isolated package installation, shared system access strict - Full isolation with restricted system access CELL STRUCTURE: ~/.nexus/cells// ├── Programs/ # Cell-specific packages ├── Index/ # Cell-specific symlinks ├── config/ # Cell configuration └── metadata/ # Cell metadata and state 🏠 NipCells enable safe experimentation and user autonomy! """ proc showCommandHelp*(command: string) = ## Show help for a specific command case command.toLower(): of "graft", "grafting": showGraftHelp() of "cell", "cells": showCellHelp() of "install": echo "nip install [options] - Install a package" of "remove": echo "nip remove [options] - Remove a package" of "convert": echo "nip convert [options] - Convert grafted package to .npk" of "verify": echo "nip verify [options] - Verify package integrity" of "lock": echo "nip lock [options] - Generate lockfile for reproducibility" of "restore": echo "nip restore [options] - Restore from lockfile" of "setup": echo """ nip setup - Setup NIP environment Arguments: user Configure NIP for the current user (updates shell RC files) system Configure NIP system-wide (requires root) Examples: nip setup user # Add NIP to PATH in ~/.zshrc, ~/.bashrc, etc. nip setup system # Add NIP to system PATH (not implemented) """ else: echo fmt"Unknown command: {command}" echo "Use 'nip help' for available commands"