From 29e66df352e417fe4274eae4de7609eb89b63232 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:26:34 +0000 Subject: [PATCH 1/2] Initial plan From 1af5cc500c72cc17e94a8958a8d7f4ddc3a828ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:42:24 +0000 Subject: [PATCH 2/2] upgrade charmbracelet/huh to charm.land/huh/v2 v2.0.3 Agent-Logs-Url: https://github.com/github/gh-aw/sessions/383f6818-0481-4f67-986e-557d38862169 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- go.mod | 11 +-- go.sum | 25 ++---- pkg/cli/add_interactive_auth.go | 2 +- pkg/cli/add_interactive_engine.go | 2 +- pkg/cli/add_interactive_git.go | 2 +- pkg/cli/add_interactive_orchestrator.go | 2 +- pkg/cli/add_interactive_schedule.go | 2 +- pkg/cli/add_interactive_workflow.go | 2 +- pkg/cli/engine_secrets.go | 2 +- pkg/cli/interactive.go | 2 +- pkg/cli/run_interactive.go | 2 +- pkg/console/confirm.go | 2 +- pkg/console/input.go | 2 +- pkg/console/list.go | 2 +- pkg/styles/huh_theme.go | 114 ++++++++++++------------ 15 files changed, 80 insertions(+), 94 deletions(-) diff --git a/go.mod b/go.mod index fb3525b54ff..77af74ec5ff 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,12 @@ module github.com/github/gh-aw -go 1.25.0 +go 1.25.8 require ( charm.land/bubbles/v2 v2.1.0 charm.land/bubbletea/v2 v2.0.2 + charm.land/huh/v2 v2.0.3 charm.land/lipgloss/v2 v2.0.2 - github.com/charmbracelet/huh v0.8.0 - github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383 github.com/cli/go-gh/v2 v2.13.0 github.com/creack/pty v1.1.24 @@ -40,13 +39,12 @@ require ( github.com/catppuccin/go v0.3.0 // indirect github.com/ccojocar/zxcvbn-go v1.0.4 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/charmbracelet/bubbles v1.0.0 // indirect - github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/colorprofile v0.4.2 // indirect github.com/charmbracelet/harmonica v0.2.0 // indirect github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8 // indirect github.com/charmbracelet/x/ansi v0.11.6 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect + github.com/charmbracelet/x/exp/ordered v0.1.0 // indirect github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/charmbracelet/x/termios v0.1.1 // indirect @@ -58,7 +56,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/fatih/color v1.19.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.3 // indirect @@ -75,11 +72,9 @@ require ( github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.21 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect - github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/termenv v0.16.0 // indirect github.com/openai/openai-go/v3 v3.28.0 // indirect diff --git a/go.sum b/go.sum index c2c924f53e1..6734e8f5c16 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ charm.land/bubbles/v2 v2.1.0 h1:YSnNh5cPYlYjPxRrzs5VEn3vwhtEn3jVGRBT3M7/I0g= charm.land/bubbles/v2 v2.1.0/go.mod h1:l97h4hym2hvWBVfmJDtrEHHCtkIKeTEb3TTJ4ZOB3wY= charm.land/bubbletea/v2 v2.0.2 h1:4CRtRnuZOdFDTWSff9r8QFt/9+z6Emubz3aDMnf/dx0= charm.land/bubbletea/v2 v2.0.2/go.mod h1:3LRff2U4WIYXy7MTxfbAQ+AdfM3D8Xuvz2wbsOD9OHQ= +charm.land/huh/v2 v2.0.3 h1:2cJsMqEPwSywGHvdlKsJyQKPtSJLVnFKyFbsYZTlLkU= +charm.land/huh/v2 v2.0.3/go.mod h1:93eEveeeqn47MwiC3tf+2atZ2l7Is88rAtmZNZ8x9Wc= charm.land/lipgloss/v2 v2.0.2 h1:xFolbF8JdpNkM2cEPTfXEcW1p6NRzOWTSamRfYEw8cs= charm.land/lipgloss/v2 v2.0.2/go.mod h1:KjPle2Qd3YmvP1KL5OMHiHysGcNwq6u83MUjYkFvEkM= cloud.google.com/go v0.121.2 h1:v2qQpN6Dx9x2NmwrqlesOt3Ys4ol5/lFZ6Mg1B7OJCg= @@ -30,16 +32,10 @@ github.com/ccojocar/zxcvbn-go v1.0.4 h1:FWnCIRMXPj43ukfX000kvBZvV6raSxakYr1nzyNr github.com/ccojocar/zxcvbn-go v1.0.4/go.mod h1:3GxGX+rHmueTUMvm5ium7irpyjmm7ikxYFOSJB21Das= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5fXonfvc= -github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E= -github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= -github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4= github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY= github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8= github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/huh v0.8.0 h1:Xz/Pm2h64cXQZn/Jvele4J3r7DDiqFCNIVteYukxDvY= -github.com/charmbracelet/huh v0.8.0/go.mod h1:5YVc+SlZ1IhQALxRPpkGwwEKftN/+OlJlnJYlDRFqN4= github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc h1:nFRtCfZu/zkltd2lsLUPlVNv3ej/Atod9hcdbRZtlys= github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc/go.mod h1:aKC/t2arECF6rNOnaKaVU6y4t4ZeHQzqfxedE/VkVhA= github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8 h1:eyFRbAmexyt43hVfeyBofiGSEmJ7krjLOYt/9CF5NKA= @@ -48,12 +44,14 @@ github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= -github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U= -github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ= +github.com/charmbracelet/x/conpty v0.1.1 h1:s1bUxjoi7EpqiXysVtC+a8RrvPPNcNvAjfi4jxsAuEs= +github.com/charmbracelet/x/conpty v0.1.1/go.mod h1:OmtR77VODEFbiTzGE9G1XiRJAga6011PIm4u5fTNZpk= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA= github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0= github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383 h1:R0iAuPE4yU0omOM9ANVmxYqW+ktB9xMDMyxx6prkrA0= github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383/go.mod h1:V8n/g3qVKNxr2FR37Y+otCsMySvZr601T0C7coEP0bw= +github.com/charmbracelet/x/exp/ordered v0.1.0 h1:55/qLwjIh0gL0Vni+QAWk7T/qRVP6sBf+2agPBgnOFE= +github.com/charmbracelet/x/exp/ordered v0.1.0/go.mod h1:5UHwmG+is5THxMyCJHNPCn2/ecI07aKNrW+LcResjJ8= github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc h1:9IKnWSTN2Sz73Hu4gmCCBtWSavl2adq34IFpwDIzZPU= github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc/go.mod h1:/ehtMPNh9K4odGFkqYJKpIYyePhdp1hLBRvyY4bWkH8= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= @@ -62,8 +60,8 @@ github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8 github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo= github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM= github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k= -github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI= -github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4= +github.com/charmbracelet/x/xpty v0.1.3 h1:eGSitii4suhzrISYH50ZfufV3v085BXQwIytcOdFSsw= +github.com/charmbracelet/x/xpty v0.1.3/go.mod h1:poPYpWuLDBFCKmKLDnhBp51ATa0ooD8FhypRwEFtH3Y= github.com/cli/go-gh/v2 v2.13.0 h1:jEHZu/VPVoIJkciK3pzZd3rbT8J90swsK5Ui4ewH1ys= github.com/cli/go-gh/v2 v2.13.0/go.mod h1:Us/NbQ8VNM0fdaILgoXSz6PKkV5PWaEzkJdc9vR2geM= github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= @@ -85,8 +83,6 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= @@ -146,8 +142,6 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= -github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= @@ -156,8 +150,6 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4 github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/modelcontextprotocol/go-sdk v1.4.1 h1:M4x9GyIPj+HoIlHNGpK2hq5o3BFhC+78PkEaldQRphc= github.com/modelcontextprotocol/go-sdk v1.4.1/go.mod h1:Bo/mS87hPQqHSRkMv4dQq1XCu6zv4INdXnFZabkNU6s= -github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= -github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= @@ -248,7 +240,6 @@ golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= diff --git a/pkg/cli/add_interactive_auth.go b/pkg/cli/add_interactive_auth.go index 3e82a88b917..f282e1f8f50 100644 --- a/pkg/cli/add_interactive_auth.go +++ b/pkg/cli/add_interactive_auth.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/styles" ) diff --git a/pkg/cli/add_interactive_engine.go b/pkg/cli/add_interactive_engine.go index e34a92d1580..3bfa44057fd 100644 --- a/pkg/cli/add_interactive_engine.go +++ b/pkg/cli/add_interactive_engine.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/sliceutil" diff --git a/pkg/cli/add_interactive_git.go b/pkg/cli/add_interactive_git.go index c3722479fc4..8e8cc3478fa 100644 --- a/pkg/cli/add_interactive_git.go +++ b/pkg/cli/add_interactive_git.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/styles" "github.com/github/gh-aw/pkg/workflow" diff --git a/pkg/cli/add_interactive_orchestrator.go b/pkg/cli/add_interactive_orchestrator.go index 124783ac312..4d56433b6b9 100644 --- a/pkg/cli/add_interactive_orchestrator.go +++ b/pkg/cli/add_interactive_orchestrator.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/logger" diff --git a/pkg/cli/add_interactive_schedule.go b/pkg/cli/add_interactive_schedule.go index 0f98ed15573..f2c5ddd871d 100644 --- a/pkg/cli/add_interactive_schedule.go +++ b/pkg/cli/add_interactive_schedule.go @@ -5,7 +5,7 @@ import ( "os" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/logger" "github.com/github/gh-aw/pkg/parser" diff --git a/pkg/cli/add_interactive_workflow.go b/pkg/cli/add_interactive_workflow.go index f94d0480cc1..113d8cd372f 100644 --- a/pkg/cli/add_interactive_workflow.go +++ b/pkg/cli/add_interactive_workflow.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/styles" diff --git a/pkg/cli/engine_secrets.go b/pkg/cli/engine_secrets.go index 8a6651d0513..47d8d1a5d3c 100644 --- a/pkg/cli/engine_secrets.go +++ b/pkg/cli/engine_secrets.go @@ -7,7 +7,7 @@ import ( "os" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/logger" diff --git a/pkg/cli/interactive.go b/pkg/cli/interactive.go index 2763f2d5944..56c4dd4bc56 100644 --- a/pkg/cli/interactive.go +++ b/pkg/cli/interactive.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/logger" diff --git a/pkg/cli/run_interactive.go b/pkg/cli/run_interactive.go index c0131844807..9f3d77a498b 100644 --- a/pkg/cli/run_interactive.go +++ b/pkg/cli/run_interactive.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/console" "github.com/github/gh-aw/pkg/constants" "github.com/github/gh-aw/pkg/logger" diff --git a/pkg/console/confirm.go b/pkg/console/confirm.go index 6edfbd2dcee..898bb824841 100644 --- a/pkg/console/confirm.go +++ b/pkg/console/confirm.go @@ -3,7 +3,7 @@ package console import ( - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/styles" ) diff --git a/pkg/console/input.go b/pkg/console/input.go index f203b8586e1..dbc6ab651ab 100644 --- a/pkg/console/input.go +++ b/pkg/console/input.go @@ -5,7 +5,7 @@ package console import ( "errors" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/styles" "github.com/github/gh-aw/pkg/tty" ) diff --git a/pkg/console/list.go b/pkg/console/list.go index bf064d659eb..85c52a2dc8f 100644 --- a/pkg/console/list.go +++ b/pkg/console/list.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/charmbracelet/huh" + "charm.land/huh/v2" "github.com/github/gh-aw/pkg/logger" "github.com/github/gh-aw/pkg/styles" "github.com/github/gh-aw/pkg/tty" diff --git a/pkg/styles/huh_theme.go b/pkg/styles/huh_theme.go index 2ed7120e6c7..bd88b05fadb 100644 --- a/pkg/styles/huh_theme.go +++ b/pkg/styles/huh_theme.go @@ -3,74 +3,74 @@ package styles import ( - "github.com/charmbracelet/huh" - // huh v0.8.0 depends on charmbracelet/lipgloss v1, not charm.land/lipgloss/v2. - // This file intentionally uses the v1 import to match huh's type expectations. - "github.com/charmbracelet/lipgloss" + "charm.land/huh/v2" + "charm.land/lipgloss/v2" ) -// HuhTheme returns a custom huh.Theme that maps the pkg/styles Dracula-inspired +// HuhTheme returns a huh.ThemeFunc that maps the pkg/styles Dracula-inspired // color palette to huh form fields, giving interactive forms the same visual // identity as the rest of the CLI output. -func HuhTheme() *huh.Theme { - t := huh.ThemeBase() +func HuhTheme() huh.ThemeFunc { + return func(isDark bool) *huh.Styles { + t := huh.ThemeBase(isDark) + lightDark := lipgloss.LightDark(isDark) - // Map the pkg/styles palette to lipgloss.AdaptiveColor for huh compatibility. - // huh uses github.com/charmbracelet/lipgloss, so we use that type here. - var ( - primary = lipgloss.AdaptiveColor{Light: hexColorPurpleLight, Dark: hexColorPurpleDark} - success = lipgloss.AdaptiveColor{Light: hexColorSuccessLight, Dark: hexColorSuccessDark} - errorColor = lipgloss.AdaptiveColor{Light: hexColorErrorLight, Dark: hexColorErrorDark} - warning = lipgloss.AdaptiveColor{Light: hexColorWarningLight, Dark: hexColorWarningDark} - comment = lipgloss.AdaptiveColor{Light: hexColorCommentLight, Dark: hexColorCommentDark} - fg = lipgloss.AdaptiveColor{Light: hexColorForegroundLight, Dark: hexColorForegroundDark} - bg = lipgloss.AdaptiveColor{Light: hexColorBackgroundLight, Dark: hexColorBackgroundDark} - border = lipgloss.AdaptiveColor{Light: hexColorBorderLight, Dark: hexColorBorderDark} - ) + // Map the pkg/styles palette using lipgloss v2's LightDark helper. + var ( + primary = lightDark(lipgloss.Color(hexColorPurpleLight), lipgloss.Color(hexColorPurpleDark)) + success = lightDark(lipgloss.Color(hexColorSuccessLight), lipgloss.Color(hexColorSuccessDark)) + errorColor = lightDark(lipgloss.Color(hexColorErrorLight), lipgloss.Color(hexColorErrorDark)) + warning = lightDark(lipgloss.Color(hexColorWarningLight), lipgloss.Color(hexColorWarningDark)) + comment = lightDark(lipgloss.Color(hexColorCommentLight), lipgloss.Color(hexColorCommentDark)) + fg = lightDark(lipgloss.Color(hexColorForegroundLight), lipgloss.Color(hexColorForegroundDark)) + bg = lightDark(lipgloss.Color(hexColorBackgroundLight), lipgloss.Color(hexColorBackgroundDark)) + border = lightDark(lipgloss.Color(hexColorBorderLight), lipgloss.Color(hexColorBorderDark)) + ) - // Focused field styles - t.Focused.Base = t.Focused.Base.BorderForeground(border) - t.Focused.Card = t.Focused.Base - t.Focused.Title = t.Focused.Title.Foreground(primary).Bold(true) - t.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(primary).Bold(true).MarginBottom(1) - t.Focused.Directory = t.Focused.Directory.Foreground(primary) - t.Focused.Description = t.Focused.Description.Foreground(comment) - t.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(errorColor) - t.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(errorColor) + // Focused field styles + t.Focused.Base = t.Focused.Base.BorderForeground(border) + t.Focused.Card = t.Focused.Base + t.Focused.Title = t.Focused.Title.Foreground(primary).Bold(true) + t.Focused.NoteTitle = t.Focused.NoteTitle.Foreground(primary).Bold(true).MarginBottom(1) + t.Focused.Directory = t.Focused.Directory.Foreground(primary) + t.Focused.Description = t.Focused.Description.Foreground(comment) + t.Focused.ErrorIndicator = t.Focused.ErrorIndicator.Foreground(errorColor) + t.Focused.ErrorMessage = t.Focused.ErrorMessage.Foreground(errorColor) - // Select / navigation indicators - t.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(warning) - t.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(warning) - t.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(warning) + // Select / navigation indicators + t.Focused.SelectSelector = t.Focused.SelectSelector.Foreground(warning) + t.Focused.NextIndicator = t.Focused.NextIndicator.Foreground(warning) + t.Focused.PrevIndicator = t.Focused.PrevIndicator.Foreground(warning) - // List option styles - t.Focused.Option = t.Focused.Option.Foreground(fg) - t.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(warning) - t.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(success) - t.Focused.SelectedPrefix = t.Focused.SelectedPrefix.Foreground(success) - t.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(fg) - t.Focused.UnselectedPrefix = t.Focused.UnselectedPrefix.Foreground(comment) + // List option styles + t.Focused.Option = t.Focused.Option.Foreground(fg) + t.Focused.MultiSelectSelector = t.Focused.MultiSelectSelector.Foreground(warning) + t.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(success) + t.Focused.SelectedPrefix = t.Focused.SelectedPrefix.Foreground(success) + t.Focused.UnselectedOption = t.Focused.UnselectedOption.Foreground(fg) + t.Focused.UnselectedPrefix = t.Focused.UnselectedPrefix.Foreground(comment) - // Button styles - t.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(bg).Background(primary).Bold(true) - t.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(fg).Background(bg) - t.Focused.Next = t.Focused.FocusedButton + // Button styles + t.Focused.FocusedButton = t.Focused.FocusedButton.Foreground(bg).Background(primary).Bold(true) + t.Focused.BlurredButton = t.Focused.BlurredButton.Foreground(fg).Background(bg) + t.Focused.Next = t.Focused.FocusedButton - // Text input styles - t.Focused.TextInput.Cursor = t.Focused.TextInput.Cursor.Foreground(warning) - t.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(comment) - t.Focused.TextInput.Prompt = t.Focused.TextInput.Prompt.Foreground(primary) + // Text input styles + t.Focused.TextInput.Cursor = t.Focused.TextInput.Cursor.Foreground(warning) + t.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(comment) + t.Focused.TextInput.Prompt = t.Focused.TextInput.Prompt.Foreground(primary) - // Blurred styles mirror focused but hide the border - t.Blurred = t.Focused - t.Blurred.Base = t.Focused.Base.BorderStyle(lipgloss.HiddenBorder()) - t.Blurred.Card = t.Blurred.Base - t.Blurred.NextIndicator = lipgloss.NewStyle() - t.Blurred.PrevIndicator = lipgloss.NewStyle() + // Blurred styles mirror focused but hide the border + t.Blurred = t.Focused + t.Blurred.Base = t.Focused.Base.BorderStyle(lipgloss.HiddenBorder()) + t.Blurred.Card = t.Blurred.Base + t.Blurred.NextIndicator = lipgloss.NewStyle() + t.Blurred.PrevIndicator = lipgloss.NewStyle() - // Group header styles - t.Group.Title = t.Focused.Title - t.Group.Description = t.Focused.Description + // Group header styles + t.Group.Title = t.Focused.Title + t.Group.Description = t.Focused.Description - return t + return t + } }