diff --git a/README.md b/README.md index 749f5d127..7ccad8407 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,11 @@ irm https://raw.githubusercontent.com/runkids/skillshare/main/install.ps1 | iex ### Homebrew ```bash -brew install runkids/tap/skillshare +brew install skillshare ``` +> **Note:** Recommended for CLI-only users. The Homebrew build does not include the [web dashboard](#web-dashboard) — all other commands work identically. For the full experience including `skillshare ui`, use the curl/PowerShell installer above. + ### Shorthand (Optional) Add an alias to your shell config (`~/.zshrc` or `~/.bashrc`): diff --git a/cmd/skillshare/ui.go b/cmd/skillshare/ui.go index 40a1a6fba..2f6f8357e 100644 --- a/cmd/skillshare/ui.go +++ b/cmd/skillshare/ui.go @@ -88,6 +88,13 @@ func startProjectUI(addr, url string, noOpen bool) error { Mode: "merge", } + if !server.IsUIBuilt() { + ui.Warning("Web UI is not included in this build.") + ui.Warning("Install with the full installer to get the web UI:") + fmt.Println(" curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh") + return nil + } + if !noOpen { ui.Success("Opening %s in your browser... (project mode)", url) openBrowser(url) @@ -103,6 +110,13 @@ func startGlobalUI(addr, url string, noOpen bool) error { return err } + if !server.IsUIBuilt() { + ui.Warning("Web UI is not included in this build.") + ui.Warning("Install with the full installer to get the web UI:") + fmt.Println(" curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh") + return nil + } + if !noOpen { ui.Success("Opening %s in your browser...", url) openBrowser(url) diff --git a/internal/server/embed.go b/internal/server/embed.go index 047c9d650..49a71786c 100644 --- a/internal/server/embed.go +++ b/internal/server/embed.go @@ -10,6 +10,16 @@ import ( "strings" ) +// IsUIBuilt reports whether the embedded dist contains a real frontend build. +// Returns false when the dist only contains a placeholder (e.g. Homebrew or make build without UI). +func IsUIBuilt() bool { + data, err := distFS.ReadFile("dist/index.html") + if err != nil { + return false + } + return !strings.Contains(string(data), "UI not built") +} + //go:embed all:dist var distFS embed.FS diff --git a/internal/server/embed_dev.go b/internal/server/embed_dev.go index 324a1e16f..47f594f41 100644 --- a/internal/server/embed_dev.go +++ b/internal/server/embed_dev.go @@ -6,6 +6,12 @@ import ( "net/http" ) +// IsUIBuilt reports whether the embedded dist contains a real frontend build. +// In dev mode, the frontend is served by Vite, not embedded. +func IsUIBuilt() bool { + return false +} + // spaHandler returns a placeholder handler when building with -tags dev. // In dev mode, use the Vite dev server on :5173 instead. func spaHandler() http.Handler { diff --git a/website/docs/commands/ui.md b/website/docs/commands/ui.md index 4aef53f0a..a103c0105 100644 --- a/website/docs/commands/ui.md +++ b/website/docs/commands/ui.md @@ -139,6 +139,17 @@ Or simply `skillshare ui` if `.skillshare/config.yaml` exists (auto-detected). The dashboard reads and writes `.skillshare/config.yaml`, syncs to project-local targets, and reconciles remote skill entries after install — just like the CLI. +## Homebrew Note + +The Homebrew formula (`brew install skillshare`) is optimized for CLI-only usage and does not include the web UI. If you installed via Homebrew and want the dashboard, reinstall with the full installer: + +```bash +brew uninstall skillshare +curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh +``` + +All other CLI commands work identically regardless of install method. + ## Architecture The web UI is a single-page React application embedded in the Go binary via `go:embed`. No external dependencies are needed at runtime — just the `skillshare` binary. diff --git a/website/docs/getting-started/first-sync.md b/website/docs/getting-started/first-sync.md index 50d5c3b2c..0a1c6d608 100644 --- a/website/docs/getting-started/first-sync.md +++ b/website/docs/getting-started/first-sync.md @@ -15,6 +15,15 @@ Get your skills synced in 5 minutes. ## Step 1: Install skillshare +**Homebrew:** +```bash +brew install skillshare +``` + +:::note +Recommended for CLI-only users. The Homebrew build does not include the [web dashboard](/docs/commands/ui) — all other commands work identically. For the full experience including `skillshare ui`, use the curl installer below. +::: + **macOS / Linux:** ```bash curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 1d9919cd9..6bbe4458d 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -22,7 +22,7 @@ const INSTALL_COMMANDS: RecordPS, }, homebrew: { - command: 'brew install runkids/tap/skillshare', + command: 'brew install skillshare', label: 'Homebrew', icon: , },