Skip to content

Commit a910a08

Browse files
authored
feat: theme auto-skill report and animate cloud graph sync (#284)
- Colorize the --auto-skill report (Detected label, error/check icons, installed summary) via theme.Tint, honoring NO_COLOR/TTY. - Wrap cloud graph sync's graph-build and upload steps in a CLIProgress spinner for animated progress feedback.
1 parent e4f1345 commit a910a08

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎cmd/cloud_graph.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ facts are immutable after acceptance. This is explicit and opt-in; local
3030
execution never depends on cloud synchronization.`,
3131
Args: cobra.MaximumNArgs(1),
3232
RunE: func(cmd *cobra.Command, args []string) error {
33+
prog := NewCLIProgress("Graph sync", []string{"Building execution graph", "Uploading to Graycode Cloud"})
34+
defer prog.Abort()
35+
prog.StartStep(0)
3336
var export executiongraph.Export
3437
var err error
3538
if strings.TrimSpace(missionDir) != "" {
@@ -56,6 +59,8 @@ execution never depends on cloud synchronization.`,
5659
if err != nil {
5760
return fmt.Errorf("prepare graph for Graycode Cloud: %w", err)
5861
}
62+
prog.CompleteStep(0)
63+
prog.StartStep(1)
5964
result, err := client.SyncGraph(cmd.Context(), cloud.GraphSyncRequest{
6065
SyncID: prepared.SyncID,
6166
ProjectID: cfg.ProjectID,
@@ -64,6 +69,8 @@ execution never depends on cloud synchronization.`,
6469
if err != nil {
6570
return err
6671
}
72+
prog.CompleteStep(1)
73+
prog.Done()
6774
status := "accepted"
6875
if result.Duplicate {
6976
status = "already synchronized"

‎internal/plugin/auto_skill.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"path/filepath"
77
"strings"
88

9+
"github.com/GrayCodeAI/graycode-cli/internal/theme"
910
"github.com/GrayCodeAI/graycode-cli/internal/ui/icons"
1011
)
1112

@@ -168,22 +169,22 @@ func RunAutoSkill(dir string) (string, error) {
168169
}
169170

170171
var b strings.Builder
171-
_, _ = fmt.Fprintf(&b, "Detected: %s\n", strings.Join(sigNames, ", "))
172+
_, _ = fmt.Fprintf(&b, "%s %s\n", theme.Tint("Detected:", theme.ReportMuted), strings.Join(sigNames, ", "))
172173

173174
installed := 0
174175
for _, skill := range recommended {
175176
msg, err := rc.Install(skill.Repo, skill.Name, "user")
176177
if err != nil {
177-
_, _ = fmt.Fprintf(&b, " "+icons.CloseThick()+" %s — %v\n", skill.Name, err)
178+
_, _ = fmt.Fprintf(&b, " "+icons.CloseThick()+" %s — %s\n", skill.Name, theme.Tint(err.Error(), theme.ReportError))
178179
continue
179180
}
180181
_ = msg
181-
_, _ = fmt.Fprintf(&b, " "+icons.CheckBold()+" %s — %s\n", skill.Name, skill.Description)
182+
_, _ = fmt.Fprintf(&b, " %s %s — %s\n", theme.Tint(icons.CheckBold(), theme.ReportSuccess), skill.Name, skill.Description)
182183
installed++
183184
}
184185

185186
if installed > 0 {
186-
_, _ = fmt.Fprintf(&b, "\nInstalled %d skill(s) to Graycode user state", installed)
187+
_, _ = fmt.Fprintf(&b, "\n%s", theme.Tint(fmt.Sprintf("Installed %d skill(s) to Graycode user state", installed), theme.ReportSuccess))
187188
}
188189
return b.String(), nil
189190
}

0 commit comments

Comments
 (0)