Skip to content
Draft
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
4 changes: 2 additions & 2 deletions cmd/manifest/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ func NewValidateCommand(clients *shared.ClientFactory) *cobra.Command {
cmd.Printf(
"\n%s: %s\n",
style.Bold("App Manifest Validation Result"),
style.Styler().Green("Valid"),
style.Green("Valid"),
)
clients.IO.PrintTrace(ctx, slacktrace.ManifestValidateSuccess)
} else {
cmd.Printf(
"\n%s: %s\n",
style.Bold("App Manifest Validation Result"),
style.Styler().Red("InValid"),
style.Red("InValid"),
)
}
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"github.com/slackapi/slack-cli/cmd/upgrade"
versioncmd "github.com/slackapi/slack-cli/cmd/version"
"github.com/slackapi/slack-cli/internal/cmdutil"
"github.com/slackapi/slack-cli/internal/experiment"
"github.com/slackapi/slack-cli/internal/iostreams"
"github.com/slackapi/slack-cli/internal/pkg/version"
"github.com/slackapi/slack-cli/internal/shared"
Expand Down Expand Up @@ -297,6 +298,7 @@ func InitConfig(ctx context.Context, clients *shared.ClientFactory, rootCmd *cob

// Init configurations
clients.Config.LoadExperiments(ctx, clients.IO.PrintDebug)
style.ToggleCharm(clients.Config.WithExperimentOn(experiment.Charm))
// TODO(slackcontext) Consolidate storing CLI version to slackcontext
clients.Config.Version = clients.CLIVersion

Expand Down
4 changes: 2 additions & 2 deletions cmd/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func checkForUpdates(clients *shared.ClientFactory, cmd *cobra.Command) error {
}

if clients.SDKConfig.Hooks.CheckUpdate.IsAvailable() {
cmd.Printf("%s You are using the latest Slack CLI and SDK versions\n", style.Styler().Green("✔").String())
cmd.Printf("%s You are using the latest Slack CLI and SDK versions\n", style.Green("✔"))
} else {
cmd.Printf("%s You are using the latest Slack CLI version\n", style.Styler().Green("✔").String())
cmd.Printf("%s You are using the latest Slack CLI version\n", style.Green("✔"))
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/iostreams/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (io *IOStreams) PrintInfo(ctx context.Context, shouldTrace bool, format str
span, _ := opentracing.StartSpanFromContext(ctx, "printInfo", opentracing.Tag{Key: "printInfo", Value: message})
defer span.Finish()
}
io.Stdout.Println(style.Styler().Reset(message))
io.Stdout.Println(message)
}

// PrintTrace prints traceID and values to stdout if SLACK_TEST_TRACE=true
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/apps/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,12 +869,12 @@ func continueDespiteWarning(ctx context.Context, clients *shared.ClientFactory,
clients.IO.PrintInfo(ctx, false,
"\n%s: %s",
style.Bold("Changes confirmed"),
style.Styler().Green("Continuing with install."),
style.Green("Continuing with install."),
)
return true, nil
}

clients.IO.PrintInfo(ctx, false, "\n%s", style.Styler().Red("App install canceled."))
clients.IO.PrintInfo(ctx, false, "\n%s", style.Red("App install canceled."))

return false, nil
}
Expand Down
12 changes: 6 additions & 6 deletions internal/pkg/platform/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ func prettifyActivity(activity api.Activity) (log string) {

switch activity.Level {
case types.WARN:
return style.Styler().Yellow(msg).String()
return style.Yellow(msg)
case types.ERROR, types.FATAL:
return style.Styler().Red(msg).String()
return style.Red(msg)
}

return msg
Expand Down Expand Up @@ -282,7 +282,7 @@ func externalAuthResultToString(activity api.Activity) (result string) {
msg = msg + "\n\t\t" + strings.ReplaceAll(activity.Payload["extra_message"].(string), "\n", "\n\t\t")
}

return style.Styler().Gray(13, msg).String()
return style.Gray(msg)
}

func externalAuthStartedToString(activity api.Activity) (result string) {
Expand All @@ -300,7 +300,7 @@ func externalAuthStartedToString(activity api.Activity) (result string) {
msg = msg + "\n\t" + strings.ReplaceAll(activity.Payload["code"].(string), "\n", "\n\t")
}

return style.Styler().Gray(13, msg).String()
return style.Gray(msg)
}

func externalAuthTokenFetchResult(activity api.Activity) (result string) {
Expand All @@ -318,13 +318,13 @@ func externalAuthTokenFetchResult(activity api.Activity) (result string) {
msg = msg + "\n\t" + strings.ReplaceAll(activity.Payload["code"].(string), "\n", "\n\t")
}

return style.Styler().Gray(13, msg).String()
return style.Gray(msg)
}

func functionDeploymentToString(activity api.Activity) (result string) {
msg := fmt.Sprintf("Application %sd by user '%s' on team '%s'", activity.Payload["action"], activity.Payload["user_id"], activity.Payload["team_id"])
msg = fmt.Sprintf("%s %s [%s] %s", style.Emoji("cloud"), activity.CreatedPretty(), activity.Level, msg)
return style.Styler().Gray(13, msg).String()
return style.Gray(msg)
}

func functionExecutionOutputToString(activity api.Activity) (result string) {
Expand Down
16 changes: 1 addition & 15 deletions internal/style/charm_theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,13 @@
package style

// Slack brand theme for charmbracelet/huh prompts.
// Uses official Slack brand colors to give the CLI a fun, playful feel.
// Uses official Slack brand colors defined in colors.go.

import (
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
)

// Slack brand colors according to https://a.slack-edge.com/4d5bb/marketing/img/media-kit/slack_brand_guidelines_september2020.pdf
var (
slackAubergine = lipgloss.Color("#7C2852")
slackBlue = lipgloss.Color("#36c5f0")
slackGreen = lipgloss.Color("#2eb67d")
slackYellow = lipgloss.Color("#ecb22e")
slackRed = lipgloss.Color("#e01e5a")
slackPool = lipgloss.Color("#78d7dd")
slackLegalGray = lipgloss.Color("#5e5d60")
slackOptionText = lipgloss.AdaptiveColor{Light: "#1d1c1d", Dark: "#f4ede4"}
slackDescriptionText = lipgloss.AdaptiveColor{Light: "#454447", Dark: "#b9b5b0"}
slackPlaceholderText = lipgloss.AdaptiveColor{Light: "#5e5d60", Dark: "#868380"}
)

// ThemeSlack returns a huh theme styled with Slack brand colors.
func ThemeSlack() *huh.Theme {
t := huh.ThemeBase()
Expand Down
45 changes: 45 additions & 0 deletions internal/style/colors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2022-2026 Salesforce, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package style

// Slack brand color palette.
// Single source of truth for all styling: lipgloss, huh themes, and bubbletea components.
//
// Colors from https://a.slack-edge.com/4d5bb/marketing/img/media-kit/slack_brand_guidelines_september2020.pdf

import "github.com/charmbracelet/lipgloss"

// Brand colors
var (
slackAubergine = lipgloss.Color("#7C2852")
slackBlue = lipgloss.Color("#36c5f0")
slackGreen = lipgloss.Color("#2eb67d")
slackYellow = lipgloss.Color("#ecb22e")
slackRed = lipgloss.Color("#e01e5a")
slackRedDark = lipgloss.Color("#a01040")
)

// Supplementary colors
var (
slackPool = lipgloss.Color("#78d7dd")
slackLegalGray = lipgloss.Color("#5e5d60")
)

// Adaptive colors that adjust for light/dark terminal backgrounds
var (
slackOptionText = lipgloss.AdaptiveColor{Light: "#1d1c1d", Dark: "#f4ede4"}
slackDescriptionText = lipgloss.AdaptiveColor{Light: "#454447", Dark: "#b9b5b0"}
slackPlaceholderText = lipgloss.AdaptiveColor{Light: "#5e5d60", Dark: "#868380"}
)
Loading
Loading