{"id":13526666,"url":"https://github.com/homeport/termshot","last_synced_at":"2025-05-15T17:08:24.214Z","repository":{"id":39163268,"uuid":"311794221","full_name":"homeport/termshot","owner":"homeport","description":"Creates screenshots based on terminal command output","archived":false,"fork":false,"pushed_at":"2025-05-05T15:21:48.000Z","size":1622,"stargazers_count":518,"open_issues_count":17,"forks_count":19,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-05T15:58:33.749Z","etag":null,"topics":["ansi-colors","cli","screenshot","shell","terminal"],"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/homeport.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,"zenodo":null}},"created_at":"2020-11-10T21:56:13.000Z","updated_at":"2025-05-05T15:21:52.000Z","dependencies_parsed_at":"2023-10-30T15:28:15.863Z","dependency_job_id":"3036aa65-ef6e-46e8-a60b-a81cd3a09bce","html_url":"https://github.com/homeport/termshot","commit_stats":{"total_commits":235,"total_committers":7,"mean_commits":33.57142857142857,"dds":0.3489361702127659,"last_synced_commit":"42c1d080b0ab3c8af7a4bf1927005a94f2582e76"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Ftermshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Ftermshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Ftermshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homeport%2Ftermshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homeport","download_url":"https://codeload.github.com/homeport/termshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"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":["ansi-colors","cli","screenshot","shell","terminal"],"created_at":"2024-08-01T06:01:32.900Z","updated_at":"2025-05-15T17:08:19.205Z","avatar_url":"https://github.com/homeport.png","language":"Go","funding_links":[],"categories":["命令行工具","Go","cli","Command Line Tools"],"sub_categories":["Other"],"readme":"# termshot\n\n[![License](https://img.shields.io/github/license/homeport/termshot.svg)](https://github.com/homeport/termshot/blob/main/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/homeport/termshot)](https://goreportcard.com/report/github.com/homeport/termshot)\n[![Tests](https://github.com/homeport/termshot/workflows/Tests/badge.svg)](https://github.com/homeport/termshot/actions?query=workflow%3A%22Tests%22)\n[![Codecov](https://img.shields.io/codecov/c/github/homeport/termshot/main.svg)](https://codecov.io/gh/homeport/termshot)\n[![Go Reference](https://pkg.go.dev/badge/github.com/homeport/termshot.svg)](https://pkg.go.dev/github.com/homeport/termshot)\n[![Release](https://img.shields.io/github/release/homeport/termshot.svg)](https://github.com/homeport/termshot/releases/latest)\n\nGenerate beautiful screenshots of your terminal, from your terminal.\n\n```sh\ntermshot --show-cmd -- lolcat -f \u003c(figlet -f big foobar)\n```\n\nThis command generates this screenshot:\n\n![example](https://github.com/homeport/termshot/assets/3084745/8ef3a713-70d0-49e3-98e4-e340763dc0b8)\n\n## Installation\n\nTo install with Homebrew on macOS or Linux:\n\n```sh\nbrew install homeport/tap/termshot\n```\n\nSee [Releases](https://github.com/homeport/termshot/releases/) for pre-compiled binaries for Darwin and Linux.\n\n## Usage\n\nThis tool reads the console output and renders an output image that resembles a user interface window. It's inspired by some other web-based tools like [carbon.now.sh](https://carbon.now.sh/), and [codekeep.io/screenshot](https://codekeep.io/screenshot). Unlike those tools, `termshot` does not blindly apply syntax highlighting to some provided text; instead it reads the ANSI escape codes (\"rich text\") logged by most command-line tools and uses it to generate a high-fidelity \"screenshot\" of your terminal output.\n\nLike `time`, `watch`, or `perf`, just prefix the command you want to screenshot with `termshot -- `.\n\n```sh\ntermshot -- ls -a\n```\n\nThis will generate an image file called `out.png` in the current directory.\n\n![basic termshot](https://github.com/homeport/termshot/assets/3084745/11b578ee-8106-4e71-a1b8-57bbca4b192f)\n\nIn some cases, if your target command contains _pipes_—there may still be ambiguity, even with `--`. In these cases, wrap your command in double quotes.\n\n```sh\ntermshot -- \"ls -l | grep go\"\n```\n\n![termshot with pipes](https://github.com/homeport/termshot/assets/3084745/5d0dd1ab-820d-46fc-8af7-8a294193c5ca)\n\n### Flags to control the look\n\n#### `--show-cmd`/`-c`\n\nInclude the target command in the screenshot.\n\n```sh\ntermshot --show-cmd -- \"ls -a\"\n```\n\n![termshot that shows command](https://github.com/homeport/termshot/assets/3084745/3fbdd952-785d-4865-b216-f33bdaceb4da)\n\n#### `--columns`/`-C`\n\nEnforce that screenshot is wrapped after the provided number of columns. Use this flag to make sure that the screenshot does not exceed a certain horizontal length.\n\n#### `--no-decoration`\n\nDo not draw window decorations (minimize, maximize, and close button).\n\n#### `--no-shadow`\n\nDo not draw window shadow.\n\n### Flags for output related settings\n\n#### `--clipboard`/`-b` (only on selected platforms)\n\nDo not create an output file with the screenshot, but save the screenshot image into the operating system clipboard.\n\n_Note:_ Only available on some platforms. Check `termshot` help to see if flag is available.\n\n#### `--filename`/`-f`\n\nSpecify a path where the screenshot should be generated. This can be an absolute path or a relative path; relative paths will be resolved relative to the current working directory.\n\n```sh\ntermshot -- \"ls -a\" # defaults to \u003ccwd\u003e/out.png\ntermshot --filename my-image.png -- \"ls -a\"\ntermshot --filename screenshots/my-image.png -- \"ls -a\"\ntermshot --filename /Desktop/my-image.png -- \"ls -a\"\n```\n\nDefaults to `out.png`.\n\n### Flags to control content\n\n#### `--edit`/`-e`\n\nEdit the output before generating the screenshot. This will open the rich text output in the editor configured in `$EDITOR`, using `vi` as a fallback. Use this flag to remove unwanted or sensitive output.\n\n```sh\ntermshot --edit -- \"ls -a\"\n```\n\n### Miscellaneous flags\n\n#### `--version`/`-v`\n\nPrint the version of `termshot` installed.\n\n```sh\n$ termshot --version\ntermshot version 0.2.5\n```\n\n![out](https://github.com/homeport/termshot/assets/3084745/3fbdd952-785d-4865-b216-f33bdaceb4da)\n\n### Multiple commands\n\nIn order to work, `termshot` uses a pseudo terminal for the command to be executed. For advanced use cases, you can invoke a fully interactive shell, run several commands, and capture the entire output. The screenshot will be created once you terminate the shell.\n\n```sh\ntermshot /bin/zsh\n```\n\n\u003e _Please note:_ This project is work in progress. Although a lot of the ANSI sequences can be parsed, there are definitely commands in existence that create output that cannot be parsed correctly, yet. Also, commands that reset the cursor position are known to create issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeport%2Ftermshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomeport%2Ftermshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomeport%2Ftermshot/lists"}