@ai_suxiaole: 终端里最不缺的就是数字 真正缺的是一眼就能看懂趋势 GitHub 上有个 chartli 小工具,可以直接把命令行输出的数据渲染成图表 不管是服务器监控、日志分析还是脚本统计,只需要一条命令,就能生成 ASCII 折线图、柱状图、热力图、…

X AI KOLs Timeline 工具

摘要

介绍一个名为 chartli 的命令行工具,可以将命令行输出的数字数据直接渲染成 ASCII 图表(折线图、柱状图、热力图等),支持管道输入、文件读取和多种图表类型,适合服务器监控、日志分析等场景。

终端里最不缺的就是数字 真正缺的是一眼就能看懂趋势 GitHub 上有个 chartli 小工具,可以直接把命令行输出的数据渲染成图表 不管是服务器监控、日志分析还是脚本统计,只需要一条命令,就能生成 ASCII 折线图、柱状图、热力图、Braille 点阵图甚至 SVG 矢量图 支持从文件读取,也支持管道输入,多序列数据同样可以展示,分析数据时不用再来回切 Excel 了 GitHub: https://github.com/ahmadawais/chartli…
查看原文
查看缓存全文

缓存时间: 2026/06/18 00:05

终端里最不缺的就是数字

真正缺的是一眼就能看懂趋势

GitHub 上有个 chartli 小工具,可以直接把命令行输出的数据渲染成图表

不管是服务器监控、日志分析还是脚本统计,只需要一条命令,就能生成 ASCII 折线图、柱状图、热力图、Braille 点阵图甚至 SVG 矢量图

支持从文件读取,也支持管道输入,多序列数据同样可以展示,分析数据时不用再来回切 Excel 了

GitHub: https://github.com/ahmadawais/chartli…


ahmadawais/chartli

Source: https://github.com/ahmadawais/chartli

npx chartli

chartli

CLI for rendering charts in terminals from numeric text data. chartli turns plain numbers into terminal charts. ascii, spark, bars, columns, heatmap, unicode, braille, svg.

Install

Run instantly:

npx chartli --help

Or install globally:

npm i -g chartli

Agent skill install

Install the repository skill for agents:

npx skills add ahmadawais/chartli

Quick start:

npx chartli
npx chartli --help

Usage

npx chartli [file] [options]
Usage: chartli [options] [file]

Render terminal charts from numeric data

Arguments:
  file                   Input file (reads from stdin if not provided)

Options:
  -v, --version          Output the version number
  -t, --type <type>      Chart type: svg, ascii, unicode, braille, spark, bars,
                         columns, heatmap (default: "ascii")
  -w, --width <number>   Chart width
  -h, --height <number>  Chart height
  -m, --mode <mode>      SVG mode: circles or lines (default: "circles")
  --x-axis-label <label> Title to render for the x-axis
  --y-axis-label <label> Title to render for the y-axis
  --x-labels <labels>    Comma-separated labels for x-axis ticks or row labels
  --series-labels <labels>
                         Comma-separated labels for plotted series or categories
  --data-labels          Show raw values near plotted data when supported
  --first-column-x       Treat the first numeric column as x labels instead of a
                         plotted series
  --help                 Display help for command

Labels and metadata

  • Use --x-axis-label and --y-axis-label to add axis titles.
  • Use --x-labels for explicit tick labels.
  • Use --series-labels to replace generic labels like S1 and C1.
  • Use --data-labels to print raw values on or near the plotted data where the renderer supports it.
  • Use --first-column-x when the first numeric column is a domain like day, month, or year.

With --first-column-x, chartli will:

  • use the first numeric column as x-axis labels
  • use the first header cell as the x-axis title when a header row exists
  • use the remaining header cells as series labels
  • use the second header cell as the y-axis title for common two-column data

Example:

pnpm chartli examples/assets/core-single-series.txt -t ascii -w 24 -h 8 --first-column-x --data-labels
pnpm chartli examples/assets/core-multi-series.txt -t columns -h 8 --first-column-x --series-labels sales,costs,profit --x-axis-label Metrics --y-axis-label Value --data-labels

Labeled chart examples

ASCII line with inferred axis labels and data labels

pnpm chartli examples/assets/weekly-signups.txt -t ascii -w 28 -h 8 --first-column-x --data-labels
        signups
    91 │                      ●   87
       │                     91    ●
       │            73
       │             ●   68
  66.5 │   58             ●
       │    ●   49
       │42       ●
    42 │●
       └────────────────────────────
        1   2    3   4    5   6    7
                    day

Columns with explicit axis titles and inferred series names

pnpm chartli examples/assets/weekly-metrics.txt -t columns -h 8 --first-column-x --x-axis-label Metrics --y-axis-label Count --data-labels
Count
 176     29     10


  █
  █
  █
  █
  █      ▓      ▒
  █      ▓      ▒
────────────────────
visits trials  paid
      Metrics

SVG with axes, x labels, and point labels

pnpm chartli examples/assets/weekly-signups.txt -t svg -m lines -w 320 -h 120 --first-column-x --data-labels | sed -n '/^<?xml/,$p' > examples/assets/output/weekly-signups-chart.svg

This writes examples/assets/output/weekly-signups-chart.svg.

Types

  • ascii
  • spark
  • bars
  • columns
  • heatmap
  • unicode
  • braille
  • svg

Example data files

  • examples/assets/core-single-series.txt
  • examples/assets/core-multi-series.txt
  • examples/assets/image-data.txt
  • examples/assets/image-single-series.txt
  • examples/assets/image-columns-variant.txt
  • examples/assets/weekly-signups.txt
  • examples/assets/weekly-metrics.txt

Image chart set (text diagrams)

ASCII Line

pnpm chartli examples/assets/image-data.txt -t ascii -w 24 -h 8
      day=●  sales=○  costs=◆  profit=◇
1.00 │                       ○
     │
     │             ◇         ◇
     │                  ◆    ●
0.50 │                  ●    ◆
     │    ◇    ◆   ●
     │         ○   ◆
0.00 │◇   ◆    ◇        ◇
     └────────────────────────

Sparklines

pnpm chartli examples/assets/image-data.txt -t spark
day    ▁▂▃▄▅▆
sales  ▁▄▂▇▅█
costs  ▁▂▄▃▆▅
profit ▁▄▂▇▂▇

Horizontal Bars

pnpm chartli examples/assets/image-data.txt -t bars -w 28
day    |███████████████████         | 0.67
sales  |▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓| 1.00
costs  |▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒             | 0.53
profit |░░░░░░░░░░░░░░░░░░░░░░░     | 0.83

Columns

pnpm chartli examples/assets/image-data.txt -t columns -h 8
         ▓
         ▓             ░
         ▓             ░
  █      ▓             ░
  █      ▓      ▒      ░
  █      ▓      ▒      ░
  █      ▓      ▒      ░
  █      ▓      ▒      ░
───────────────────────────
 day   sales  costs  profit

Columns (Variant)

pnpm chartli examples/assets/image-columns-variant.txt -t columns -h 8

         ▓             ░
  █      ▓             ░
  █      ▓             ░
  █      ▓      ▒      ░
  █      ▓      ▒      ░
  █      ▓      ▒      ░
───────────────────────────
 day   sales  costs  profit

Heatmap

pnpm chartli examples/assets/image-data.txt -t heatmap
    day sales costs profit
R01
R02 ░ ▒ ░ ▒
R03 ░ ░ ▒ ░
R04 ▒ ▓ ░ ▓
R05 ▒ ▒ ▓ ░
R06 ▓ █ ▒ ▓

Unicode Bars

pnpm chartli examples/assets/image-data.txt -t unicode
 day    sales   costs   profit
             █
           ▃ █             ▅ ▅
     ▃     █ █      ▃      █ █
    ▂█     █▆█      █▂     █ █
   ▂██   ▂ ███    ▂ ██   ▃ █ █
  ▁███   █ ███    █▁██   █ █ █
 ▁████   █▅███   ▁████   █▁█▁█
 █████   █████   █████   █████

Braille

pnpm chartli examples/assets/image-data.txt -t braille -w 16 -h 6
profit

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠈
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠁⠀⠀⠀

SVG Chart

pnpm chartli examples/assets/image-data.txt -t svg -m lines -w 320 -h 120 | sed -n '/^<?xml/,$p' > examples/assets/output/image-chart.svg
<?xml version='1.0'?>
<svg xmlns='http://www.w3.org/2000/svg' width='650' height='120' version='1.1'>
  <polyline ... />
  <polyline ... />
  <polyline ... />
  <polyline ... />
</svg>

svg

Examples

All examples are data-file driven from examples/assets/.

Data files

  • examples/assets/core-single-series.txt
  • examples/assets/core-multi-series.txt
  • examples/assets/image-data.txt
  • examples/assets/image-single-series.txt
  • examples/assets/image-columns-variant.txt
  • examples/assets/weekly-signups.txt
  • examples/assets/weekly-metrics.txt
  • examples/assets/output/

Core commands

  • pnpm chartli examples/assets/core-single-series.txt -t ascii -w 24 -h 8
  • pnpm chartli examples/assets/core-multi-series.txt -t spark
  • pnpm chartli examples/assets/core-multi-series.txt -t bars -w 28
  • pnpm chartli examples/assets/core-multi-series.txt -t columns -h 8
  • pnpm chartli examples/assets/core-multi-series.txt -t heatmap
  • pnpm chartli examples/assets/core-multi-series.txt -t unicode
  • pnpm chartli examples/assets/core-single-series.txt -t braille -w 16 -h 6
  • pnpm chartli examples/assets/core-multi-series.txt -t svg -m lines -w 320 -h 120 | sed -n '/^<?xml/,$p' > examples/assets/output/core-chart.svg

Image commands

  • pnpm chartli examples/assets/image-data.txt -t ascii -w 24 -h 8
  • pnpm chartli examples/assets/image-data.txt -t spark
  • pnpm chartli examples/assets/image-data.txt -t bars -w 28
  • pnpm chartli examples/assets/image-data.txt -t columns -h 8
  • pnpm chartli examples/assets/image-columns-variant.txt -t columns -h 8
  • pnpm chartli examples/assets/image-data.txt -t heatmap
  • pnpm chartli examples/assets/image-data.txt -t unicode
  • pnpm chartli examples/assets/image-data.txt -t braille -w 16 -h 6
  • pnpm chartli examples/assets/image-data.txt -t svg -m lines -w 320 -h 120 | sed -n '/^<?xml/,$p' > examples/assets/output/image-chart.svg

Labeled commands

  • pnpm chartli examples/assets/weekly-signups.txt -t ascii -w 28 -h 8 --first-column-x --data-labels
  • pnpm chartli examples/assets/weekly-metrics.txt -t columns -h 8 --first-column-x --x-axis-label Metrics --y-axis-label Count --data-labels
  • pnpm chartli examples/assets/weekly-signups.txt -t svg -m lines -w 320 -h 120 --first-column-x --data-labels | sed -n '/^<?xml/,$p' > examples/assets/output/weekly-signups-chart.svg

Run grouped examples

  • pnpm run example:kitchen-sink
  • pnpm run example:image-set:kitchen-sink
  • pnpm run example:labeled:kitchen-sink
  • pnpm run example:all-kitchen-sink

Run all examples

Image-set chart run:

pnpm run example:image-set:kitchen-sink

Core + image run:

pnpm run example:all-kitchen-sink

License

Apache-2.0 by Ahmad Awais built with Command Code.

相似文章

@AYi_AInotes: 分享一个计算机视觉开发者必藏神器,4 万星GitHub开源! 不用自己写几百行画框跟踪代码, 一行命令搞定所有可视化, Supervision,CV 界真正的瑞士军刀。 它到底有多强? 自动画框加标签,支持编号、自定义样式, 视频对象永久…

X AI KOLs Timeline

Supervision 是一个开源计算机视觉可视化工具,支持一行命令完成画框、跟踪、数据集格式转换、热力图等,被6500+项目使用,GitHub 4万星。

@GitHub_Daily: 需要跟同事讲解项目系统架构,光说不画图效果有限,自己动手画又费时间还画得不好看。 archify,一个能装进 Claude Code、Codex CLI 和 opencode 的 Agent Skill,把一段大白话描述直接变成一张架构图…

X AI KOLs Timeline

archify 是一个能装进 Claude Code、Codex CLI 和 opencode 的 Agent Skill,可将大白话描述直接生成系统架构图、工作流程图、时序图、数据流向图和生命周期状态图,支持深色/浅色主题切换和多种格式导出。