Git Product home page Git Product logo

komac's Introduction

Komac logoKomac - Another WinGet Manifest Creator Komac banner

GitHub release (release name instead of tag name) GitHub Repo stars Issues License

Komac is an advanced CLI designed to create manifests for the WinGet Community Repository.

Komac is both blazingly fast ๐Ÿ”ฅ and incredibly low on memory, using just ~3.5MB of memory on my machine.

Komac-demo

Installation

Komac is cross-platform and binaries are built for Windows, Linux, and macOS.

Windows

Both portable EXEs and installers are available from the releases.

WinGet

winget install komac

Scoop

scoop install komac

Linux

Portable binaries are available from the releases. Debian installers (.deb) are also available.

macOS

Portable binaries for macOS are available from the releases.

Homebrew

brew install russellbanks/tap/komac

GitHub Token

Komac is currently only able to use a classic token. Whilst Komac can fully create manifests and commit with a fine-grained token, it fails to create a pull request to winget-pkgs. This may change as fine-grained tokens improve. See #310.

Classic

A classic token with the public_repo scope.

firefox_IYiqtsd0Nl

Commands

Command Description Usage
New Create a package from scratch new
Update Update a pre-existing package in winget-pkgs update
Remove Remove a version from winget-pkgs remove
Branch Cleanup Deletes branches that have had a merged or closed pull request to winget-pkgs cleanup
Token update Update stored GitHub OAuth token token update
Token remove Delete stored GitHub OAuth token token remove

Update an existing package with a new version

komac update -i Package.Identifier -v 1.2.3 --urls https://www.firstUrl.com https://www.secondUrl.com --submit
Parameter Usage Notes
Package Identifier --identifier
Version --version
URLs --urls URLs are delimited by a space
Automatically submit --submit
Token (if one is not already stored) --token Komac will check for a GITHUB_TOKEN environment variable

Komac vs other tools ๐Ÿ†

While other manifest creation tools have made remarkable strides in the winget-pkgs community, their development pace is notably slow and lacks the advanced detection capabilities that come with Komac.

Komac WingetCreate YamlCreate
Parameters โœ… โœ… โŒ
Works without Git โœ… โœ… โŒ
Optimised manifest ordering 1 โœ… โœ…๏ธ โœ…
Fully cross-platform โœ… โŒ Limited
Full MSI value retrieval โœ… Partial Partial
Linux & macOS MSI support โœ… โŒ โŒ
Full MSIX value retrieval โœ… Partial Partial - Trenly/winget-pkgs#180
Get information from GitHub โœ… โŒ โŒ
Formatted GitHub release notes retrieval โœ… โŒ โŒ
Release date identification โœ… โŒ โŒ
No telemetry โœ… โญ• 2 โœ…
Fully standalone (w/o winget-pkgs clone) โœ… โœ… โŒ
Type-safety โœ… โœ… โŒ
Inno setup detection โœ… 3 โœ… โœ… 4
Nullsoft detection โœ… 3 โœ… โœ… 4
Burn installer detection โœ… 3 โœ… Opt-in feature (not enabled by default due to slow processing)
Progress bar & ETA while downloading โœ… โŒ โŒ
Programming Language Rust C# PowerShell

Usage with GitHub Actions: WinGet Releaser ๐ŸŒŸ

WinGet Releaser is a GitHub Action that invokes Komac, passing in your release's URLs. This completely automates publishing to WinGet.

Example ๐Ÿ“

name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v2
        with:
          identifier: Package.Identifier
          token: ${{ secrets.WINGET_TOKEN }}
          # installers-regex: '\.exe$' # Only .exe files

Alternative actions ๐Ÿ”„

How can I support Komac? โค๏ธ

  • ๐Ÿค Sponsor this project through GitHub Sponsors
  • โญ Star this project! :)
  • ๐Ÿง‘โ€๐Ÿ’ป Use Komac and create an issue for feature requests or bugs.

Star History โญ

Star History Chart

License

GNU GPLv3 Logo

Komac is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Footnotes

  1. If all installers have the same value, that value is put at the root of the manifest to reduce redundancy. โ†ฉ

  2. Telemetry is enabled by default in WingetCreate. Use wingetcreate settings to manually disable telemetry. โ†ฉ

  3. There is much more accurate detection for Inno, Nullsoft, and Burn installers since Komac v2. โ†ฉ โ†ฉ2 โ†ฉ3

  4. The logic for this was contributed by me :) Check issues that I've opened to request this feature for YamlCreate. โ†ฉ โ†ฉ2

komac's People

Contributors

allcontributors[bot] avatar github-actions[bot] avatar jackdevey avatar michidk avatar renovate[bot] avatar russellbanks avatar ste93cry avatar vedantmgoyal9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

komac's Issues

[Feature/Idea]: Use `CI` environment variable to detect interactivity

What would you like to see changed/added?

Use CI environment variable to detect whether Komac is running in an interactive environment or an unattended environment like GitHub Actions, etc... We should throw an error when running unattended or else re-prompt when an incorrect value is entered.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • base16ct 0.2.0
  • base64ct 1.6.0
  • bitflags 2.5.0
  • camino 1.1.6
  • chrono 0.4.38
  • clap 4.5.4
  • color-eyre 0.6.3
  • const_format 0.2.32
  • crossterm 0.27.0
  • cynic 3.7.0
  • derive_more 0.99.17
  • futures 0.3.30
  • futures-util 0.3.30
  • heapless 0.8.0
  • indexmap 2.2.6
  • indicatif 0.17.8
  • inquire 0.7.5
  • itertools 0.12.1
  • keyring 2.3.2
  • memmap2 0.9.4
  • msi 0.7.0
  • num-traits 0.2.18
  • num_cpus 1.16.0
  • nutype 0.4.2
  • object 0.35.0
  • open 5.1.2
  • ordinal 0.3.2
  • oxilangtag 0.1.5
  • package-family-name 1.1.0
  • percent-encoding 2.3.1
  • pulldown-cmark 0.10.3
  • quick-xml 0.31.0
  • rand 0.8.5
  • reqwest 0.12.4
  • serde 1.0.199
  • serde_json 1.0.116
  • serde_with 3.8.0
  • serde_yaml 0.9.34
  • sha2 0.10.8
  • strum 0.26.2
  • tempfile 3.10.1
  • thiserror 1.0.59
  • tokio 1.37.0
  • url 2.5.0
  • uuid 1.8.0
  • versions 6.2.0
  • zip 1.1.2
  • indoc 2.0.5
  • rstest 0.19.0
  • sha1 0.10.6
  • cynic-codegen 3.7.0
  • windows_exe_info 0.4.2
github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • moonrepo/setup-rust v1
.github/workflows/release.yml
  • actions/checkout v4
  • moonrepo/setup-rust v1
  • softprops/action-gh-release v2
  • vedantmgoyal2009/winget-releaser v2
  • crazy-max/ghaction-virustotal v4
  • actions/checkout v4
  • moonrepo/setup-rust v1
.github/workflows/update-graphql-schema.yml
  • actions/checkout v4
  • peter-evans/create-pull-request v6
.github/workflows/update-inno-dependencies.yml
  • actions/checkout v4
  • peter-evans/create-pull-request v6

  • Check this box to trigger a request for Renovate to run again on this repository

[Feature/Idea]: Add command to delete token

What would you like to see changed/added?

Currently, we can only add/change tokens. There should also be komac token <clear|delete> command to erase token stored on computer, because one might want to due to security reasons.

[Bug]: "No applicable upgrade found" for Komac

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I can't seem to upgrade Komac from Winget, as I get the "No applicable upgrade found." when it clearly shows an upgrade is available:
image

Any pointers for this?

[Bug]: Non-critical error on Winget Releaser action

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

See https://github.com/twpayne/chezmoi/actions/runs/4204060275/jobs/7294228081#step:2:13:

Exception in thread "Timer-0" java.lang.IllegalArgumentException: length must be 2 or greater, was 1
  	at com.github.ajalt.colormath.transform.InterpolateKt.sequence(Interpolate.kt:158)
  	at com.github.ajalt.mordant.widgets.ProgressBar.makeComplete(ProgressBar.kt:107)
  	at com.github.ajalt.mordant.widgets.ProgressBar.render(ProgressBar.kt:86)
  	at com.github.ajalt.mordant.widgets.Padded.render(Padding.kt:99)
  	at com.github.ajalt.mordant.table.TableRenderer.<init>(Table.kt:246)
  	at com.github.ajalt.mordant.table.TableImpl.render(Table.kt:121)
  	at com.github.ajalt.mordant.rendering.Widget$DefaultImpls.render$default(Widget.kt:7)
  	at com.github.ajalt.mordant.animation.Animation.update(Animation.kt:76)
  	at com.github.ajalt.mordant.animation.ProgressAnimation.tick(ProgressAnimation.kt:164)
  	at com.github.ajalt.mordant.animation.ProgressAnimation.access$tick(ProgressAnimation.kt:91)
  	at com.github.ajalt.mordant.animation.ProgressAnimation$start$1.invoke(ProgressAnimation.kt:154)
  	at com.github.ajalt.mordant.animation.ProgressAnimation$start$1.invoke(ProgressAnimation.kt:153)
  	at com.github.ajalt.mordant.animation.JvmTicker$start$$inlined$timer$default$1.run(Timer.kt:[14](https://github.com/twpayne/chezmoi/actions/runs/4204060275/jobs/7294228081#step:2:15)9)
  	at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
  	at java.base/java.util.TimerThread.run(Timer.java:516)
  Exception in thread "Timer-2" java.lang.IllegalArgumentException: length must be 2 or greater, was 1
  	at com.github.ajalt.colormath.transform.InterpolateKt.sequence(Interpolate.kt:[15](https://github.com/twpayne/chezmoi/actions/runs/4204060275/jobs/7294228081#step:2:16)8)
  	at com.github.ajalt.mordant.widgets.ProgressBar.makeComplete(ProgressBar.kt:107)
  	at com.github.ajalt.mordant.widgets.ProgressBar.render(ProgressBar.kt:86)
  	at com.github.ajalt.mordant.widgets.Padded.render(Padding.kt:99)
  	at com.github.ajalt.mordant.table.TableRenderer.<init>(Table.kt:246)
  	at com.github.ajalt.mordant.table.TableImpl.render(Table.kt:121)
  	at com.github.ajalt.mordant.rendering.Widget$DefaultImpls.render$default(Widget.kt:7)
  	at com.github.ajalt.mordant.animation.Animation.update(Animation.kt:76)
  	at com.github.ajalt.mordant.animation.ProgressAnimation.tick(ProgressAnimation.kt:[16](https://github.com/twpayne/chezmoi/actions/runs/4204060275/jobs/7294228081#step:2:17)4)
  	at com.github.ajalt.mordant.animation.ProgressAnimation.access$tick(ProgressAnimation.kt:91)
  	at com.github.ajalt.mordant.animation.ProgressAnimation$start$1.invoke(ProgressAnimation.kt:154)
  	at com.github.ajalt.mordant.animation.ProgressAnimation$start$1.invoke(ProgressAnimation.kt:153)
  	at com.github.ajalt.mordant.animation.JvmTicker$start$$inlined$timer$default$1.run(Timer.kt:149)
  	at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
  	at java.base/java.util.TimerThread.run(Timer.java:516)

It worked normally afterwards, though. But this might be important, so I'm making an issue here. Related to #87 perhaps (same package)?

[Bug]: Scope is removed when updating Google.Chrome

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Yep I've actually already got it installed and I used it recently to update the Google.Chrome manifest. I did notice that it didn't keep the scope values when updating so I had to do that by hand. I was actually planning on making an issue or letting Russell know directly but I've been busy with a new job lol

Reported by @warshanks to me in personal chat

[Bug]: `komac new` if you don't fill some of the optional fields at the start komac will abruptly stop without error

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Recording 2023-05-21 114924.webm
This can be worked around by filling all optional fields up to this point and then just saving the manifest locally to manually delete anything unnecessary. I've had this happen with packages of any InstallerType, so I think the cause is that there is a required field that is not labeled as required.
Additionally the scope and upgradebehavior dialogues do not have the [Confirm] button to skip them.

[Bug]: Token validity check should be synchronous

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Whenever I try to run new or update commands, token validity checks obstruct the package identifier prompt, which is bad in terms of UX.

Instead, of checking in the background, we can display some kind of animation like a loading circle, and after validation checks are complete, we can ask for a package identifier, or token if the current token is invalid.

image

[Feature/Idea]: Komac should warn/avoid creating invalid manifests

What would you like to see changed/added?

There are a couple specific cases where komac generates invalid manifests when updating currently:

[Bug]: Installer URLs mismatch

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Tried to run this command:

Komac update --id Microsoft.OpenSSH.Beta --version 9.2.2.0 --urls https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-ARM64-v9.2.2.0.msi,https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-Win32-v9.2.2.0.msi,https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-Win64-v9.2.2.0.msi

As you can see, the installer URLs are mismatched:
image

[Feature/Idea]: Allow to set custom commit user and email

What would you like to see changed/added?

https://docs.github.com/en/rest/git/commits?apiVersion=2022-11-28#create-a-commit

The GitHub REST API allows setting custom commit names and emails. GitHub Codespaces use $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL environment variables.

image

So, if both of the above variables are set in the environment, we can add their value to the REST API request, else, use omit them so that the API will use the default name & email associated with the GitHub token supplied.

[Bug]: Komac incorrectly using arm64 binary for x64 architecture

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711

Executing command: java -jar komac.jar update --id 'ArmCord.ArmCord' --version 3.2.0 --urls 'https://github.com/ArmCord/ArmCord/releases/download/v3.2.0/ArmCord.Setup.3.2.0.ARM64.exe,https://github.com/ArmCord/ArmCord/releases/download/v3.2.0/ArmCord.Setup.3.2.0.exe' --submit
  CI environment detected! Komac will throw errors instead of prompting on invalid input
  Found ArmCord.ArmCord in the winget-pkgs repository
  Found latest version: 3.1.7
  # Created with WinGet Releaser v2 using Komac v1.6.0
  # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.4.0.schema.json
  
  PackageIdentifier: ArmCord.ArmCord
  PackageVersion: 3.2.0
  InstallerType: nullsoft
  Scope: user
  UpgradeBehavior: install
  ReleaseDate: 2023-05-[14](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:15)
  Installers:
  - Architecture: x64
    InstallerUrl: https://github.com/ArmCord/ArmCord/releases/download/v3.2.0/ArmCord.Setup.3.2.0.ARM64.exe
    InstallerSha256: 8AB84F27C7284E0FC55E549CED81DD9B8AE2EB9FD[20](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:21)4DC44614835929C7DE9DE
  - Architecture: arm64
    InstallerUrl: https://github.com/ArmCord/ArmCord/releases/download/v3.2.0/ArmCord.Setup.3.2.0.ARM64.exe
    InstallerSha[25](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:26)6: 8AB84F[27](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:28)C7[28](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:29)4E0FC55E549CED81DD9B8AE2EB9FD204DC446148359[29](https://github.com/ArmCord/ArmCord/actions/runs/4972653487/jobs/8897984711#step:2:30)C7DE9DE
  ManifestType: installer
  ManifestVersion: 1.4.0

The second URL doesn't get used, and the arm64 link was incorrectly provided in the x64 arch.

[Bug]: False positive virus?

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Tried v1.0.2 today, and upon running Komac, this happened:

image

Any way we can mitigate this?

[Bug]: Wrong arch detection

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Using Komac new. Komac did not prompt for arch but incorrectly detected it:
image

[Bug]: Failed to create pull request

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

https://github.com/coreybutler/nvm-windows/actions/runs/4685243965/jobs/8313882263#step:2:94

Found forked winget-pkgs repository: coreybutler/winget-pkgs
  Failed to create pull request
  node:internal/errors:841
    const err = new Error(message);
                ^
  
  Error: Command failed: & $env:JAVA_HOME_17_X64\bin\java.exe -jar komac.jar update --id 'CoreyButler.NVMforWindows' --version 1.1.11 --urls 'https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-setup.exe' --submit
      at checkExecSyncError (node:child_process:828:11)
      at execSync (node:child_process:899:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\v2\dist\index.js:77:39
      at processTicksAndRejections (node:internal/process/task_queues:[96](https://github.com/coreybutler/nvm-windows/actions/runs/4685243965/jobs/8313882263#step:2:97):5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 2592,
    stdout: null,
    stderr: null
  }

[Bug]: Detects existing token on first-run

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Komac detects GitHub token, even when installed first-time on a machine:
image

Ideally, it should display -

No existing token found. 

Please enter a GitHub token: <token-input>

[Bug]: Issues in non-Windows platforms

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Here's a checklist:

  • Incorrect detection of MSI values
Details (original comment)

Inside WSL:
image

The product code is incorrect, and the InstallerType is also replaced from wix to msi. Here is the correct entry, as shown in Windows. It even has some additional entries:
image

  • Komac does not remember/save the entered token

[Bug]: Unicode symbols incorrectly parsed

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

My input for Copyright: Copyright ยฉ 2022
What was written to the manifest: Copyright \0 2022
image

[Bug]: Komac not on path after "winget install komac"?

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I installed Komac using WinGet:

winget install komac

However, it wasn't added to PATH. I must navigate to

C:\Users\<username>\AppData\Local\Komac\

in order to run it.

Is this the expected behaviour of the installer?

[Bug]: The number of unique installer urls is greater than the number of previous manifest urls

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Hi,
with the latest vim.vim releases, it fails with the mentioned error message: "The number of unique installer urls is greater than the number of previous manifest urls"

Don't know what this means :/

https://github.com/vim/vim-win32-installer/actions/runs/5339923565/jobs/9679145176

I am not sure if this is related, but apparently the latest released winget-packages version used the same installer for x86 as well as x64 which looks wrong. https://github.com/microsoft/winget-pkgs/blob/master/manifests/v/vim/vim/9.0.1632/vim.vim.installer.yaml

[Bug]: Problems with checkbox inputs

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

These inputs are optional, but I am forced to select an option here:
image

This one seems to be fine, but hitting confirm without selecting anything unexpectedly crashes Komac:
image

[Bug]: Installer Locale?

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

"Locale" seems to be missing in this prompt:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.