{"id":25072456,"url":"https://github.com/upcloudltd/progress","last_synced_at":"2026-01-29T10:43:31.865Z","repository":{"id":45319983,"uuid":"512320738","full_name":"UpCloudLtd/progress","owner":"UpCloudLtd","description":"Go module for printing progress/task status of command line applications.","archived":false,"fork":false,"pushed_at":"2024-11-15T11:41:55.000Z","size":50,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-14T22:02:16.064Z","etag":null,"topics":["cli","command-line","commandline","go","golang","library","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/UpCloudLtd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-07-10T01:38:14.000Z","updated_at":"2024-11-15T11:41:57.000Z","dependencies_parsed_at":"2024-06-20T03:04:34.994Z","dependency_job_id":"f8f997aa-90bb-4ebc-9712-387ed67cbf6b","html_url":"https://github.com/UpCloudLtd/progress","commit_stats":null,"previous_names":["kangasta/progress"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fprogress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fprogress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fprogress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fprogress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpCloudLtd","download_url":"https://codeload.github.com/UpCloudLtd/progress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968737,"owners_count":21191158,"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":["cli","command-line","commandline","go","golang","library","terminal"],"created_at":"2025-02-06T22:29:21.384Z","updated_at":"2026-01-29T10:43:31.860Z","avatar_url":"https://github.com/UpCloudLtd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Progress\n\n[![Test](https://github.com/UpCloudLtd/progress/actions/workflows/test.yml/badge.svg)](https://github.com/UpCloudLtd/progress/actions/workflows/test.yml)\n[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/UpCloudLtd/progress/badge)](https://scorecard.dev/viewer/?uri=github.com%2FUpCloudLtd%2Fprogress)\n\nGo module for printing progress/task status of command line applications.\n\n## Installation\n\nTo install this library, use `go get`:\n\n```sh\ngo get github.com/UpCloudLtd/progress\n```\n\n## Usage\n\nTo log progress messages with Progress, you need to\n\n- [Initialize a Progress instance](#initialize-progress)\n- [Push messages to the Progress instance](#push-messages)\n\n### Initialize Progress\n\nTo initialize Progress, run `progress.NewProgress(...)`. This initializes the internal message store and message renderer.\n\nTo start logging the progress messages, call `Start()` to launch goroutine responsible for updating the progress log and handling incoming progress updates.\n\nWhen done with logging progress updates, call `Stop()` to render the final progress log state and to terminate the goroutine started by `Start()`.\n\n```go\ncfg := progress.GetDefaultOutputConfig()\ntaskLog := progress.NewProgress(cfg)\n\ntaskLog.Start()\ndefer taskLog.Stop()\n```\n\n### Push messages\n\nTo push messages to the progress log, call `Push(...)`. For example:\n\n```go\ntaskLog.Push(messages.Update{\n    Key:     \"error-example\",\n    Message: \"Pushing message to the progress log\",\n    Status:  messages.MessageStatusStarted,\n})\n```\n\nAn update can contain four different fields: `Key`, `Message`, `Status`, and `Details`. When updating progress message that does not yet exist, `Message` and `Status` are required.\n\nField   | Description\n------- | -----------\n`Key`     | Used to identify the message when pushing further updates. If not given when pushing first update to the message, value from `Message` field is used as `Key`.\n`Message` | Text to be outputted in the progress log for the related message.\n`Status`  | Status of the message, e.g. `success`, `error`, `warning`. Used to determine status indicator and color. Finished statuses (`success`, `error`, `warning`, `skipped`, `unknown`) are outputted to persistent log and can not be edited anymore.\n`ProgressMessage` | Progress indicator text to be appended into `Message` in TTY terminals, e.g. `128 / 384 kB` or `24 %`. Updating this field will not trigger message write in non-TTY terminals.\n`Details` | Details to be outputted under finished progress log row, e.g. error message.\n\nProgress messages can be updated while they are in `pending` or `started` states. Note that `pending` messages are not outputted at the moment.\n\nWhen updating existing progress message, unchanged fields can be omitted. For example:\n\n```go\ntaskLog.Push(messages.Update{\n    Key:     \"error-example\",\n    Status:  messages.MessageStatusError,\n    Details: \"Error: Message details can be used, for example, to communicate error messages to the user.\",\n})\n```\n\n## Development\n\nUse [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) when committing your changes.\n\nTo lint the code, run `golangci-lint run`. See its documentation for  [local installation instructions](https://golangci-lint.run/usage/install/#local-installation).\n\n```sh\ngolangci-lint run\n```\n\nTo test the code, run `go test ./...`.\n\n```sh\ngo test ./...\n```\n\nTo update snapshots, run tests with `UPDATE_SNAPSHOTS` environment variable set to `true`.\n\n```sh\nUPDATE_SNAPSHOTS=true go test ./...\n```\n\nTo build and run the example application, run:\n\n```sh\ngo build -o example.bin ./example/example.go\n./example.bin\n```\n\n## Releasing\n\nWhen releasing a new version:\n\n1. Merge all changes to be included to the `main` branch.\n1. Prepare [CHANGELOG.md](./CHANGELOG.md) for the new release:\n    1. Add new heading with the correct version (e.g., `## [v2.3.5]`).\n    1. Update links at the bottom of the page.\n    1. Leave `Unreleased` section at the top empty.\n1. Draft a new release in [GitHub releases](https://github.com/UpCloudLtd/progress/releases):\n    1. Set the release to create new tag (e.g., `v2.3.5`).\n    1. Select the stable branch.\n    1. Title the release with the version number (e.g., `v2.3.5`).\n    1. In the description of the release, paste the changes from [CHANGELOG.md](./CHANGELOG.md) for this version release.\n1. Publish the release when ready.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fprogress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupcloudltd%2Fprogress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fprogress/lists"}