{"id":26648927,"url":"https://github.com/indaco/semver-cli","last_synced_at":"2025-03-25T00:47:21.924Z","repository":{"id":284065888,"uuid":"953704006","full_name":"indaco/semver-cli","owner":"indaco","description":"A simple CLI to manage semantic versioning using a .version file.","archived":false,"fork":false,"pushed_at":"2025-03-24T01:18:11.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T01:23:27.412Z","etag":null,"topics":["cli","go","golang","semantic-versioning","semver","versioning"],"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/indaco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2025-03-23T23:53:13.000Z","updated_at":"2025-03-24T01:18:14.000Z","dependencies_parsed_at":"2025-03-24T01:23:33.041Z","dependency_job_id":"edbd5198-6416-4a4a-a21a-034b18e13567","html_url":"https://github.com/indaco/semver-cli","commit_stats":null,"previous_names":["indaco/semver-cli"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fsemver-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fsemver-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fsemver-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indaco%2Fsemver-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indaco","download_url":"https://codeload.github.com/indaco/semver-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245377955,"owners_count":20605375,"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","go","golang","semantic-versioning","semver","versioning"],"created_at":"2025-03-25T00:47:21.435Z","updated_at":"2025-03-25T00:47:21.900Z","avatar_url":"https://github.com/indaco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ccode\u003esemver\u003c/code\u003e\n\u003c/h1\u003e\n\u003ch2 align=\"center\" style=\"font-size: 1.5rem;\"\u003e\n  A simple CLI to manage semantic versioning using a \u003ci\u003e.version\u003c/i\u003e file.\n\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/indaco/semver-cli/actions/workflows/ci.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/indaco/semver-cli/actions/workflows/ci.yml/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/indaco/semver-cli?branch=main\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/github/indaco/semver-cli/badge.svg?branch=main\" alt=\"Coverage Status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/indaco/semver-cli\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/indaco/semver-cli\" alt=\"Go Report Card\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://badge.fury.io/gh/indaco%2Fsemver-cli\"\u003e\n    \u003cimg src=\"https://badge.fury.io/gh/indaco%2Fsemver-cli.svg\" alt=\"version\" height=\"18\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/indaco/semver-cli\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://pkg.go.dev/badge/github.com/indaco/semver-cli.svg\" alt=\"Go Reference\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/indaco/semver-cli/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-mit-blue?style=flat-square\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.jetify.com/devbox/docs/contributor-quickstart/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://www.jetify.com/img/devbox/shield_moon.svg\" alt=\"Built with Devbox\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## 📖 Table of Contents\n\n- [✨ Features](#-features)\n- [💻 Installation](#-installation)\n- [🛠️ CLI Commands \u0026 Options](#️-cli-commands--options)\n- [⚙️ Configuration](#️-configuration)\n- [🛠 Auto-initialization](#-auto-initialization)\n- [🚀 Usage](#-usage)\n- [🤝 Contributing](#-contributing)\n- [🆓 License](#-license)\n\n## ✨ Features\n\n- Bump patch, minor, or major versions\n- Add or update pre-release labels (`alpha`, `beta.1`, etc.)\n- Auto-increment pre-release versions\n- Show current version\n\n## 💻 Installation\n\n#### Option 1: Install via `go install` (global)\n\n```bash\ngo install github.com/indaco/semver-cli/cmd/semver@latest\n```\n\n#### Option 2: Install via `go install` (tool)\n\nWith Go 1.24 or greater installed, you can install `semver` locally in your project by running:\n\n```bash\ngo get -tool github.com/indaco/semver-cli/cmd/semver@latest\n```\n\nOnce installed, use it with\n\n```bash\ngo tool semver\n```\n\n#### Option 3: Prebuilt binaries\n\nDownload the pre-compiled binaries from the [releases page](https://github.com/indaco/semver/releases) and place the binary in your system’s PATH.\n\n#### Option 4: Clone and build manually\n\n```bash\ngit clone https://github.com/indaco/semver-cli.git\ncd semver-cli\nmake install # or task install\n```\n\n## 🛠️ CLI Commands \u0026 Options\n\n```bash\nNAME:\n   semver - Manage semantic versioning with a .version file\n\nUSAGE:\n   semver [global options] [command [command options]]\n\nVERSION:\n   v0.1.1\n\nCOMMANDS:\n   patch    Increment patch version\n   minor    Increment minor version and reset patch\n   major    Increment major version and reset minor and patch\n   pre      Set pre-release label (e.g., alpha, beta.1)\n   show     Display current version\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --path value, -p value  Path to .version file (default: \".version\")\n   --help, -h              show help\n   --version, -v           print the version\n```\n\n## ⚙️ Configuration\n\nThe CLI determines the `.version` path in the following order:\n\n1. `--path` flag\n2. `SEMVER_PATH` environment variable\n3. `.semver.yaml` file\n4. Fallback: `.version` in the current directory\n\n**Example: Use Environment Variable**\n\n```bash\nexport SEMVER_PATH=./my-folder/.version\nsemver patch\n```\n\n**Example: Use .semver.yaml**\n\n```bash\n# .semver.yaml\npath: ./my-folder/.version\n```\n\nIf both are missing, the CLI uses .version in the current directory.\n\n## 🛠 Auto-initialization\n\nIf the `.version` file does not exist when running the CLI:\n\n1. It tries to read the latest Git tag via `git describe --tags`.\n2. If the tag is a valid semantic version, it is used.\n3. Otherwise, the file is initialized to 0.1.0.\n\nThis ensures your project always has a starting point.\n\n## 🚀 Usage\n\n**Show the current version**\n\n```bash\n# .version = 1.2.3\nsemver show\n# =\u003e 1.2.3\n```\n\n**Bump patch version**\n\n```bash\n# .version = 1.2.3\nsemver patch\n# =\u003e 1.2.4\n```\n\n**Bump minor version (and reset patch to 0)**\n\n```bash\n# .version = 1.2.3\nsemver minor\n# =\u003e 1.3.0\n```\n\n**Bump major version (and reset minor/patch to 0)**\n\n```bash\n# .version = 1.2.3\nsemver major\n# =\u003e 2.0.0\n```\n\n**Set a pre-release label**\n\n```bash\n# .version = 0.2.1\nsemver pre --label alpha\n# =\u003e 0.2.2-alpha\n```\n\nIf a pre-release is already present, it’s replaced:\n\n```bash\n# .version = 0.2.2-beta.3\nsemver pre --label alpha\n# =\u003e 0.2.2-alpha\n```\n\n**Auto-increment pre-release label**\n\n```bash\n# .version = 1.2.3-alpha.1\nsemver pre --label alpha --inc\n# =\u003e 1.2.3-alpha.2\n```\n\n```bash\n# .version = 1.2.3\nsemver pre --label alpha --inc\n# =\u003e 1.2.3-alpha.1\n```\n\n## 🤝 Contributing\n\nContributions are welcome!\n\nSee the [Contributing Guide](/CONTRIBUTING.md) for setting up the development tools.\n\n## 🆓 License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findaco%2Fsemver-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findaco%2Fsemver-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findaco%2Fsemver-cli/lists"}