File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ require (
2121 cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
2222 cloud.google.com/go/compute/metadata v0.6.0 // indirect
2323 cloud.google.com/go/longrunning v0.5.7 // indirect
24+ github.com/atotto/clipboard v0.1.4 // indirect
2425 github.com/containerd/console v1.0.5 // indirect
2526 github.com/felixge/httpsnoop v1.0.4 // indirect
2627 github.com/go-logr/logr v1.4.2 // indirect
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYew
2828github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4 =
2929github.com/MarvinJWendt/testza v0.5.2 /go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY =
3030github.com/atomicgo/cursor v0.0.1 /go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk =
31+ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4 =
32+ github.com/atotto/clipboard v0.1.4 /go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI =
3133github.com/containerd/console v1.0.3 /go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U =
3234github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc =
3335github.com/containerd/console v1.0.5 /go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk =
Original file line number Diff line number Diff line change 88 "path/filepath"
99 "strings"
1010
11+ "github.com/atotto/clipboard"
1112 "github.com/dfanso/commit-msg/src/chatgpt"
1213 "github.com/dfanso/commit-msg/src/gemini"
1314 "github.com/dfanso/commit-msg/src/grok"
@@ -132,6 +133,14 @@ func main() {
132133 // Display the commit message in a styled panel
133134 displayCommitMessage (commitMsg )
134135
136+ // Copy to clipboard
137+ err = clipboard .WriteAll (commitMsg )
138+ if err != nil {
139+ pterm .Warning .Printf ("⚠️ Could not copy to clipboard: %v\n " , err )
140+ } else {
141+ pterm .Success .Println ("📋 Commit message copied to clipboard!" )
142+ }
143+
135144 pterm .Println ()
136145
137146 // Display changes preview
You can’t perform that action at this time.
0 commit comments