{"id":50343071,"url":"https://github.com/kekyo/screw-up-native","last_synced_at":"2026-05-29T18:30:26.765Z","repository":{"id":351893093,"uuid":"1122041169","full_name":"kekyo/screw-up-native","owner":"kekyo","description":"Native CLI that Git versioning metadata dumper/formatter 📝","archived":false,"fork":false,"pushed_at":"2026-04-16T22:49:33.000Z","size":8297,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T18:30:24.442Z","etag":null,"topics":["cli","dump","format","git","metadata","versioning"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":false,"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/kekyo.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T02:22:01.000Z","updated_at":"2026-04-16T22:49:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kekyo/screw-up-native","commit_stats":null,"previous_names":["kekyo/screw-up-native"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kekyo/screw-up-native","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2Fscrew-up-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2Fscrew-up-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2Fscrew-up-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2Fscrew-up-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kekyo","download_url":"https://codeload.github.com/kekyo/screw-up-native/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekyo%2Fscrew-up-native/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33666290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","dump","format","git","metadata","versioning"],"created_at":"2026-05-29T18:30:25.853Z","updated_at":"2026-05-29T18:30:26.744Z","avatar_url":"https://github.com/kekyo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# screw-up-native\n\nNative CLI that Git versioning metadata dumper/formatter.\n\n![screw-up-native](images/screw-up-native-120.png)\n\n[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n----\n\n## What is this?\n\nWouldn't you like to automatically insert calculated version information from Git tags into your source code or text files?\nThis CLI tool is the perfect little knife for the job.\n\n```bash\n# Dump Git repository metadata resolved (JSON)\nscrew-up dump\n\n# Format a template with Git metadata placeholders\necho \"This version is '{version}'\" | screw-up format\n```\n\nVersion numbers are automatically calculated from Git tags and adhere to the [screw-up](https://github.com/kekyo/screw-up/) convention.\nThis calculates the version number by measuring the commit height to the current HEAD based on the last applied version tag.\n\n![git-versioning](./images/git-versioning.png)\n\nYou can use metadata such as version numbers, Git commit hashes, timestamps, and commit messages to format text or output it as JSON:\n\n```json\n{\n  \"git\": {\n    \"tags\": [],\n    \"branches\": [\"develop\"],\n    \"version\": \"1.13.2\",\n    \"commit\": {\n      \"hash\": \"49a4245d6c5ce6604167005f5234c1c4a38a852b\",\n      \"shortHash\": \"49a4245\",\n      \"date\": \"2025-12-05T11:50:38+09:00\",\n      \"message\": \"feat: Added force dump mode.\"\n    }\n  },\n  \"version\": \"1.13.2\",\n  \"buildDate\": \"2025-12-28T17:30:30+09:00\"\n}\n```\n\nThe CLI command is available via Linux packages (Ubuntu/Debian) and prebuilt Windows binaries, making it easy to use.\n\n----\n\n## Installation\n\n[Here is pre-built packages/binaries.](https://github.com/kekyo/screw-up-native/releases)\n\nFor Ubuntu/Debian:\n\n```bash\nsudo apt install ./screw-up-ubuntu-noble-amd64-1.2.3.deb\n```\n\nFor Windows (64/32bit):\n\nExtract zip file (contains single `screw-up.exe` file).\n\n## Dump Command\n\nDump computed metadata as JSON:\n\n```bash\n# Dump current Git repository\nscrew-up dump\n```\n\nAs shown in the following output example, Git commit information is also added:\n\n```json\n{\n  \"git\": {\n    \"tags\": [],\n    \"branches\": [\"develop\"],\n    \"version\": \"1.13.2\",\n    \"commit\": {\n      \"hash\": \"49a4245d6c5ce6604167005f5234c1c4a38a852b\",\n      \"shortHash\": \"49a4245\",\n      \"date\": \"2025-12-05T11:50:38+09:00\",\n      \"message\": \"feat: Added force dump mode.\"\n    }\n  },\n  \"version\": \"1.13.2\",\n  \"buildDate\": \"2025-12-28T17:30:30+09:00\"\n}\n```\n\nThe dump command:\n\n- Shows the final computed metadata after all processing (workspace inheritance, Git metadata, etc.)\n- Useful for debugging and understanding how your package metadata will be resolved\n- Outputs clean JSON that can be piped to other tools (ex: `jq`)\n\n### Options\n\n- `--no-wds`: Disable working directory status check for version increment\n\n### Generic usage\n\nFor example, combine with `jq` to generate a C header that embeds version and commit IDs:\n\n```bash\n# Generate version.h\nscrew-up dump -f | jq -r '\n  \"#pragma once\\n\" +\n  \"#define APP_VERSION \\\"\" + (.version // \"0.0.1\") + \"\\\"\\n\" +\n  \"#define APP_COMMIT \\\"\" + (.git.commit.shortHash // \"unknown\") + \"\\\"\\n\"\n' \u003e version.h\n```\n\n## Format Command\n\nReplace placeholders in text with computed package metadata.\n\nThis command is similar to the dump command, but instead of outputting JSON, it can be used to format text within screw-up.\nTherefore, it might be easier to handle than processing screw-up output with jq:\n\n```bash\n# Format stdin template and print to stdout\necho \"This version is '{version}'\" | screw-up format\n\n# Format a file and write the result to another file\nscrew-up format -i ./template.txt ./output.txt\n\n# Use custom brackets instead of {...}\nscrew-up format -i ./template.txt -b \"#{,}#\"\n```\n\nPlaceholders use `{field}` by default. Dot notation lets you reach nested values such as `{repository.url}` or `{git.commit.hash}`.\n\nInput comes from stdin unless `-i/--input` is provided, and output always goes to stdout; if you pass an output path, the formatted text is also written there.\n\n### Options\n\n- `-i, --input \u003cpath\u003e`: Template file to format (defaults to stdin)\n- `-b, --bracket \u003copen,close\u003e`: Change placeholder brackets (default `{,}`)\n- `--no-wds`: Disable working directory status check for version increment\n\n### Example\n\nFor example, prepare an input text file like the following (`version.h.in`):\n\n```c\n#pragma once\n#define APP_VERSION \"{version}\"\n#define APP_COMMIT \"{git.commit.shortHash}\"\n```\n\nBy entering the following into screw-up, you can generate C language header files:\n\n```bash\nscrew-up format -i ./version.h.in ./version.h\n```\n\n`version.h`:\n\n```c\n#pragma once\n#define APP_VERSION \"1.13.2\"\n#define APP_COMMIT \"49a4245\"\n```\n\n----\n\n## Self building\n\nIn Ubuntu noble:\n\n```bash\nsudo apt install build-essential git gdb libgit2-dev \\\n  cmake make pkg-config ca-certificates\n./build.sh\n```\n\n### Build packages\n\n`build_package.sh` runs `build.sh` inside a cowbuilder chroot with qemu-user-static to target one distro/arch per call. Run it repeatedly for all combinations you need.\n\nPrerequisites:\n\n```bash\nsudo apt-get install cowbuilder qemu-user-static debootstrap systemd-container\n```\n\nBuild examples:\n\n```bash\n# Ubuntu noble / amd64\n./build_package.sh --distro ubuntu --release noble --arch x86_64\n\n# Debian bookworm / arm64\n./build_package.sh --distro debian --release bookworm --arch arm64\n```\n\nNotes:\n- Arch aliases: `x86_64|amd64`, `i686|i386`, `armv7|armhf`, `aarch64|arm64`\n- Debug build: add `--debug` (passes `-d` to `build.sh`)\n- Refresh chroot: add `--refresh-base`\n- Outputs: `artifacts/\u003cdistro\u003e-\u003crelease\u003e-\u003carch\u003e/*.deb`\n\nBatch build for all predefined combos:\n\n```bash\n# ubuntu noble/jammy × amd64/i386/armhf/arm64\n# debian trixie/bookworm × amd64/i386/armhf/arm64\n./build_package_all.sh            # reuse existing bases\n./build_package_all.sh --refresh-base  # rebuild bases then build all\n```\n\n### For windows archive\n\n`build_win32.sh`\n\nPrerequisites:\n\n```bash\nsudo apt install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 \\\n  binutils-mingw-w64-x86-64 binutils-mingw-w64-i686 cmake make pkg-config \\\n  git zip ca-certificates\n```\n\nBuild examples:\n\n```bash\n./build_win32.sh\n```\n\nNotes:\n- Outputs: `artifacts/screw-up-native-windows-\u003carch\u003e-*.zip`\n\n----\n\n## Note\n\nThis project was developed as a successor to [RelaxVersioner](https://github.com/kekyo/RelaxVersioner/).\nAnd [screw-up](https://github.com/kekyo/screw-up/) is related to its sibling.\n\nscrew-up was designed for use in NPM environments and felt sufficiently practical as-is due to its high portability.\nHowever, we discovered that Node.js became somewhat of a hindrance when using it across multiple platforms and architectures.\n\nThat's why we decided to create a native CLI written in pure C and dependent only on libgit2.\n\n## Discussions and Pull Requests\n\nFor discussions, please refer to the [GitHub Discussions page](https://github.com/kekyo/screw-up-native/discussions). We have currently stopped issue-based discussions.\n\nPull requests are welcome! Please submit them as diffs against the `develop` branch and squashed changes before send.\n\n## License\n\nUnder MIT, excepts [libgit2 library (Contains static linking, see libgit2 'COPYING').](https://github.com/libgit2/libgit2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekyo%2Fscrew-up-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkekyo%2Fscrew-up-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekyo%2Fscrew-up-native/lists"}