-
Notifications
You must be signed in to change notification settings - Fork 384
prototype: one-keypress onboarding review screen (mocked) #1903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
gtrrz-victor
wants to merge
2
commits into
main
Choose a base branch
from
worktree-onboarding-proto
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /onboarding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # Onboarding prototype (throwaway) | ||
|
|
||
| A **mocked** prototype of the "one-keypress" `entire enable` onboarding UX — a | ||
| single inline review screen where every value is pre-decided and editable, and | ||
| **Enter** builds the folder. Every side effect (login, mirror, hooks, git) is | ||
| faked so we can iterate on flow/wording fast. | ||
|
|
||
| This is a **separate Go module** on purpose: the main module's build, lint, and | ||
| CI skip it, so the prototype never has to satisfy production lint rules. | ||
|
|
||
| Nothing here imports `cmd/entire/cli` — it only shares cobra/bubbletea/lipgloss | ||
| so the look and feel transfers to a real implementation. | ||
|
|
||
| ## Run | ||
|
|
||
| ```bash | ||
| cd prototypes/onboarding | ||
| go run . # auto-detect the current folder | ||
| go run . --state repo-gh # simulate a GitHub repo | ||
| go run . --state repo-no-origin | ||
| go run . --state empty # empty folder (add --github to publish+mirror) | ||
| go run . --state repo-gh --yes # non-interactive (skip the review screen) | ||
| ``` | ||
|
|
||
| `--state`: `auto` (default, real detection) · `repo-gh` · `repo-no-origin` · `empty`. | ||
| Other flags: `--yes`, `--fast` (no simulated delays), `--github`, `--no-telemetry`, | ||
| `--agent`, `--region`. | ||
|
|
||
| Keys: `↑↓` move · `←→`/`space` change a row (Agents expands to multi-select) · | ||
| `enter` accept · `esc`/`q` cancel. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| module github.com/entireio/cli/prototypes/onboarding | ||
|
|
||
| go 1.26.4 | ||
|
|
||
| require ( | ||
| charm.land/bubbletea/v2 v2.0.8 | ||
| charm.land/lipgloss/v2 v2.0.5 | ||
| github.com/spf13/cobra v1.10.2 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/charmbracelet/colorprofile v0.4.3 // indirect | ||
| github.com/charmbracelet/ultraviolet v0.0.0-20260703014108-f5a850f9c2b7 // indirect | ||
| github.com/charmbracelet/x/ansi v0.11.7 // indirect | ||
| github.com/charmbracelet/x/term v0.2.2 // 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/inconshreveable/mousetrap v1.1.0 // indirect | ||
| github.com/lucasb-eyer/go-colorful v1.4.0 // indirect | ||
| github.com/mattn/go-runewidth v0.0.23 // indirect | ||
| github.com/muesli/cancelreader v0.2.2 // indirect | ||
| github.com/rivo/uniseg v0.4.7 // indirect | ||
| github.com/spf13/pflag v1.0.9 // indirect | ||
| github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect | ||
| golang.org/x/sync v0.21.0 // indirect | ||
| golang.org/x/sys v0.46.0 // indirect | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| charm.land/bubbletea/v2 v2.0.8 h1:SxTJMhCAI3lbPmy4SgX5LWZ24AdINr4I6UEqzZvYJuY= | ||
| charm.land/bubbletea/v2 v2.0.8/go.mod h1:2SkdgoTXluXJHOUwAoRlRXF/28vklb1rFl6GcgV1/ss= | ||
| charm.land/lipgloss/v2 v2.0.5 h1:kbNxgeeUOYv5J0YdpxFjfvf3dFvqH8Aci4zB6xqFtrY= | ||
| charm.land/lipgloss/v2 v2.0.5/go.mod h1:9oqhxt4yxIMe6q5A4kHr44DremZk7J9UNh74GlWa5nc= | ||
| github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o= | ||
| github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w= | ||
| github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q= | ||
| github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= | ||
| github.com/charmbracelet/ultraviolet v0.0.0-20260703014108-f5a850f9c2b7 h1:3FmWoGNWK4STvqg0O0Aeav2T7rodWJAPeF0QpH+8gFw= | ||
| github.com/charmbracelet/ultraviolet v0.0.0-20260703014108-f5a850f9c2b7/go.mod h1:f/jRa757WUmaOZrbPspXymbg/GnbF+rwe4OLsG7aXYo= | ||
| github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI= | ||
| github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= | ||
| github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA= | ||
| github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I= | ||
| github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= | ||
| github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= | ||
| github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY= | ||
| github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo= | ||
| github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM= | ||
| github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k= | ||
| github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= | ||
| github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= | ||
| github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= | ||
| github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= | ||
| github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= | ||
| github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= | ||
| github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= | ||
| github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= | ||
| github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= | ||
| github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw= | ||
| github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= | ||
| github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= | ||
| github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= | ||
| github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= | ||
| github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= | ||
| github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
| github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= | ||
| github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= | ||
| github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= | ||
| github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||
| github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= | ||
| github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= | ||
| go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= | ||
| golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= | ||
| golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= | ||
| golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= | ||
| golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= | ||
| golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= | ||
| golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= | ||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| // Command onboarding is a throwaway prototype of Entire's onboarding UX, | ||
| // modelled on the "one-keypress" proposal: a single Bubble Tea review screen | ||
| // where every value is pre-decided and editable, and Enter alone builds the | ||
| // folder. Every side effect (login, mirror, hooks, git) is mocked so we can | ||
| // iterate on the flow fast. Nothing here imports entire-cli internals — it only | ||
| // shares cobra/bubbletea/lipgloss so the look and feel transfers. | ||
| // | ||
| // go run ./prototypes/onboarding # auto-detect, review screen | ||
| // go run ./prototypes/onboarding --state empty # simulate an empty folder | ||
| // go run ./prototypes/onboarding --state repo-gh --yes --fast # non-interactive | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "os" | ||
| "os/exec" | ||
| "strings" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func main() { | ||
| if err := newRootCmd().Execute(); err != nil { | ||
| fmt.Fprintln(os.Stderr, err) | ||
| os.Exit(1) | ||
| } | ||
| } | ||
|
|
||
| func newRootCmd() *cobra.Command { | ||
| var ( | ||
| stateFlag string | ||
| github bool | ||
| assumeYes bool | ||
| noTelem bool | ||
| agents []string | ||
| region string | ||
| fast bool | ||
| ) | ||
| cmd := &cobra.Command{ | ||
| Use: "enable", | ||
| Short: "Prototype: one-keypress onboarding review screen", | ||
| SilenceUsage: true, | ||
| SilenceErrors: true, | ||
| RunE: func(cmd *cobra.Command, _ []string) error { | ||
| if fast { | ||
| mockDelay = 0 | ||
| } | ||
| if len(agents) == 0 { | ||
| agents = []string{"Claude Code"} | ||
| } | ||
| state, slug, err := resolveState(stateFlag) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| cfg := defaultConfig(state, slug, region, agents, !noTelem) | ||
| if github && state == StateEmpty { | ||
| cfg.RepoMode = "github" | ||
| cfg.Connect = cfg.mirrorable() | ||
| } | ||
|
|
||
| w := cmd.OutOrStdout() | ||
|
|
||
| // Non-interactive (--yes / no review): take the defaults, exactly | ||
| // like today's --yes. Otherwise show the one-keypress review. | ||
| if !assumeYes { | ||
| reviewed, ok, rerr := runReview(cmd.Context(), cfg) | ||
| if rerr != nil { | ||
| return rerr | ||
| } | ||
| if !ok { | ||
| fmt.Fprintln(w, styDim.Render("Cancelled — folder untouched.")) | ||
| return nil | ||
| } | ||
| cfg = reviewed | ||
| } | ||
|
|
||
| runPlan(w, planFromConfig(cfg)) | ||
| return nil | ||
| }, | ||
| } | ||
| f := cmd.Flags() | ||
| f.StringVar(&stateFlag, "state", "auto", "folder state: auto | repo-gh | repo-no-origin | empty") | ||
| f.BoolVar(&github, "github", false, "empty folder: create + push a private GitHub repo (enables mirroring)") | ||
| f.BoolVarP(&assumeYes, "yes", "y", false, "accept the defaults without the review screen") | ||
| f.BoolVar(&noTelem, "no-telemetry", false, "opt out of anonymous usage data") | ||
| f.StringArrayVar(&agents, "agent", nil, "agent(s) to install hooks for (default: Claude Code)") | ||
| f.StringVar(®ion, "region", "aws-us-east-2", "mirror data-residency region") | ||
| f.BoolVar(&fast, "fast", false, "skip the simulated delays") | ||
| return cmd | ||
| } | ||
|
|
||
| // resolveState maps --state to a FolderState. "auto" really inspects the | ||
| // current directory; explicit values let us demo any branch. | ||
| func resolveState(flag string) (FolderState, string, error) { | ||
| switch flag { | ||
| case "repo-gh": | ||
| return StateRepoGitHub, "github.com/acme/api", nil | ||
| case "repo-no-origin": | ||
| // Slug is the would-be published name; only used in the mirror URL, not | ||
| // the "no GitHub origin" summary. | ||
| return StateRepoNoOrigin, "github.com/acme/my-repo", nil | ||
| case "empty": | ||
| return StateEmpty, "github.com/acme/new-project", nil | ||
| case "auto": | ||
| return detectState() | ||
| default: | ||
| return 0, "", fmt.Errorf("unknown --state %q (want auto|repo-gh|repo-no-origin|empty)", flag) | ||
| } | ||
| } | ||
|
|
||
| func detectState() (FolderState, string, error) { | ||
| if err := exec.Command("git", "rev-parse", "--git-dir").Run(); err != nil { | ||
| return StateEmpty, "github.com/acme/new-project", nil | ||
| } | ||
| out, err := exec.Command("git", "remote", "get-url", "origin").Output() | ||
| if err != nil { | ||
| return StateRepoNoOrigin, "", nil | ||
| } | ||
| if slug := githubSlug(strings.TrimSpace(string(out))); slug != "" { | ||
| return StateRepoGitHub, slug, nil | ||
| } | ||
| return StateRepoNoOrigin, "", nil | ||
| } | ||
|
Comment on lines
+111
to
+123
|
||
|
|
||
| func githubSlug(url string) string { | ||
| url = strings.TrimSuffix(url, ".git") | ||
| switch { | ||
| case strings.HasPrefix(url, "git@github.com:"): | ||
| return "github.com/" + strings.TrimPrefix(url, "git@github.com:") | ||
| case strings.HasPrefix(url, "https://github.com/"): | ||
| return "github.com/" + strings.TrimPrefix(url, "https://github.com/") | ||
| } | ||
| return "" | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty slug on auto no-origin
Medium Severity
detectStatereturns an emptySlugfor no-origin (and non-GitHub) repos, while--state repo-no-originand empty-folder detection seed a mock slug. EnablingPublishthen prints a blank created-repo name and a brokenentire.io/gh/URL — anddemo.tapeexercises exactly this auto-detect publish path.Additional Locations (2)
prototypes/onboarding/main.go#L97-L103prototypes/onboarding/demo.tape#L13-L29Reviewed by Cursor Bugbot for commit 3ca4ad0. Configure here.