Skip to content

alsharmani0/sysinfo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

sysinfo-cli

sysinfo-cli is a small Python command-line tool that prints basic system information in either human-readable text or JSON.

It reports:

  • CPU
  • RAM
  • disk usage
  • operating system details

Why This Project Exists

This project started as a compact local CLI exercise: build something simple, useful, and installable without relying on heavy dependencies.

Requirements

  • Python 3.8+

Installation

From the project directory:

python3 -m pip install -e .

After installation, the sysinfo command is available in your shell.

Usage

Default text output:

sysinfo

JSON output:

sysinfo --json

Use a different path for disk stats:

sysinfo --disk-path /home

Example Output

Text output:

CPU:
  Cores (logical): 8
  Processor:       x86_64
  Architecture:    x86_64

RAM:
  Total:           15.53 GB
  Used:            6.12 GB
  Available:       9.41 GB

Disk:
  Path:            /
  Total:           476.94 GB
  Used:            210.30 GB
  Free:            266.64 GB

OS:
  System:          Linux
  Release:         6.x.x
  Version:         #...
  Platform:        Linux-...

JSON output:

{
  "cpu": {
    "logical_cores": 8,
    "processor": "x86_64",
    "architecture": "x86_64"
  },
  "ram": {
    "total_bytes": 16675450880,
    "available_bytes": 10103156736,
    "used_bytes": 6572294144
  },
  "disk": {
    "path": "/",
    "total_bytes": 512110190592,
    "used_bytes": 225807372288,
    "free_bytes": 286302818304
  },
  "os": {
    "system": "Linux",
    "release": "6.x.x",
    "version": "#...",
    "platform": "Linux-..."
  }
}

Project Structure

  • sysinfo.py contains the CLI implementation
  • pyproject.toml defines packaging and the console entrypoint

Possible Next Steps

  • add tests
  • improve cross-platform memory detection
  • add optional colors or summary flags

About

Python CLI for printing CPU, memory, disk, and OS details as text or JSON.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages