{"id":15673211,"url":"https://github.com/noborus/psutilsql","last_synced_at":"2025-05-05T21:10:18.302Z","repository":{"id":40676186,"uuid":"194990733","full_name":"noborus/psutilsql","owner":"noborus","description":"Use the gopsutil library to retrieve information and process it with SQL","archived":false,"fork":false,"pushed_at":"2025-03-03T11:57:06.000Z","size":550,"stargazers_count":18,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T08:36:31.741Z","etag":null,"topics":["go","golang","gopsutil","sql","system-information","tbln","trdsql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noborus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T06:14:02.000Z","updated_at":"2025-02-17T13:43:20.000Z","dependencies_parsed_at":"2023-10-17T05:51:06.637Z","dependency_job_id":"fb5d7787-0d95-4c61-aa88-6e64dd77dd45","html_url":"https://github.com/noborus/psutilsql","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fpsutilsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fpsutilsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fpsutilsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fpsutilsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noborus","download_url":"https://codeload.github.com/noborus/psutilsql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246395574,"owners_count":20770240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","gopsutil","sql","system-information","tbln","trdsql"],"created_at":"2024-10-03T15:38:30.640Z","updated_at":"2025-03-31T19:31:03.778Z","avatar_url":"https://github.com/noborus.png","language":"Go","readme":"# psutilsql\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/noborus/psutilsql)](https://pkg.go.dev/github.com/noborus/psutilsql)\n\nCLI tool that can be processed by SQL using  [gopsutil](https://github.com/shirou/gopsutil) library.\n\nSQL input/output is handled by [trdsql](https://github.com/noborus/trdsql).\nTherefore, CSV, JSON, LTSV, MarkDown, Raw, Vertical, and TBLN can be selected as the output format.\n\n![psutilsql.gif](doc/psutilsql.gif)\n\n## install\n\n```console\ngo get -u github.com/noborus/psutilsql...\n```\n\npsutilsql depends on [go-sqlite3](https://github.com/mattn/go-sqlite3).\nTherefore, gcc is required to build.\n\n## Usage\n\n```console\npsutilsql command\n```\n\n### SQL\n\nThe query command(\\\u003cquery\\\u003e can be omitted) can execute SQL.\n\n```console\n$ psutilsql query \"SELECT Total,Used,Free FROM virtualmemory\"\nor     \n$ psutilsql \"SELECT Total,Used,Free FROM virtualmemory\"       \n\n+-------------+------------+------------+\n|    Total    |    Used    |    Free    |\n+-------------+------------+------------+\n| 16687091712 | 6468083712 | 2399399936 |\n+-------------+------------+------------+\n```\n\n#### Table list\n\nList of table names that can be used.\n\nDisplayed with the following command:\n\n```console\npsutilsql table\n```\n\n|      name       |\n|-----------------|\n| cpuinfo         |\n| cpupercent      |\n| cputime         |\n| diskpartition   |\n| diskusage       |\n| docker          |\n| hostinfo        |\n| hosttemperature |\n| hostuser        |\n| loadavg         |\n| loadmisc        |\n| net             |\n| process         |\n| processex       |\n| swapmemory      |\n| virtualmemory   |\n\n### Command\n\nDisplay values using command and options without using SQL.\n\n```console\n$ psutilsql host --users\n+---------+----------+------+------------+\n|  User   | Terminal | Host |  Started   |\n+---------+----------+------+------------+\n| noborus | tty7     | :0   | 1564096509 |\n+---------+----------+------+------------+\n```\n\n```console\n$ psutilsql --help\nSQL for running processes and system utilization.\n\nSQL can be executed on the information acquired using gopsutil library.\nDefault SQL is provided, so you can omit SQL if you select a command.\n\nUsage:\n  psutilsql [flags]\n  psutilsql [command]\n\nAvailable Commands:\n  completion  Generates bash/zsh completion scripts\n  cpu         CPU information\n  disk        DISK information\n  docker      docker information\n  help        Help about any command\n  host        host information\n  load        load information\n  mem         memory information\n  net         net information\n  process     process information\n  query       SQL query command\n  table       table list\n  version     Print the version number of psutilsql\n\nFlags:\n  -d, --Delimiter string   output delimiter (CSV only) (default \",\")\n  -O, --Header             output header (CSV only)\n  -o, --OutFormat string   output format=[AT|CSV|LTSV|JSON|JSONL|TBLN|RAW|MD|VF|YAML] (default \"AT\")\n  -q, --Query string       query\n  -h, --help               help for psutilsql\n  -t, --toggle             Help message for toggle\n\nUse \"psutilsql [command] --help\" for more information about a command.\n```\n\n### cpu\n\n--time: cpu time(default)\n\n| CPU | User | System | Idle | Nice | Iowait | Irq | Softirq | Steal | Guest | GuestNice |\n|-----|------|--------|------|------|--------|-----|---------|-------|-------|-----------|\n\n--info, -i: cpu info\n\n| CPU | VendorID | Family | Model | Stepping | PhysicalID | CoreID | Cores | ModelName | Mhz | CacheSize | Flags | Microcode |\n|-----|----------|--------|-------|----------|------------|--------|-------|-----------|-----|-----------|-------|-----------|\n\n--percent,-p: cpu percent\n\n### disk\n\n--partition: disk partition(default)\n\n| Device | Mountpoint | Fstype | Opts |\n|--------|------------|--------|------|\n\n--usage [disk]: disk usage\n\n| Path | Fstype | Total | Free | Used | UsedPercent | InodesTotal | InodesUsed | InodesFree | InodesUsedPercent |\n|------|--------|-------|------|------|-------------|-------------|------------|------------|-------------------|\n\n### docker\n\n| ContainerID | Name | Image | Status | Running |\n|-------------|------|-------|--------|---------|\n\n### host\n\n--info: host information(default)\n\n| Hostname | Uptime | BootTime | Procs | OS | Platform | PlatformFamily | PlatformVersion | KernelVersion | VirtualizationSystem | VirtualizationRole | HostID |\n|----------|--------|----------|-------|----|----------|----------------|-----------------|---------------|----------------------|--------------------|--------|\n\n--user,-u: user information\n\n| User | Terminal | Host | Started |\n|------|----------|------|---------|\n\n--temperatures, -t: SensorsTemperatures\n\n| SensorKey | Temperature |\n|-----------|-------------|\n\n### load\n\n| Load1 | Load5 | Load15 |\n|-------|-------|--------|\n\n--misc,-m: miscellaneous host-wide statistics\n\n| ProcsTotal | ProcsRunning | ProcsBlocked | Ctxt |\n|------------|--------------|--------------|------|\n\n### mem\n\nVirtualMemory(default)\n\n| Total | Available | Used | UsedPercent | Free | Active | Inactive | Wired | Laundry | Buffers | Cached | Writeback | Dirty | WritebackTmp | Shared | Slab | SReclaimable | SUnreclaim | PageTables | SwapCached | CommitLimit | CommittedAS | HighTotal | HighFree | LowTotal | LowFree | SwapTotal | SwapFree | Mapped | VMallocTotal | VMallocUsed | VMallocChunk | HugePagesTotal | HugePagesFree | HugePageSize |\n|-------|-----------|------|-------------|------|--------|----------|-------|---------|---------|--------|-----------|-------|--------------|--------|------|--------------|------------|------------|------------|-------------|-------------|-----------|----------|----------|---------|-----------|----------|--------|--------------|-------------|--------------|----------------|---------------|--------------|\n\n--swap, -s: SwapMemory\n\n| Total | Used | Free | UsedPercent | Sin | Sout | PgIn | PgOut | PgFault |\n|-------|------|------|-------------|-----|------|------|-------|---------|\n\n### net\n\n| Fd | Family | Type | LaddrIP | LaddrPort | RaddrIP | RaddrPort | status | Uids | Pid |\n|----|--------|------|---------|-----------|---------|-----------|--------|------|-----|\n\n### process\n\n| pid | name | CPU | MEM | STATUS | START | USER | RSS | VMS | Data | Stack | locked | Swap | COMMAND |\n|-----|------|-----|-----|--------|-------|------|-----|-----|------|-------|--------|------|---------|\n\n--ex: memory info ex\n\n| pid | name | CPU | MEM | STATUS | START | USER | RSS | VMS | Shared | Text | Lib | Data | Dirty | COMMAND |\n|-----|------|-----|-----|--------|-------|------|-----|-----|--------|------|-----|------|-------|---------|\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoborus%2Fpsutilsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoborus%2Fpsutilsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoborus%2Fpsutilsql/lists"}