Ruby · 1586 bytes Raw Blame History
1 class Parrot < Formula
2 desc "Intelligent CLI command failure assistant with AI-powered responses"
3 homepage "https://repos.musicsian.com/parrot.html"
4 url "https://github.com/tenseleyFlow/parrot/archive/v1.3.0.tar.gz"
5 sha256 "7f870446f598df8a91305ab01b58d1f1887b2073f3879497c67c87b7d4d28047"
6 license "MIT"
7
8 depends_on "go" => :build
9
10 def install
11 system "go", "build", *std_go_args(ldflags: "-w -s")
12
13 # Install shell hooks
14 share.install "parrot-hook.sh"
15 share.install "parrot-hook.fish"
16
17 # Install example configuration
18 etc.install "config/parrot.toml.example" => "parrot/parrot.toml.example"
19
20 # Install documentation
21 doc.install "README.md" if File.exist?("README.md")
22 end
23
24 def caveats
25 <<~EOS
26 🦜 Parrot has been installed successfully!
27
28 🚀 NEXT STEP: Run this command to enable shell integration:
29 parrot install
30
31 💡 This adds smart command failure detection to your shell
32 After running it, failed commands will trigger helpful responses!
33
34 📖 For more options, run: parrot --help
35
36 🤖 For AI-powered responses, install Ollama:
37 brew install ollama
38 ollama pull llama3.2:3b
39 EOS
40 end
41
42 test do
43 # Test basic functionality
44 assert_match "parrot", shell_output("#{bin}/parrot --help")
45
46 # Test mock command (should work without backend setup)
47 output = shell_output("#{bin}/parrot mock 'git push' 1")
48 assert_match "🦜", output
49
50 # Test configuration command
51 assert_match "Configuration", shell_output("#{bin}/parrot status")
52 end
53 end