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
2 changes: 1 addition & 1 deletion .execs/build.flow
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ executables:
- envKey: BIN_NAME
text: flow
cmd: |
go build -o ${BIN_PATH}/${BIN_NAME}
go build -ldflags "-X github.com/flowexec/flow/internal/version.version=dev" -o ${BIN_PATH}/${BIN_NAME}
echo "flow built at ${BIN_PATH}/${BIN_NAME}"

- verb: generate
Expand Down
8 changes: 4 additions & 4 deletions .execs/container.flow
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ executables:

# First build the flow binary with version info
GOOS=linux GOARCH=${CURRENT_ARCH} go build \
-ldflags="-s -w -X github.com/flowexec/flow/cmd/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/cmd/internal/version.version=${VERSION} -X github.com/flowexec/flow/cmd/internal/version.buildDate=${BUILD_DATE}" \
-ldflags="-s -w -X github.com/flowexec/flow/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/internal/version.version=${VERSION} -X github.com/flowexec/flow/internal/version.buildDate=${BUILD_DATE}" \
-o flow

# Build Docker image for local platform
Expand Down Expand Up @@ -109,12 +109,12 @@ executables:

# Build amd64
GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -w -X github.com/flowexec/flow/cmd/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/cmd/internal/version.version=${VERSION} -X github.com/flowexec/flow/cmd/internal/version.buildDate=${BUILD_DATE}" \
-ldflags="-s -w -X github.com/flowexec/flow/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/internal/version.version=${VERSION} -X github.com/flowexec/flow/internal/version.buildDate=${BUILD_DATE}" \
-o flow-amd64

# Build arm64
GOOS=linux GOARCH=arm64 go build \
-ldflags="-s -w -X github.com/flowexec/flow/cmd/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/cmd/internal/version.version=${VERSION} -X github.com/flowexec/flow/cmd/internal/version.buildDate=${BUILD_DATE}" \
-ldflags="-s -w -X github.com/flowexec/flow/internal/version.gitCommit=${GIT_COMMIT} -X github.com/flowexec/flow/internal/version.version=${VERSION} -X github.com/flowexec/flow/internal/version.buildDate=${BUILD_DATE}" \
-o flow-arm64

# Create temporary Dockerfile that uses TARGETARCH for multi-arch builds
Expand Down Expand Up @@ -180,7 +180,7 @@ executables:
flag: workspace
- envKey: GIT_REPO
default: https://github.com/jahvon/flow.git
flag: repo
flag: gitrepo
- envKey: BRANCH
default: main
flag: branch
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ builds:
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags: >-
-s -w
-X "github.com/flowexec/flow/cmd/internal/version.gitCommit={{ .Commit }}"
-X "github.com/flowexec/flow/cmd/internal/version.version={{ .Version }}"
-X "github.com/flowexec/flow/cmd/internal/version.buildDate={{ .Date }}"
-X "github.com/flowexec/flow/internal/version.gitCommit={{ .Commit }}"
-X "github.com/flowexec/flow/internal/version.version={{ .Version }}"
-X "github.com/flowexec/flow/internal/version.buildDate={{ .Date }}"

gomod:
proxy: false
Expand Down
Binary file added bin/golangci-lint
Binary file not shown.
6 changes: 2 additions & 4 deletions cmd/internal/browse.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/flowexec/flow/cmd/internal/flags"
"github.com/flowexec/flow/internal/io"
execIO "github.com/flowexec/flow/internal/io/executable"
"github.com/flowexec/flow/internal/io/library"
"github.com/flowexec/flow/pkg/context"
flowErrors "github.com/flowexec/flow/pkg/errors"
"github.com/flowexec/flow/pkg/logger"
Expand Down Expand Up @@ -127,17 +126,16 @@ func executableLibrary(ctx *context.Context, cmd *cobra.Command, _ []string) {
}

runFunc := func(ref string) error { return runByRef(ctx, cmd, ref) }
libraryModel := library.NewLibraryView(
libraryModel := execIO.NewLibraryView(
ctx, allWs, allExecs,
library.Filter{
execIO.Filter{
Workspace: wsFilter,
Namespace: nsFilter,
Verb: executable.Verb(verbFilter),
Tags: tagsFilter,
Substring: subStr,
Visibility: visibilityFilter,
},
logger.Theme(ctx.Config.Theme.String()),
runFunc,
)
SetView(ctx, cmd, libraryModel)
Expand Down
10 changes: 5 additions & 5 deletions cmd/internal/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func cacheSetFunc(ctx *context.Context, cmd *cobra.Command, args []string) {
}
defer func() {
if err = s.Close(); err != nil {
logger.Log().Error(err, "cleanup failure")
logger.Log().WrapError(err, "cleanup failure")
}
}()
if err = s.Set(key, value); err != nil {
Expand Down Expand Up @@ -131,7 +131,7 @@ func cacheGetFunc(_ *context.Context, cmd *cobra.Command, args []string) {
}
defer func() {
if err := s.Close(); err != nil {
logger.Log().Error(err, "cleanup failure")
logger.Log().WrapError(err, "cleanup failure")
}
}()
value, err := s.Get(key)
Expand Down Expand Up @@ -168,7 +168,7 @@ func cacheListFunc(ctx *context.Context, cmd *cobra.Command, _ []string) {
}
defer func() {
if err := s.Close(); err != nil {
logger.Log().Error(err, "cleanup failure")
logger.Log().WrapError(err, "cleanup failure")
}
}()
data, err := s.GetAll()
Expand Down Expand Up @@ -216,7 +216,7 @@ func cacheRemoveFunc(_ *context.Context, cmd *cobra.Command, args []string) {
}
defer func() {
if err := s.Close(); err != nil {
logger.Log().Error(err, "cleanup failure")
logger.Log().WrapError(err, "cleanup failure")
}
}()
if err = s.Delete(key); err != nil {
Expand Down Expand Up @@ -255,7 +255,7 @@ func cacheClearFunc(_ *context.Context, cmd *cobra.Command, _ []string) {
}
defer func() {
if err := s.Close(); err != nil {
logger.Log().Error(err, "cleanup failure")
logger.Log().WrapError(err, "cleanup failure")
}
}()
if err := s.DeleteBucket(store.EnvironmentBucket()); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func execFunc(ctx *context.Context, cmd *cobra.Command, verb executable.Verb, ar
}
_ = processStore.Close()
}
logger.Log().Debugx(fmt.Sprintf("%s flow completed", ref), "Elapsed", dur.Round(time.Millisecond))
logger.Log().Debug(fmt.Sprintf("%s flow completed", ref), "Elapsed", dur.Round(time.Millisecond))
if TUIEnabled(ctx, cmd) {
if dur > 1*time.Minute && ctx.Config.SendSoundNotification() {
_ = beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
Expand Down
11 changes: 6 additions & 5 deletions cmd/internal/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/flowexec/flow/cmd/internal/flags"
flowIO "github.com/flowexec/flow/internal/io"
"github.com/flowexec/flow/internal/version"
"github.com/flowexec/flow/pkg/context"
"github.com/flowexec/flow/pkg/filesystem"
"github.com/flowexec/flow/pkg/logger"
Expand Down Expand Up @@ -73,10 +74,10 @@ func TUIEnabled(ctx *context.Context, cmd *cobra.Command) bool {
func SetView(ctx *context.Context, cmd *cobra.Command, view tuikit.View) {
if TUIEnabled(ctx, cmd) {
if err := ctx.SetView(view); err != nil {
logger.Log().Fatalx("unable to set view", "view", view.Type(), "error", err)
logger.Log().Fatal("unable to set view", "view", view.Type(), "error", err)
}
} else {
logger.Log().Errorx("interactive mode is disabled", "view", view.Type())
logger.Log().Error("interactive mode is disabled", "view", view.Type())
}
}

Expand All @@ -99,7 +100,7 @@ func WaitForTUI(ctx *context.Context, cmd *cobra.Command) {
func printContext(ctx *context.Context, cmd *cobra.Command) {
if TUIEnabled(ctx, cmd) {
logger.Log().Println(logger.Theme(ctx.Config.Theme.String()).
RenderHeader(context.AppName, context.HeaderCtxKey, ctx.String(), 0))
RenderHeader(context.AppName, version.SemVer(), context.HeaderCtxKey, ctx.String(), 0))
}
}

Expand All @@ -116,7 +117,7 @@ func workspaceOrCurrent(ctx *context.Context, workspaceName string) *workspace.W
var err error
ws, err = filesystem.LoadWorkspaceConfig(workspaceName, wsPath)
if err != nil {
logger.Log().Error(err, "unable to load workspace config")
logger.Log().WrapError(err, "unable to load workspace config")
}
ws.SetContext(workspaceName, wsPath)
}
Expand All @@ -143,7 +144,7 @@ func loadFlowfileTemplate(ctx *context.Context, name, path string) *executable.T
}
tmpl, err := filesystem.LoadFlowFileTemplate(name, path)
if err != nil {
logger.Log().Error(err, "unable to load flowfile template")
logger.Log().WrapError(err, "unable to load flowfile template")
return nil
}
return tmpl
Expand Down
3 changes: 1 addition & 2 deletions cmd/internal/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

tuikitIO "github.com/flowexec/tuikit/io"
"github.com/flowexec/tuikit/views"
"github.com/spf13/cobra"

"github.com/flowexec/flow/cmd/internal/flags"
Expand Down Expand Up @@ -38,7 +37,7 @@ func logFunc(ctx *context.Context, cmd *cobra.Command, _ []string) {
logger.Log().FatalErr(err)
}
if TUIEnabled(ctx, cmd) {
view := views.NewLogArchiveView(ctx.TUIContainer.RenderState(), filesystem.LogsDir(), lastEntry)
view := logs.NewLogView(ctx.TUIContainer, filesystem.LogsDir(), lastEntry)
SetView(ctx, cmd, view)
return
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func setSecretFunc(ctx *context.Context, cmd *cobra.Command, args []string) {
case len(args) == 2:
value = args[1]
default:
logger.Log().Warnx("merging multiple arguments into a single value", "count", len(args))
logger.Log().Warn("merging multiple arguments into a single value", "count", len(args))
value = strings.Join(args[1:], " ")
}

Expand Down Expand Up @@ -239,7 +239,7 @@ func getSecretFunc(ctx *context.Context, cmd *cobra.Command, args []string) {
}
if copyValue {
if err := clipboard.WriteAll(s.PlainTextString()); err != nil {
logger.Log().Error(err, "\nunable to copy secret value to clipboard")
logger.Log().WrapError(err, "\nunable to copy secret value to clipboard")
} else {
logger.Log().PlainTextSuccess("\ncopied secret value to clipboard")
}
Expand Down
7 changes: 6 additions & 1 deletion cmd/internal/sync.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package internal

import (
"fmt"
"time"

"github.com/spf13/cobra"

"github.com/flowexec/flow/pkg/cache"
Expand All @@ -24,8 +27,10 @@ func RegisterSyncCmd(ctx *context.Context, rootCmd *cobra.Command) {
}

func syncFunc(_ *context.Context, _ *cobra.Command, _ []string) {
start := time.Now()
if err := cache.UpdateAll(); err != nil {
logger.Log().FatalErr(err)
}
logger.Log().PlainTextSuccess("Synced flow cache")
duration := time.Since(start)
logger.Log().PlainTextSuccess(fmt.Sprintf("Synced flow cache (%s)", duration.Round(time.Second)))
}
2 changes: 1 addition & 1 deletion cmd/internal/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func listWorkspaceFunc(ctx *context.Context, cmd *cobra.Command, _ []string) {

workspaceCache, err := ctx.WorkspacesCache.GetLatestData()
if err != nil {
logger.Log().Fatalx("failure loading workspace configs from cache", "err", err)
logger.Log().Fatal("failure loading workspace configs from cache", "err", err)
}

filteredWorkspaces := make([]*workspace.Workspace, 0)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/flowexec/flow/cmd/internal"
"github.com/flowexec/flow/cmd/internal/flags"
"github.com/flowexec/flow/cmd/internal/version"
"github.com/flowexec/flow/internal/version"
"github.com/flowexec/flow/pkg/cache"
"github.com/flowexec/flow/pkg/context"
"github.com/flowexec/flow/pkg/logger"
Expand Down
47 changes: 22 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
module github.com/flowexec/flow

go 1.25
go 1.25.8

require (
charm.land/bubbletea/v2 v2.0.2
charm.land/lipgloss/v2 v2.0.2
github.com/atotto/clipboard v0.1.4
github.com/charmbracelet/bubbles v1.0.0
github.com/charmbracelet/bubbletea v1.3.10
github.com/charmbracelet/lipgloss v1.1.0
github.com/charmbracelet/x/exp/teatest v0.0.0-20250806222409-83e3a29d542f
github.com/flowexec/tuikit v0.2.3
github.com/charmbracelet/colorprofile v0.4.3
github.com/charmbracelet/x/exp/teatest/v2 v2.0.0-20260406091427-a791e22d5143
github.com/flowexec/tuikit v0.3.1
github.com/flowexec/vault v0.2.1
github.com/gen2brain/beeep v0.11.2
github.com/jahvon/expression v0.1.4
github.com/jahvon/glamour v0.8.1-patch3
github.com/mark3labs/mcp-go v0.43.2
github.com/mattn/go-runewidth v0.0.20
github.com/muesli/termenv v0.16.0
github.com/onsi/ginkgo/v2 v2.27.3
github.com/onsi/gomega v1.38.3
github.com/otiai10/copy v1.14.1
Expand All @@ -32,32 +29,34 @@ require (

require (
al.essio.dev/pkg/shellescape v1.5.1 // indirect
charm.land/bubbles/v2 v2.1.0 // indirect
charm.land/glamour/v2 v2.0.0 // indirect
charm.land/huh/v2 v2.0.3 // indirect
charm.land/log/v2 v2.0.0 // indirect
filippo.io/age v1.2.1 // indirect
git.sr.ht/~jackmordaunt/go-toast v1.1.2 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/alecthomas/chroma/v2 v2.20.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymanbagabas/go-udiff v0.3.1 // indirect
github.com/aymanbagabas/go-udiff v0.4.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.2 // indirect
github.com/catppuccin/go v0.3.0 // indirect
github.com/charmbracelet/colorprofile v0.4.1 // indirect
github.com/charmbracelet/huh v0.7.0 // indirect
github.com/charmbracelet/log v0.4.2 // 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/golden v0.0.0-20250806222409-83e3a29d542f // indirect
github.com/charmbracelet/x/exp/golden v0.0.0-20251109135125-8916d276318f // indirect
github.com/charmbracelet/x/exp/ordered v0.1.0 // indirect
github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20250806222409-83e3a29d542f // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.9.0 // indirect
github.com/clipperhouse/stringish v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.5.0 // indirect
github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/danieljoos/wincred v1.2.2 // 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/esiqveland/notify v0.13.3 // indirect
github.com/expr-lang/expr v1.17.7 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand All @@ -74,11 +73,9 @@ require (
github.com/jackmordaunt/icns/v3 v3.0.1 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
github.com/mailru/easyjson v0.9.0 // 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/microcosm-cc/bluemonday v1.0.27 // 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/reflow v0.3.0 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
Expand All @@ -100,8 +97,8 @@ require (
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/tools v0.38.0 // indirect
)
Loading
Loading