{"id":15654723,"url":"https://github.com/noborus/guesswidth","last_synced_at":"2025-10-20T03:21:56.040Z","repository":{"id":143000670,"uuid":"613137595","full_name":"noborus/guesswidth","owner":"noborus","description":"Guess the width (fwf)  output without delimiters in commands that output to the terminal.","archived":false,"fork":false,"pushed_at":"2024-09-16T05:20:46.000Z","size":172,"stargazers_count":30,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T22:56:48.071Z","etag":null,"topics":["fixed-width","fwf"],"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":"2023-03-13T00:51:51.000Z","updated_at":"2024-12-28T05:00:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"4adb50c7-62a6-442a-a892-48ec8dd5e43f","html_url":"https://github.com/noborus/guesswidth","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fguesswidth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fguesswidth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fguesswidth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noborus%2Fguesswidth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noborus","download_url":"https://codeload.github.com/noborus/guesswidth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014136,"owners_count":20383715,"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":["fixed-width","fwf"],"created_at":"2024-10-03T12:53:40.023Z","updated_at":"2025-10-20T03:21:51.021Z","avatar_url":"https://github.com/noborus.png","language":"Go","readme":"# guesswidth\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/noborus/guesswidth.svg)](https://pkg.go.dev/github.com/noborus/guesswidth) [![Go](https://github.com/noborus/guesswidth/actions/workflows/build.yml/badge.svg)](https://github.com/noborus/guesswidth/actions/workflows/build.yml)\n\n## Overview\n\nguesswidth guesses the column position for fixed-width formats(fwf).\n\nThe output of the `ps` command has no delimiters, making the values difficult to machine-readable.\nguesswidth guesses smarter than just space delimiters.\n\nguesswidth is guessed based on the position of characters in the **header**.\nSo having a header will give you better results.\n\n## Install command\n\nThere is also a guesswidth command.\n\n```console\ngo install github.com/noborus/guesswidth/cmd/guesswidth@latest\n```\n\nGuess the width output with no delimiters in the command.\n\n```console\n$ ps\n    PID TTY          TIME CMD\n 302965 pts/3    00:00:12 zsh\n 733211 pts/3    00:00:00 ps\n 733212 pts/3    00:00:00 tee\n 733213 pts/3    00:00:00 guesswidth\n```\n\nSplit the output like this:\n\n```console\n$ ps | guesswidth\n    PID| TTY     |     TIME|CMD\n 302965| pts/3   | 00:00:08|zsh\n 539529| pts/3   | 00:00:00|ps\n 539530| pts/3   | 00:00:00|guesswidth\n```\n\nIt can be converted to `csv`.\n\n```console\n$ ps | guesswidth csv\nPID,TTY,TIME,CMD\n302965,pts/3,00:00:12,zsh\n733211,pts/3,00:00:00,ps\n733212,pts/3,00:00:00,tee\n733213,pts/3,00:00:00,guesswidth\n```\n\n```console\nps | guesswidth --align\n   PID|TTY  |    TIME|CMD\n302965|pts/3|00:00:12|zsh\n733211|pts/3|00:00:00|ps\n733212|pts/3|00:00:00|tee\n733213|pts/3|00:00:00|guesswidth\n```\n\n## Usage\n\n```console\n$ guesswidth -h         [~/dev/src/github.com/noborus/guesswidth]\nGuess the width of the columns from the header and body,\nsplit them, insert fences and output.\n\nUsage:\n  guesswidth [flags]\n  guesswidth [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  csv         Output in csv format\n  help        Help about any command\n\nFlags:\n  -a, --align          align the output\n      --fence string   fence (default \"|\")\n      --header int     header line number (default 1)\n  -h, --help           help for guesswidth\n      --scannum int    number of line to scan (default 100)\n      --split int      maximum number of splits (default -1)\n  -v, --version        version for guesswidth\n\nUse \"guesswidth [command] --help\" for more information about a command.\n```\n\n## Examples\n\nguesswidth inserts a delimiter (| by default)\n(Colors are changed here for clarity).\n\nEven if there are spaces in the header or body, they will be separated correctly.\n\n### ps\n\n![ps](./docs/ps.png)\n\n### docker ps\n\n![docker-ps](./docs/docker-ps.png)\n\n### docker node\n\n![docker node ls](./docs/docker-node.png)","funding_links":[],"categories":["\u003ca name=\"utility\"\u003e\u003c/a\u003eUtilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoborus%2Fguesswidth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoborus%2Fguesswidth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoborus%2Fguesswidth/lists"}