{"id":15171813,"url":"https://github.com/lpsm-dev/drprune","last_synced_at":"2026-02-15T16:01:32.302Z","repository":{"id":38112057,"uuid":"446130198","full_name":"lpsm-dev/drprune","owner":"lpsm-dev","description":"🤖 [Community Project] - Prune old images on GitHub and GitLab container registry","archived":false,"fork":false,"pushed_at":"2024-01-08T16:58:38.000Z","size":765,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T15:12:18.011Z","etag":null,"topics":["cleanup","cleanup-script","cli-app","cli-deployment","cli-tool","devops","devops-tools","github","github-registry","gitlab","gitlab-registry","go-cli","go-cobra","hacktoberfest","registry"],"latest_commit_sha":null,"homepage":"https://github.com/lpmatos/drprune","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/lpsm-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-09T15:40:06.000Z","updated_at":"2023-08-14T15:00:37.000Z","dependencies_parsed_at":"2024-06-21T02:04:37.917Z","dependency_job_id":"f9b7c0a1-e2b6-42a4-81ff-e5488027cc64","html_url":"https://github.com/lpsm-dev/drprune","commit_stats":{"total_commits":193,"total_committers":6,"mean_commits":"32.166666666666664","dds":0.6580310880829016,"last_synced_commit":"b9f82f2542ce36be5554920cf9c90df4b8fcd9af"},"previous_names":["ci-monk/drprune","lpmatos/drprune","lpmatos/ghcr-prune"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lpsm-dev/drprune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpsm-dev%2Fdrprune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpsm-dev%2Fdrprune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpsm-dev%2Fdrprune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpsm-dev%2Fdrprune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpsm-dev","download_url":"https://codeload.github.com/lpsm-dev/drprune/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpsm-dev%2Fdrprune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29483283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T15:33:17.885Z","status":"ssl_error","status_checked_at":"2026-02-15T15:32:53.698Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cleanup","cleanup-script","cli-app","cli-deployment","cli-tool","devops","devops-tools","github","github-registry","gitlab","gitlab-registry","go-cli","go-cobra","hacktoberfest","registry"],"created_at":"2024-09-27T09:04:07.523Z","updated_at":"2026-02-15T16:01:32.012Z","avatar_url":"https://github.com/lpsm-dev.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg alt=\"gif-header\" src=\"https://github.com/lpmatos/personal-resume/blob/main/assets/coding.gif\" width=\"225\"/\u003e\n\n\u003ch2\u003e✨ Prune container images in a CLI way ✨\u003c/h2\u003e\n\n[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)]()\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)]()\n[![GitHub repo size](https://img.shields.io/github/repo-size/lpmatos/ghcr-prune)](https://github.com/lpmatos/ghcr-prune)\n\n---\n\n\u003cimg alt=\"gif-about\" src=\"https://github.com/lpmatos/personal-resume/blob/main/assets/hey.gif\" width=\"300\"/\u003e\n\n\u003cp\u003eA CLI tool that prune old images on GitHub (ghcr.io) registry and GitLab (registry.gitlab.com) registry\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#description\"\u003eDescription\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#concepts\"\u003eConcepts\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;|\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003ca href=\"#versioning\"\u003eVersioning\u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\n## ➤ Getting Started \u003ca name = \"getting-started\"\u003e\u003c/a\u003e\n\nIf you want contribute on this project, first you need to make a **git clone**:\n\n```bash\ngit clone --depth 1 https://github.com/ci-monk/drprune.git -b main\n```\n\nThis will give you access to the code on your **local machine**.\n\n## ➤ Usage \u003ca name = \"usage\"\u003e\u003c/a\u003e\n\n**Variables**\n\n| Environment  \t| Description                   \t|\n|--------------\t|-------------------------------\t|\n| GH_TOKEN     \t| GitHub API Token              \t|\n| GH_USERNAME  \t| GitHub User/Organization Name \t|\n| GH_CONTAINER \t| GitHub Container Name         \t|\n| GL_TOKEN     \t| GitLab API Token              \t|\n| GL_NAMESPACE \t| GitLab Namespace              \t|\n\n### CLI\n\n**GitHub**\n\n```bash\ndrprune gh images -t $GH_TOKEN -n \u003cusername\u003e -c \u003ccontainer-name\u003e\ndrprune gh insights -t $GH_TOKEN -n \u003cusername\u003e\n```\n\n**GitLab**\n\n```bash\ndrprune gl images -t $GL_TOKEN -ns \u003cnamespace\u003e\ndrprune gl insights -t $GL_TOKEN -ns \u003cnamespace\u003e\n```\n\n### CI\n\n**GitHub Actions**\n\n```yaml\n\n```\n\n**GitLab CI**\n\n```yaml\n\n```\n\n## ➤ Installation \u003ca name = \"installation\"\u003e\u003c/a\u003e\n\nwith `go`:\n\n```bash\n# if you cannot install directly, try following command,\n# then input install command again\ngo get -u github.com/lpmatos/drprune/cmd/drprune\n\n# or\ngo get -v ./...\ngo run ./cmd/drprune/main.go --help\n```\n\nwith `brew`:\n\n```bash\nbrew tap ci-monk/tools\nbrew install drprune\n```\n\n## ➤ Concepts \u003ca name = \"concepts\"\u003e\u003c/a\u003e\n\n### Cobra\n\nCobra is a CLI framework for Golang. Using it you can speed up your development and creating a powerful and modern CLI application. Cobra is built on a structure of commands, arguments and flags:\n\n- Commands represent actions.\n- Args are things.\n- Flags are modifiers for those actions.\n\nThe best applications will read like sentences when used. Users will know how to use the application because they will natively understand how to use it. This pattern is: `APPCLI VERB NOUN --ADJECTIVE` or `APPCLI COMMAND ARG --FLAG`.\n\n#### Commands\n\nCommand is the central point of the application. Each interaction thar the application supports will be contained in a command. We can create commands with children commands and optionally run an `action`. In the example above, `server` is the command.\n\n#### Flags\n\nA flag is a way to modify the behavior of a command. Cobra supports fully POSIX-compliant flags as well the Go flag package. A Cobra command can define flags that persist through to children commands and flags that are only available to that command. In the example above, `port` is the flag.\n\n## ➤ Learnings \u003ca name = \"learnings\"\u003e\u003c/a\u003e\n\n- Create a Golang CLI application.\n- Create a multistage Golang Dockerfile.\n- Create a docker-compose file with waiting entrypoint.\n- Setup a Golang Releaser publish pipeline using github actions.\n- Understand how GiHub works with packages.\n- Understand how GitLab works with packages.\n- Handler operations in GitHub API to delete container images using a SDK.\n- Handler operations in GitLab API to delete container images using a SDK.\n\n## ➤ Links \u003ca name = \"links\"\u003e\u003c/a\u003e\n\n- https://github.com/pterm/pterm\n- https://github.com/jedib0t/go-pretty\n- https://github.com/charmbracelet/glamour\n- https://github.com/charmbracelet/bubbles\n- https://github.com/charmbracelet/bubbletea\n\n## ➤ Versioning \u003ca name = \"versioning\"\u003e\u003c/a\u003e\n\nTo check the change history, please access the [**CHANGELOG.md**](CHANGELOG.md) file.\n\n## ➤ Project status \u003ca name = \"project-status\"\u003e\u003c/a\u003e\n\nThe project is currently being updated! 👾\n\n## ➤ Donations \u003ca name = \"donations\"\u003e\u003c/a\u003e\n\nIf my work has impacted your life in a positive way and you'd like to buy me a coffee (or a hundred), that'd be much appreciated!\n\n## ➤ Show your support \u003ca name = \"show-your-support\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nGive me a ⭐️ if this project helped you!\n\n\u003cimg alt=\"gif-header\" src=\"https://www.icegif.com/wp-content/uploads/baby-yoda-bye-bye-icegif.gif\" width=\"225\"/\u003e\n\nMade with 💜 by [me](https://github.com/lpmatos) 👋 inspired on [readme-md-generator](https://github.com/kefranabg/readme-md-generator)\n\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpsm-dev%2Fdrprune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpsm-dev%2Fdrprune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpsm-dev%2Fdrprune/lists"}