Skip to content

Commit

Permalink
feat: beautiful TUI round 3 (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleGedd committed Mar 25, 2024
1 parent 4c71dc2 commit 3cbfbbb
Show file tree
Hide file tree
Showing 34 changed files with 1,395 additions and 417 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -16,6 +16,7 @@
- [Inspect](#bundle-inspect)
- [Publish](#bundle-publish)
- [Remove](#bundle-remove)
- [Logs](#logs)
1. [Bundle Architecture and Multi-Arch Support](#bundle-architecture-and-multi-arch-support)
1. [Configuration](#configuration)
1. [Sharing Variables](#sharing-variables)
Expand Down Expand Up @@ -127,6 +128,13 @@ By default all the packages in the bundle are removed, but you can also remove o

As an example: `uds remove uds-bundle-<name>.tar.zst --packages init,nginx`

### Logs

> [!NOTE]
> Only works with `uds deploy` for now, may work for other operations but isn't guaranteed.
The `uds logs` command can be used to view the most recent logs of a bundle operation. Note that depending on your OS temporary directory and file settings, recent logs are purged after a certain amount of time, so this command may return an error if the logs are no longer available.

## Bundle Architecture and Multi-Arch Support
There are several ways to specify the architecture of a bundle:
1. Setting `--architecture` or `-a` flag during `uds ...` operations: `uds create <dir> --architecture arm64`
Expand Down
21 changes: 21 additions & 0 deletions adr/0004-tui.md
@@ -0,0 +1,21 @@
# 3. Terminal User Interface (TUI)

Date: 22 March 2024

## Status
Accepted

## Context
- Today, UDS CLI leverages the `pterm` library and `messaging` pkg in Zarf to provide a terminal user interface (TUI) for users. The TUI is used to display progress bars, tables, etc to the user. The current implementation of the TUI is tightly coupled with Zarf, making it difficult to customize and address the unique needs of UDS CLI.


- The UDS CLI team has formed the following hypothesis about UDS CLI users: UDS CLI users (particularly those doing `uds deploy`) are more interested in the status of their deployment than the details of the deployment process.


- In an effort to address the unique needs of UDS CLI users, the UDS CLI team would like to decouple UDS CLI from the Zarf TUI in an effort to make a custom user experience for UDS CLI users.

## Decision
The UDS CLI team has decided to refactor the existing TUI implementation with [BubbleTea](https://github.com/charmbracelet/bubbletea) and other tools from the [Charm](https://charm.sh/) stack. We believe the Charm stack offers the most advanced and modern tooling for building TUIs in Go.

## Consequences
This refactor is large and will be implemented one `uds` operation at time, starting with operations most likely to be performed during and after bundle installation.
52 changes: 26 additions & 26 deletions go.mod
Expand Up @@ -5,8 +5,12 @@ go 1.21.6
require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/defenseunicorns/maru-runner v0.0.2
github.com/defenseunicorns/zarf v0.32.5
github.com/charmbracelet/bubbles v0.16.1
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/defenseunicorns/maru-runner v0.1.0
github.com/defenseunicorns/zarf v0.32.6
github.com/fatih/color v1.16.0
github.com/fsnotify/fsnotify v1.7.0
github.com/goccy/go-yaml v1.11.3
github.com/mholt/archiver/v3 v3.5.1
Expand All @@ -19,6 +23,7 @@ require (
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
golang.org/x/mod v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/term v0.18.0
helm.sh/helm/v3 v3.14.3
oras.land/oras-go/v2 v2.4.0
)
Expand All @@ -27,12 +32,12 @@ require (
atomicgo.dev/cursor v0.2.0 // indirect
atomicgo.dev/keyboard v0.2.9 // indirect
atomicgo.dev/schedule v0.1.0 // indirect
cloud.google.com/go v0.111.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/kms v1.15.5 // indirect
cloud.google.com/go/storage v1.35.1 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/kms v1.15.7 // indirect
cloud.google.com/go/storage v1.38.0 // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20231103182354-93e78c079a13 // indirect
cuelang.org/go v0.7.0 // indirect
dario.cat/mergo v1.0.0 // indirect
Expand Down Expand Up @@ -138,10 +143,7 @@ require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.25.0 // indirect
github.com/charmbracelet/harmonica v0.2.0 // indirect
github.com/charmbracelet/lipgloss v0.9.1 // indirect
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
Expand Down Expand Up @@ -174,7 +176,7 @@ require (
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/cli v24.0.9+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/docker v24.0.9+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
Expand All @@ -191,7 +193,6 @@ require (
github.com/facebookincubator/nvdtools v0.1.5 // indirect
github.com/fairwindsops/pluto/v5 v5.18.4 // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/fgprof v0.9.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fluxcd/helm-controller/api v0.37.4 // indirect
Expand Down Expand Up @@ -250,7 +251,7 @@ require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.1 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -445,33 +446,32 @@ require (
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/sdk v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
go.step.sm/crypto v0.42.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
go4.org v0.0.0-20200411211856-f5505b9728dd // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.159.0 // indirect
google.golang.org/api v0.166.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/evanphx/json-patch.v5 v5.6.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down

0 comments on commit 3cbfbbb

Please sign in to comment.