Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/cloud_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ facts are immutable after acceptance. This is explicit and opt-in; local
execution never depends on cloud synchronization.`,
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
prog := NewCLIProgress("Graph sync", []string{"Building execution graph", "Uploading to Graycode Cloud"})
defer prog.Abort()
prog.StartStep(0)
var export executiongraph.Export
var err error
if strings.TrimSpace(missionDir) != "" {
Expand All @@ -56,6 +59,8 @@ execution never depends on cloud synchronization.`,
if err != nil {
return fmt.Errorf("prepare graph for Graycode Cloud: %w", err)
}
prog.CompleteStep(0)
prog.StartStep(1)
result, err := client.SyncGraph(cmd.Context(), cloud.GraphSyncRequest{
SyncID: prepared.SyncID,
ProjectID: cfg.ProjectID,
Expand All @@ -64,6 +69,8 @@ execution never depends on cloud synchronization.`,
if err != nil {
return err
}
prog.CompleteStep(1)
prog.Done()
status := "accepted"
if result.Duplicate {
status = "already synchronized"
Expand Down
9 changes: 5 additions & 4 deletions internal/plugin/auto_skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"
"strings"

"github.com/GrayCodeAI/graycode-cli/internal/theme"
"github.com/GrayCodeAI/graycode-cli/internal/ui/icons"
)

Expand Down Expand Up @@ -168,22 +169,22 @@ func RunAutoSkill(dir string) (string, error) {
}

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

installed := 0
for _, skill := range recommended {
msg, err := rc.Install(skill.Repo, skill.Name, "user")
if err != nil {
_, _ = fmt.Fprintf(&b, " "+icons.CloseThick()+" %s — %v\n", skill.Name, err)
_, _ = fmt.Fprintf(&b, " "+icons.CloseThick()+" %s — %s\n", skill.Name, theme.Tint(err.Error(), theme.ReportError))
continue
}
_ = msg
_, _ = fmt.Fprintf(&b, " "+icons.CheckBold()+" %s — %s\n", skill.Name, skill.Description)
_, _ = fmt.Fprintf(&b, " %s %s — %s\n", theme.Tint(icons.CheckBold(), theme.ReportSuccess), skill.Name, skill.Description)
installed++
}

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