fix(dev): keep optional tools optional

This commit is contained in:
Thomas Camlong committed 2026-08-01 14:01:52 +02:00
1 parent 5b04ed1ab5
commit b1e79e4641
3 files changed
+24 -25

No files matched your search

@@ -2,7 +2,7 @@
The host-side developer CLI builds and runs local Homarr images and pull-request previews. Run it directly from a checkout with `pnpm dev:cli -- ...`; no shell-specific setup script is required. It is separate from the recovery CLI included in production images.
To install an optional `homarr` binary, run `pnpm dev:cli:install` and make your Go bin directory available on `PATH`.
To install an optional `homarr` binary, run `pnpm dev:cli:install` and make your Go bin directory available on `PATH`. GitHub CLI authentication is only needed for pull-request features.
## Browse development images
+4 -4
View File
@@ -5,17 +5,17 @@ Build and launch local Homarr images and GHCR pull-request builds, then manage t
## Requirements
- Docker or OrbStack
- GitHub CLI authenticated with `gh auth login`
- Go 1.25+ to build from source
- GitHub CLI authenticated with `gh auth login` for pull-request features
## Setup
```sh
pnpm install
pnpm db:migration:sqlite:run
```
The migration command also seeds a new database. Use `pnpm db:seed` explicitly when you need to reseed an existing database. Start Redis separately with `pnpm docker:dev:up` when it is needed.
Create `.env` from `.env.example` and set `DB_URL` to an absolute path for the SQLite file before running the migration. In a POSIX shell, use `cp .env.example .env`; in PowerShell, use `Copy-Item .env.example .env`.
Then run `pnpm db:migration:sqlite:run` to create or update the database. The migration command also seeds a new database. Use `pnpm db:seed` explicitly when you need to seed an existing database. Start Redis separately with `pnpm docker:dev:up` when it is needed.
The examples below use `pnpm dev:cli -- ...`, which works from POSIX shells and PowerShell. If you prefer a global command, install it with `pnpm dev:cli:install` and add your Go bin directory to `PATH`.
## Build
@@ -57,7 +57,7 @@ homarr open <container> Open in browser
homarr stop <container> Stop
homarr restart <container> Restart
homarr remove <container> Force-remove
homarr doctor Check Docker, GitHub auth, and PATH
homarr doctor Check Docker and optional CLI integrations
```
## Development Browser
+19 -20
View File
@@ -49,7 +49,7 @@ Examples:
homarr build --pr 6390 # build PR #6390 locally as homarr:pr-6390
homarr list # script-friendly instance list
homarr logs homarr_pr_6390 # follow logs
homarr doctor # verify dependencies`,
homarr doctor # check Docker and optional integrations`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
@@ -207,28 +207,27 @@ var listCmd = &cobra.Command{
var doctorCmd = &cobra.Command{
Use: "doctor",
Short: "Check Docker, GitHub CLI, and local installation",
Short: "Check Docker and optional developer CLI integrations",
RunE: func(cmd *cobra.Command, args []string) error {
checks := []struct {
name string
command *exec.Cmd
}{
{name: "Docker daemon", command: exec.Command("docker", "info", "--format", "{{.ServerVersion}}")},
{name: "GitHub authentication", command: exec.Command("gh", "auth", "status")},
}
failed := false
for _, check := range checks {
output, err := check.command.CombinedOutput()
if err != nil {
failed = true
fmt.Printf("✗ %s: %s\n", check.name, strings.TrimSpace(string(output)))
} else {
fmt.Printf("✓ %s\n", check.name)
}
}
if _, err := exec.LookPath("homarr"); err != nil {
output, err := exec.Command("docker", "info", "--format", "{{.ServerVersion}}").CombinedOutput()
if err != nil {
failed = true
fmt.Println("✗ homarr is not on PATH")
fmt.Printf("✗ Docker daemon: %s\n", strings.TrimSpace(string(output)))
} else {
fmt.Printf("✓ Docker daemon: %s\n", strings.TrimSpace(string(output)))
}
if _, err := exec.LookPath("gh"); err != nil {
fmt.Println("- GitHub CLI not found (optional; required for pull-request features)")
} else if output, err := exec.Command("gh", "auth", "status").CombinedOutput(); err != nil {
fmt.Printf("- GitHub CLI is not authenticated (optional; run `gh auth login` for pull-request features): %s\n", strings.TrimSpace(string(output)))
} else {
fmt.Println("✓ GitHub CLI authentication")
}
if _, err := exec.LookPath("homarr"); err != nil {
fmt.Println("- homarr is not on PATH (optional; use `pnpm dev:cli -- ...` or run `pnpm dev:cli:install`)")
} else {
fmt.Println("✓ homarr is on PATH")
}