{"id":13438476,"url":"https://github.com/tenox7/ttyplot","last_synced_at":"2025-10-21T04:54:21.764Z","repository":{"id":34170488,"uuid":"152566268","full_name":"tenox7/ttyplot","owner":"tenox7","description":"a realtime plotting utility for terminal/console with data input from stdin","archived":false,"fork":false,"pushed_at":"2025-10-05T03:36:54.000Z","size":477,"stargazers_count":1285,"open_issues_count":8,"forks_count":47,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-10-05T05:36:26.311Z","etag":null,"topics":["chart","cli","cli-app","command-line-tool","commandline","console","console-tool","cpu","graph","ping","pipe","pipeline","plot","realtime","sar","snmp","snmp-network-throughput","snmpget","stdin"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenox7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-11T09:31:44.000Z","updated_at":"2025-10-05T03:36:58.000Z","dependencies_parsed_at":"2023-12-29T10:24:03.581Z","dependency_job_id":"3c613071-120b-4938-a006-5f7171860e6c","html_url":"https://github.com/tenox7/ttyplot","commit_stats":{"total_commits":330,"total_committers":18,"mean_commits":"18.333333333333332","dds":0.6363636363636364,"last_synced_commit":"3e0dcee284a07083e4846655221fe59715bd9e31"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/tenox7/ttyplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenox7%2Fttyplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenox7%2Fttyplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenox7%2Fttyplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenox7%2Fttyplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenox7","download_url":"https://codeload.github.com/tenox7/ttyplot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenox7%2Fttyplot/sbom","scorecard":{"id":873864,"data":{"date":"2025-08-11","repo":{"name":"github.com/tenox7/ttyplot","commit":"05f1dec0bcb4e8e9a359626a327c2d524ee7b2be"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.7,"checks":[{"name":"Maintained","score":10,"reason":"12 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 3/21 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/clang_format.yml:15","Info: topLevel 'contents' permission set to 'read': .github/workflows/codespell.yml:15","Info: topLevel 'contents' permission set to 'read': .github/workflows/linux_and_macos.yml:15","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:   4 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T05:12:26.367Z","repository_id":34170488,"created_at":"2025-08-24T05:12:26.367Z","updated_at":"2025-08-24T05:12:26.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207203,"owners_count":26290616,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chart","cli","cli-app","command-line-tool","commandline","console","console-tool","cpu","graph","ping","pipe","pipeline","plot","realtime","sar","snmp","snmp-network-throughput","snmpget","stdin"],"created_at":"2024-07-31T03:01:05.835Z","updated_at":"2025-10-21T04:54:21.752Z","avatar_url":"https://github.com/tenox7.png","language":"C","readme":"# ttyplot\na realtime plotting utility for text mode consoles and terminals with data input from stdin / pipe\n\ntakes data from standard input / unix pipeline, most commonly some tool like *ping, snmpget, netstat, ip link, ifconfig, sar, vmstat*, etc. and plots in text mode on a terminal in real time, for example a simple **ping**:\n\n![ttyplot ping](ttyplot-ping.png)\n\n\u0026nbsp;\n\u0026nbsp;\n\n\nsupports rate calculation for counters and up to two graphs on a single display using reverse video for second line, for example **snmpget**, **ip link**, **rrdtool**, etc:\n\n![ttyplot snmp](ttyplot-snmp.png)\n\n\n\u0026nbsp;\n\u0026nbsp;\n\n## get\n\n\u003ca href=\"https://repology.org/project/ttyplot/versions\"\u003e\n    \u003cimg src=\"https://repology.org/badge/vertical-allrepos/ttyplot.svg\" alt=\"Packaging status\" align=\"right\"\u003e\n\u003c/a\u003e\n\n### ubuntu\n\n```\nsnap install ttyplot\n```\n\n### debian\n\n```\napt install ttyplot\n```\n\nalternatively [download](https://packages.debian.org/sid/ttyplot) | [tracker](https://tracker.debian.org/pkg/ttyplot)\n\n### gentoo\n\n```\nemerge -av app-admin/ttyplot\n```\n\n### macOS\n\n```\nbrew install ttyplot\n```\n\n### termux\n\n```\npkg install ttyplot\n```\n\n### FreeBSD\n\n```\npkg install ttyplot\n```\n\n### misc\n\nfor other platforms see [releases tab](https://github.com/tenox7/ttyplot/releases), also [older versions](https://github.com/tenox7/ttyplot/releases/tag/1.4)\n\n## examples\n\nnote: the examples provided are not meant to be exhaustive or even fully working in every case, just some ideas to expand on\n\n### cpu usage from vmstat using awk to pick the right column\n\n`fflush()` is needed to disable stdio buffering\n\n```\nvmstat -n 1 | gawk '{ print 100-int($(NF-2)); fflush(); }' | ttyplot -s 100 -t \"CPU Usage\" -u \"%\"\n```\n\n### memory usage on Linux using free, grep, tr and cut\n\n`stdbuf` is used to disable stdio buffering throughout the pipeline\n\n```\nfree -m -s 1 | stdbuf -o0 grep \"^Mem:\" | stdbuf -o0 tr -s \" \" | stdbuf -o0 cut -d\" \" -f3 | ttyplot -t \"MEM Usage\" -u \"MB\"\n```\n\n### memory usage on macOS\n\n```\nvm_stat 1 | awk '{ print int($2)*4096/1024^3; fflush(); }' | ttyplot -t \"MacOS Memory Usage\" -u GB\n```\n\n### number of processes in running and io blocked state\n\n```\nvmstat -n 1 | perl -lane 'BEGIN{$|=1} print \"@F[0,1]\"' | ttyplot -2 -t \"procs in R and D state\"\n```\n\n### load average via uptime and awk\n\n```\n{ while true; do uptime | gawk '{ gsub(/,/, \"\"); print $(NF-2) }'; sleep 1; done } | ttyplot -t \"load average\" -s load\n```\n\n### ping plot with sed\n\non macOS change `-u` to `-l`\n\n```\nping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t \"ping to 8.8.8.8\" -u ms\n```\n\n### wifi signal level in -dBM (higher is worse) using iwconfig\n```\n{ while true; do iwconfig 2\u003e/dev/null | grep \"Signal level\" | sed -u 's/^.*Signal level=-//g; s/dBm//g'; sleep 1; done } | ttyplot -t \"wifi signal\" -u \"-dBm\" -s 90\n```\n\n### wifi signal on macOS\n```\n{ while true; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --getinfo | awk '/agrCtlRSSI/ {print -$2; fflush();}'; sleep 1; done } | ttyplot -t \"wifi signal\" -u \"-dBm\" -s 90\n```\n\n### cpu temperature from proc\n```\n{ while true; do awk '{ printf(\"%.1f\\n\", $1/1000) }' /sys/class/thermal/thermal_zone0/temp; sleep 1; done } | ttyplot -t \"cpu temp\" -u C\n```\n\n### fan speed from lm-sensors using grep, tr and cut\n```\n{ while true; do sensors | grep fan1: | tr -s \" \" | cut -d\" \" -f2; sleep 1; done } | ttyplot -t \"fan speed\" -u RPM\n```\n\n### memory usage from rrdtool and collectd using awk\n```\n{ while true; do rrdtool lastupdate /var/lib/collectd/rrd/$(hostname)/memory/memory-used.rrd | awk 'END { print ($NF)/1024/1024 }'; sleep 1; done } | ttyplot -m $(awk '/MemTotal/ { print ($2)/1024 }' /proc/meminfo) -t \"Memoru Used\" -u MB\n```\n\n### bitcoin price chart using curl and jq\n```\n{ while true; do curl -sL https://api.coindesk.com/v1/bpi/currentprice.json  | jq .bpi.USD.rate_float; sleep 600; done } | ttyplot -t \"bitcoin price\" -u usd\n```\n\n### stock quote chart\n```\n{ while true; do curl -sL https://api.iextrading.com/1.0/stock/googl/price; echo; sleep 600; done } | ttyplot -t \"google stock price\" -u usd\n```\n\n### prometheus load average via node_exporter\n```\n{ while true; do curl -s  http://10.4.7.180:9100/metrics | grep \"^node_load1 \" | cut -d\" \" -f2; sleep 1; done } | ttyplot\n```\n\n\n\u0026nbsp;\n\u0026nbsp;\n\n\n\n## network/disk throughput examples\nttyplot supports \"two line\" plot for in/out or read/write\n\n### snmp network throughput for an interface using snmpdelta\n```\nsnmpdelta -v 2c -c public -Cp 10 10.23.73.254 1.3.6.1.2.1.2.2.1.{10,16}.9 | gawk '{ print $NF/1000/1000/10; fflush(); }' | ttyplot -2 -t \"interface 9 throughput\" -u Mb/s\n```\n\n### network throughput for an interface using netstat (OpenBSD, FreeBSD)\n```\nnetstat -b -w ${1} -I em0 | awk 'NR\u003e3 { print $1/1024; print $2/1024; fflush }' | ttyplot -2 -t \"IN/OUT Bandwidth in KB/s (${1}s resolution)\" -u \"KB/s\" -c \"#\"\n```\n\n### local network throughput for all interfaces combined from sar\n```\nsar  -n DEV 1 | gawk '{ if($6 ~ /rxkB/) { print iin/1000; print out/1000; iin=0; out=0; fflush(); } iin=iin+$6; out=out+$7; }' | ttyplot -2 -u \"MB/s\"\n```\n\n### disk throughput from iostat\n```\niostat -xmy 1 nvme0n1 | stdbuf -o0 tr -s \" \" | stdbuf -o0 cut -d \" \" -f 4,5 | ttyplot -2 -t \"nvme0n1 throughput\" -u MB/s\n```\n\n\u0026nbsp;\n\u0026nbsp;\n\n\n\n## rate calculator for counters\nttyplot also supports *counter* style metrics, calculating *rate* by measured time difference between samples\n\n### snmp network throughput for an interface using snmpget\n```\n{ while true; do snmpget -v 2c -c public 10.23.73.254 1.3.6.1.2.1.2.2.1.{10,16}.9 | awk '{ print $NF/1000/1000; }'; sleep 10; done } | ttyplot -2 -r -u \"MB/s\"\n```\n\n### local interface throughput using ip link and jq\n```\n{ while true; do ip -s -j link show enp0s31f6 | jq .[].stats64.rx.bytes/1024/1024,.[].stats64.tx.bytes/1024/1024; sleep 1; done } | ttyplot -r -2 -u \"MB/s\"\n```\n\n### prometheus node exporter disk throughput for /dev/sda\n```\n{ while true; do curl -s http://10.11.0.173:9100/metrics | awk '/^node_disk_.+_bytes_total{device=\"sda\"}/ { printf(\"%f\\n\", $2/1024/1024); }'; sleep 1; done } | ttyplot -r -2 -u MB/s -t \"10.11.0.173 sda writes\"\n```\n\n### using colors for different elements\n```\nping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t \"ping to 8.8.8.8\" -u ms -C 2,3,4,5\n```\nThis example sets color 2 (green) for the plot line, color 3 (yellow) for the axes, color 4 (blue) for the text, and color 5 (magenta) for the title and messages.\n\n### network throughput from collectd with rrdtool and awk\n```\n{ while true; do rrdtool lastupdate /var/lib/collectd/rrd/$(hostname)/interface-enp1s0/if_octets.rrd | awk 'END { print ($2)/1000/1000, ($3)/1000/1000 }'; sleep 10; done } | ttyplot -2 -r -t \"enp1s0 throughput\" -u MB/s\n```\n\n\n\n\u0026nbsp;\n\u0026nbsp;\n\n\n## flags\n\n```\n  ttyplot [-2] [-r] [-c plotchar] [-s scale] [-m max] [-M min] [-t title] [-u unit]\n  ttyplot -h\n  ttyplot -v\n\n  -2 read two values and draw two plots, the second one is in reverse video\n  -r rate of a counter (divide value by measured sample interval)\n  -c character to use for plot line, eg @ # % . etc\n  -e character to use for error line when value exceeds hardmax (default: e)\n  -E character to use for error symbol displayed when value is less than hardmin (default: v)\n  -s initial scale of the plot (can go above if data input has larger value)\n  -m maximum value, if exceeded draws error line (see -e), upper-limit of plot scale is fixed\n  -M minimum value, if entered less than this, draws error symbol (see -E), lower-limit of the plot scale is fixed\n  -t title of the plot\n  -u unit displayed beside vertical bar\n  -C color[,axes,text,title,max_err,min_err]  set colors (0-7) for elements:\n     First value: plot line color\n     Second value: axes color (optional)\n     Third value: text color (optional)\n     Fourth value: title color (optional)\n     Fifth value: max error indicator color (optional)\n     Sixth value: min error indicator color (optional)\n     Example: -C 1,2,3,4,5,6 or -C 1,2 or -C 1\n     Predefined color schemes:\n       -C dark1    Blue-cyan-yellow scheme for dark terminals\n       -C dark2    Purple-yellow-green scheme for dark terminals\n       -C light1   Green-blue-red scheme for light terminals\n       -C light2   Blue-green-yellow scheme for light terminals\n     Colors: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white\n  -v print the current version and exit\n  -h print this help message and exit\n```\n\n\u0026nbsp;\n\u0026nbsp;\n\n\n## key bindings\n\n\nwhen reading data from a pipe, ttyplot accepts the following commands typed at the terminal:\n\n```\n  q  quit\n  r  toggle rate mode\n ^L  full screen redraw\n```\n\nthese commands do not work if the standard input is a terminal: in this case quit with \u003ckbd\u003eCtrl\u003c/kbd\u003e-\u003ckbd\u003eC\u003c/kbd\u003e.\n\n\u0026nbsp;\n\u0026nbsp;\n\n\n## frequently questioned answers\n\n### ttyplot quits when there is no more data\n\n**UPDATE** as of version 1.5 ttyplot will print \"input stream closed\" and wait forever, instead of quititing.\n\nthis is by design; your problem is likely that the output is lost (terminal erased) when ttyplot exits; this is explained in [the next question below](#ttyplot-erases-screen-when-exiting)\n\nyou can also simply work around it, by adding `sleep`, `read`, `cat` at the end of the stream:\n\n```\n{ echo 1 2 3; cat; } | ttyplot\n```\n\n### ttyplot erases screen when exiting\nthis is because of [alternate screen](https://invisible-island.net/xterm/xterm.faq.html#xterm_tite) in terminals based on xterm; if you use one of these this will likely work around it:\n\n```\necho 1 2 3 | TERM=vt100 ttyplot\n```\n\nyou can also permanently fix terminfo entry (this will make a copy in $HOME/.terminfo/):\n\n```\ninfocmp -I $TERM | sed -e 's/smcup=[^,]*,//g' -e 's/rmcup=[^,]*,//g' | tic -\n```\n\n### when running interactively and non-numeric data is entered (eg. some key) ttyplot hangs\npress `ctrl^j` to re-set\n\n### stdio buffering\nby default in unix stdio is buffered, you can work around it [in various ways](http://www.perkin.org.uk/posts/how-to-fix-stdio-buffering.html) also [this](https://github.com/collectd/collectd/wiki/Plugin-Exec#output-buffering)\n\n\n## legal stuff\n```\nLicense: Apache 2.0\nCopyright (c) 2013-2025 Antoni Sawicki\nCopyright (c) 2023 Edgar Bonet\nCopyright (c) 2023 Sebastian Pipping\n```\n","funding_links":[],"categories":["C","Table of Contents","\u003ca name=\"data-management\"\u003e\u003c/a\u003eData management"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenox7%2Fttyplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenox7%2Fttyplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenox7%2Fttyplot/lists"}