Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
cmd: open browser on `ollama signin` when available (#14055)
Bruce MacDonalda6355329bf4a
diff --git a/cmd/cmd.go b/cmd/cmd.goindex 63b1e7d57..abc970f63 100644--- a/cmd/cmd.go+++ b/cmd/cmd.go@@ -29,6 +29,7 @@ import ("github.com/containerd/console""github.com/mattn/go-runewidth""github.com/olekukonko/tablewriter"+ "github.com/pkg/browser""github.com/spf13/cobra""golang.org/x/crypto/ssh""golang.org/x/sync/errgroup"@@ -52,7 +53,7 @@ import ("github.com/ollama/ollama/x/imagegen")-const ConnectInstructions = "To sign in, navigate to:\n %s\n\n"+const ConnectInstructions = "If your browser did not open, navigate to:\n %s\n\n"// ensureThinkingSupport emits a warning if the model does not advertise thinking supportfunc ensureThinkingSupport(ctx context.Context, client *api.Client, name string) {@@ -663,6 +664,7 @@ func SigninHandler(cmd *cobra.Command, args []string) error {fmt.Println()if aErr.SigninURL != "" {+ _ = browser.OpenURL(aErr.SigninURL)fmt.Printf(ConnectInstructions, aErr.SigninURL)}return nildiff --git a/go.mod b/go.modindex b912a9a0a..7a7f1ce4a 100644--- a/go.mod+++ b/go.mod@@ -27,6 +27,7 @@ require (github.com/mattn/go-runewidth v0.0.14github.com/nlpodyssey/gopickle v0.3.0github.com/pdevine/tensor v0.0.0-20240510204454-f88f4562727c+ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141cgithub.com/tkrajina/typescriptify-golang-structs v0.2.0github.com/wk8/go-ordered-map/v2 v2.1.8golang.org/x/image v0.22.0diff --git a/go.sum b/go.sumindex 83014fc5b..483da574d 100644--- a/go.sum+++ b/go.sum@@ -174,6 +174,8 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=github.com/pierrec/lz4/v4 v4.1.8 h1:ieHkV+i2BRzngO4Wd/3HGowuZStgq6QkPsD1eolNAO4=github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=+github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=@@ -304,6 +306,7 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wgolang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=