import { SystemInfo } from './systeminfo-types'; import { SystemInfoOptions } from './systeminfo-types'; /** * Gets battery charge level and charging status * Reads from /sys/class/power_supply/BAT0 (Linux laptops only) * @param context - Info context with cache * @returns Battery percentage with optional + for charging, or empty string * @example "85%", "42%+", "100%" */ declare function battery(context: InfoContext): string; /** * Gets CPU benchmark score and rank from Geekbench 6 data * Uses fuzzy matching to find similar CPU models * @param context - Info context with cache * @returns Benchmark info with score and rank, or empty string * @example "37.9k #1", "20.5k #68" */ declare function bench(context: InfoContext): string; /** * Cache storage structure * @interface Cache */ declare interface Cache { [key: string]: CacheEntry; } /** * Cache storage structure */ declare interface Cache_2 { [key: string]: CacheEntry_2; } /** * Cache management utilities * @module cache */ /** * Represents a cached value with timestamp * @interface CacheEntry */ declare interface CacheEntry { /** The cached value */ value: any; /** Unix timestamp when the value was cached */ timestamp: number; } /** * Represents a cached value with timestamp */ declare interface CacheEntry_2 { value: any; timestamp: number; } /** * Gets geographic city based on public IP * @param context - Info context with IP geolocation data * @returns City name or empty string * @example "San Francisco", "New York", "London" */ declare function city(context: InfoContext): Promise; /** * Gets running Docker container names * Lists active Docker containers with their names * @param context - Info context with cache * @returns Space-separated container names or empty string * @example "nginx redis postgres", "web-app db-server" */ declare function containers(context: InfoContext): string; /** * Gets CPU model name and specifications * Uses platform-specific commands (wmic/lscpu/cpuinfo) * Automatically strips "with Radeon Graphics" and similar suffixes * @param context - Info context with cache * @returns CPU model string or empty string * @example "Intel Core i7-12700K", "AMD Ryzen 9 5900HX", "Apple M2 Pro" */ declare function cpu(context: InfoContext): string; /** * Gets detailed CPU benchmark information from Geekbench 6 data * Includes score, rank, and architecture type (ARM/Intel/AMD) * @param context - Info context with cache * @returns Detailed benchmark info with architecture, or empty string * @example "Geekbench 6: 37.9k (Rank #1) - ARM", "Geekbench 6: 20.5k (Rank #68) - Intel" */ declare function cpu_bench_info(context: InfoContext): string; /** * Gets device or computer model name * Uses WMI on Windows, DMI on Linux, getprop on Android * @param context - Info context with cache * @returns Device model name or empty string * @example "Dell OptiPlex 7090", "MacBook Pro 16-inch", "Valve Steam Deck" */ declare function device(context: InfoContext): string; /** * Gets disk size (used/total) for each real disk * Uses `df -k` on Linux/macOS, filtering out pseudo filesystems, system/boot * partitions (e.g. /boot, /System/Volumes/*), and anything under 10GB, since * those aren't disks a user would care about. When exactly one real disk is * found (the common case) the result omits the mount point; when multiple * real disks are found (e.g. a data drive or external volume), each is * labeled by its mount point. * @param context - Info context with cache * @returns Disk size as "used/total GB" or "mount(used/total GB) ..." or empty string * @example "256/512GB", "/(100/500GB) /Volumes/Backup(900/2000GB)" */ declare function disk_size(context: InfoContext): string; /** * Gets root filesystem disk usage percentage * Uses df command on Linux/Android/macOS * @param context - Info context with cache * @returns Percentage string or empty string * @example "45%", "78%" */ declare function disk_used(context: InfoContext): string; /** * Gets reverse DNS hostname with HTTP prefix * @param context - Info context with IP info * @returns Domain with http:// prefix or empty string * @example "http://example.com", "http://host-203-0-113-42.example.net" */ declare function domain(context: InfoContext): Promise; /** * Get all system information as a clean JSON object */ export declare function getSystemInfo(options?: SystemInfoOptions): Promise; /** * Gets graphics card model name * Extracts GPU info from lspci (Linux) or WMI (Windows) * Filters out basic/generic display adapters * @param context - Info context with cache * @returns GPU model string or empty string * @example "NVIDIA GeForce RTX 4070", "AMD Radeon RX 6800 XT" */ declare function gpu(context: InfoContext): string; /** * Gets GPU benchmark score and rank from Geekbench 6 data * Uses fuzzy matching to find similar GPU models * @param context - Info context with cache * @returns Benchmark info with score and rank, or empty string * @example "37.9k #1", "20.5k #68" */ declare function gpu_bench(context: InfoContext): string; /** * Gets detailed GPU benchmark information from Geekbench 6 data * Includes score, rank, and vendor detection * @param context - Info context with cache * @returns Detailed benchmark info with vendor, or empty string * @example "Geekbench 6: 37.9k (Rank #1) - NVIDIA", "Geekbench 6: 20.5k (Rank #68) - AMD" */ declare function gpu_bench_info(context: InfoContext): string; /** * Gets the system hostname * @returns Computer hostname/network name */ declare function hostname(): string; /** * Context object passed to info collection functions * @interface InfoContext */ declare interface InfoContext { /** Cache storage */ cache: Cache; /** IP information from external API */ ipInfo?: IPInfo; } /** * System information collection functions map */ export declare const infoFunctions: { user: typeof user; hostname: typeof hostname; ip: typeof ip; iplocal: typeof iplocal; city: typeof city; domain: typeof domain; isp: typeof isp; os: typeof os_info; cpu: typeof cpu; gpu: typeof gpu; bench: typeof bench; cpu_bench_info: typeof cpu_bench_info; gpu_bench: typeof gpu_bench; gpu_bench_info: typeof gpu_bench_info; disk_used: typeof disk_used; disk_size: typeof disk_size; ram_used: typeof ram_used; top_process: typeof top_process; uptime: typeof uptime; device: typeof device; kernel: typeof kernel; shell: typeof shell; pacman: typeof packages; ports: typeof ports; containers: typeof containers; memory_available: typeof memory_available; swap_used: typeof swap_used; load_average: typeof load_average; users_logged_in: typeof users_logged_in; network_interfaces: typeof network_interfaces; mount_points: typeof mount_points; services_running: typeof services_running; temperature: typeof temperature; battery: typeof battery; screen_resolution: typeof screen_resolution; }; /** * Gets public IP address from ipinfo.io * @param context - Info context with cache and IP info * @returns Public IPv4 address or empty string * @example "203.0.113.42" */ declare function ip(context: InfoContext): Promise; /** * Network utilities for IP information fetching * @module network */ /** * IP information from ipinfo.io API * @interface IPInfo */ declare interface IPInfo { /** Public IP address */ ip?: string; /** City location */ city?: string; /** Reverse DNS hostname */ hostname?: string; /** ISP organization string (includes AS number) */ org?: string; } /** * Gets local/private IP address(es) * Tries ifconfig and ip commands on Linux, falls back to Node.js API * @returns Space-separated local IP addresses (RFC 1918 ranges) * @example "192.168.1.100" or "10.0.0.50 192.168.1.100" */ declare function iplocal(): string; /** * Gets Internet Service Provider name * Strips AS number prefix from organization string * @param context - Info context with IP info * @returns ISP name or empty string * @example "Comcast Cable", "Verizon Business", "Cloudflare Inc" */ declare function isp(context: InfoContext): Promise; /** * Gets kernel version string * Returns the operating system kernel version from os.release() * @param context - Info context with cache * @returns Kernel version string * @example "5.15.0-56-generic", "6.11.11-valve12-1-neptune" */ declare function kernel(context: InfoContext): string; /** * Gets system load averages * Reads 1, 5, and 15 minute load averages from /proc/loadavg (Linux) or * os.loadavg() (macOS) * @returns Space-separated load averages (1m 5m 15m) or empty string * @example "0.52 0.58 0.59", "2.10 1.95 1.88" */ declare function load_average(context: InfoContext): string; /** * Loads cache from disk */ export declare function loadCache(): Cache_2; /** * Gets available memory in gigabytes * Reads MemAvailable from /proc/meminfo (Linux) or derives it from * vm_stat's free+inactive pages (macOS) * @returns Available memory with "GB available" suffix or empty string * @example "12GB available", "4GB available" */ declare function memory_available(): string; /** * Gets mounted filesystem information * Lists non-system mount points with usage from df (Linux/macOS) * On Linux, excludes /, /dev, /proc, /sys and internal /System/Volumes mounts. * On macOS, APFS internal volumes (Data, VM, Preboot, Update, ...) all live * under /System/Volumes and are not user-relevant, so only /Volumes (external * disks, network shares, disk images) are reported. * @param context - Info context with cache * @returns Space-separated mount points with usage or empty string * @example "/home(45%) /mnt/data(78%)", "/Volumes/Backup(78%)" */ declare function mount_points(context: InfoContext): string; /** * Gets active network interface names * Lists non-loopback interfaces with IPv4 addresses (Linux/macOS only) * @param context - Info context with cache * @returns Space-separated interface names or empty string * @example "eth0 wlan0", "en0 en1" */ declare function network_interfaces(context: InfoContext): string; /** * Gets operating system name and version * Platform-specific detection for Windows, macOS, and Linux * @param context - Info context with cache * @returns OS name and version string * @example "Windows 11 Pro", "macOS Ventura 13.2.1", "Ubuntu 22.04.3 LTS" */ declare function os_info(context: InfoContext): string; /** * Gets available package managers and development tools * Checks for package managers (apt, yum, npm, etc.) and editors (nvim, hx) * @param context - Info context with cache * @returns Space-separated list of available commands * @example "apt npm docker nvim", "yay pacman bun hx" */ declare function packages(context: InfoContext): string; /** * Gets open TCP ports with service names * Uses lsof to find listening TCP ports (Linux/macOS only) * @param context - Info context with cache * @returns Space-separated port+process pairs or empty string * @example "80http 443http 22ssh", "3000node 5432post" */ declare function ports(context: InfoContext): string; /** * Gets memory usage in gigabytes * Reads from /proc/meminfo on Linux, falls back to os.totalmem() * @param context - Info context with cache * @returns Memory usage as "used/total GB" * @example "12/32GB", "6/16GB" */ declare function ram_used(context: InfoContext): string; /** * Saves cache to disk */ export declare function saveCache(cache: Cache_2): void; /** * Gets screen resolution * Uses xrandr on Linux (X11/Xorg only) or system_profiler on macOS * @returns Resolution in WIDTHxHEIGHT format or empty string * @example "1920x1080", "2560x1440", "3840x2160" */ declare function screen_resolution(): string; /** * Gets count of running system services * Uses systemctl or service command (Linux only) * @param context - Info context with cache * @returns Service count with "services" suffix or empty string * @example "125 services", "89 services" */ declare function services_running(context: InfoContext): string; /** * Gets the current shell name * Uses the user's login shell (macOS/Linux), falls back to ps for the * parent process shell * @returns Shell name or empty string on Windows * @example "bash", "zsh", "fish", "nu" */ declare function shell(context: InfoContext): string; /** * Gets swap memory usage * Calculates swap usage from /proc/meminfo (Linux) or `sysctl vm.swapusage` * (macOS) * @returns Swap usage as "percentage (size MB) swap" or empty string * @example "15% (512MB) swap", "0% (0MB) swap" */ declare function swap_used(): string; /** * Gets system temperature in Celsius * Reads from thermal zone or hwmon sensors (Linux), or from the * `osx-cpu-temp` CLI (macOS, if installed via `brew install osx-cpu-temp`) - * macOS has no unprivileged API for this, so nothing is reported without it * @param context - Info context with cache * @returns Temperature with °C suffix or empty string * @example "45°C", "62°C" */ declare function temperature(context: InfoContext): string; /** * Gets the highest CPU-consuming process * Uses ps command to find top process by CPU usage (Linux/macOS only) * @param context - Info context with cache * @returns Process info as "percentage processname" or empty string * @example "8% firefox", "15% chrome", "3% systemd" */ declare function top_process(context: InfoContext): string; /** * Gets system uptime since last boot * @returns Uptime formatted as "Xd Yh Zm" * @example "2d 14h 23m", "0d 3h 45m" */ declare function uptime(): string; /** * Gets the current username * @returns Current system username */ declare function user(): string; /** * Gets number of logged in users * Uses who command to count active user sessions (Linux/macOS only) * @returns User count with "users" suffix or empty string * @example "3 users", "1 users" */ declare function users_logged_in(): string; export { }