micr0-dev / lexido

A terminal assistant, powered by Generative AI
GNU Affero General Public License v3.0
221 stars 8 forks source link

Request to add Lexido to the macOS Homebrew package manager #19

Closed micr0-dev closed 5 months ago

micr0-dev commented 6 months ago

Is your feature request related to a problem? Please describe. The current installation process requires manually downloading the binary or building from source, which can be cumbersome for users who prefer the convenience of package managers like Homebrew.

Describe the solution you'd like I would like Lexido to be available as a Homebrew package. This would allow users to easily install, update, and manage Lexido with simple commands (brew install lexido, brew update, brew upgrade lexido). It will greatly simplify the installation process and enhance the user experience for macOS users.

Describe alternatives you've considered An alternative could be providing an installation script that automates the download and installation process. However, this doesn't provide the same level of integration and ease of use as having Lexido directly available in Homebrew. Additionally, users tend to trust and rely on Homebrew for managing software on macOS, making it a preferred solution.

Additional context Making Lexido available on Homebrew would not only improve accessibility for current users but also potentially increase the user base by making it more discoverable to those searching for tools within the Homebrew ecosystem. This addition would align with our goal of making Lexido readily available and easy to install for as many developers as possible.

swayz8148 commented 5 months ago

If you want I can make one on arch it should work on MacOS. I don't use Brew so I'm not 100% on that ( it's just I've seen this has been open for a while ) I am getting a MacBook soon not sure how long though so if it can't be done on Arch and this is still open I can do it on that for you.

micr0-dev commented 5 months ago

That would be great! Thanks so much!

swayz8148 commented 5 months ago

after way to long i have the pull request open https://github.com/Homebrew/homebrew-core/pull/168214

swayz8148 commented 5 months ago

EDIT: im starting with a new one that i know will work sorry there rules are way to strict for commits

https://github.com/Homebrew/homebrew-core/pull/168216 no errors :)

swayz8148 commented 5 months ago

If anyone is any good with Ruby and wants to help, I'm having an issue with getting Lexido on Homebrew due to their rules.

What I'm attempting to accomplish is to create a test that I expect to fail, similar to what I've done. However, the entire formula is failing because I'm unable to set the API key before running the test command with Lexido.

Here's what I want to achieve:

lexido "test"

I expect to receive an output containing any of the following:

Then, the test should exit with a success code (0) indicating that it was successful. However, I'm not very good with Ruby and am having difficulty in achieving this. I've made 12 commits so far, and 11 have failed on the same check. It's ironic that when I execute brew test lexido on my system, it attempts to use my API key, even when I'm in a distrobox, and I have no clue where the key is located. I've searched in ~/.zshrc and ~/.bashrc.

Here's the current formula code:

class Lexido < Formula
  desc "Innovative assistant for the command-line"
  homepage "https://github.com/micr0-dev/lexido"
  url "https://github.com/micr0-dev/lexido.git", tag: "v1.3.1", revision: "36f02d699f2709f0bd51a5f119e0670845b4ad9f"
  license "AGPL-3.0-or-later"

  depends_on "go" => :build

  def install
    # Build the binary using the default go build command
    system "go", "build", *std_go_args
  end

  test do
   # set fake api key
    ENV["LEXIDO_API_KEY"] = "12309863243987"
    # Run the `lexido` command with the "test" argument
    output = shell_output("#{bin}/lexido test", 1).strip

    # Check if the error message or relevant parts are present in the output
    assert_match "API key not valid", output
    assert_match "HTTP response code 400", output
    assert_match "INVALID_ARGUMENT", output
    assert_match "API_KEY_INVALID", output

    # Exit with success (exit code 0)
    assert_equal 0, $?.exitstatus
  end
end

this is a updated one from my last commit on the PR

if you need it here is where the formula has an error lexido 1.3.1 (new formula) #168216

micr0-dev commented 5 months ago

The key is located in ~/.lexido/keyring.json

micr0-dev commented 5 months ago

I think I found the issue!!!

micr0-dev commented 5 months ago

The ENV variable name is wrong the one lexido uses is GOOGLE_AI_KEY

swayz8148 commented 5 months ago

The ENV variable name is wrong the one lexido uses is GOOGLE_AI_KEY

yep that will do it lmao

got a working test with local though going to push it to git now and see if any error come up.

swayz8148 commented 5 months ago

its looking like its going to pass every test bit the push format style (I cant fix that idk what is wrong with it)

swayz8148 commented 5 months ago

https://github.com/Homebrew/homebrew-core/pull/168585 my last time trying till i get my mac

swayz8148 commented 5 months ago

@micr0-dev is this project on AGPL-3.0-or-later or AGPL-3.0-only

A reviewer in the PR is trying to find out what one it is 😃

micr0-dev commented 5 months ago

AGPL-3.0-or-later

swayz8148 commented 5 months ago

Your on homebreeeew

micr0-dev commented 5 months ago

This is awesome!!!!! Thanks so much for all your work!!!