{"record":{"id":"e6c8f0be9323c27e","repo":"ory/kratos","slug":"you-have-to-set-the-remote-endpoint-try-help-fo","errorCode":null,"errorMessage":"you have to set the remote endpoint, try --help for details","messagePattern":"you have to set the remote endpoint, try --help for details","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cliclient/client.go","lineNumber":64,"sourceCode":"\t\tconf := kratos.NewConfiguration()\n\t\tconf.HTTPClient = cc.HTTPClient\n\t\tconf.Servers = kratos.ServerConfigurations{{URL: cc.Endpoint}}\n\t\treturn kratos.NewAPIClient(conf), nil\n\t} else if f != nil {\n\t\treturn nil, errors.Errorf(\"ClientContextKey was expected to be *client.OryKratos but it contained an invalid type %T \", f)\n\t}\n\n\tendpoint, err := cmd.Flags().GetString(FlagEndpoint)\n\tif err != nil {\n\t\treturn nil, errors.WithStack(err)\n\t}\n\n\tif endpoint == \"\" {\n\t\tendpoint = os.Getenv(envKeyEndpoint)\n\t}\n\n\tif endpoint == \"\" {\n\t\treturn nil, errors.Errorf(\"you have to set the remote endpoint, try --help for details\")\n\t}\n\n\tu, err := url.Parse(endpoint)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, `could not parse the endpoint URL \"%s\"`, endpoint)\n\t}\n\n\tconf := kratos.NewConfiguration()\n\tconf.HTTPClient = httpx.NewResilientClient(\n\t\thttpx.ResilientClientWithConnectionTimeout(10 * time.Second),\n\t).StandardClient()\n\tconf.Servers = kratos.ServerConfigurations{{URL: u.String()}}\n\treturn kratos.NewAPIClient(conf), nil\n}\n\nfunc RegisterClientFlags(flags *pflag.FlagSet) {\n\tflags.StringP(FlagEndpoint, FlagEndpoint[:1], \"\", fmt.Sprintf(\"The URL of Ory Kratos' Admin API. Alternatively set using the %s environmental variable.\", envKeyEndpoint))\n}","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/ory/kratos/blob/b86338da04a040247a07f46100a86dcfb3875909/cmd/cliclient/client.go#L46-L82","documentation":"NewClient found no remote endpoint: neither the --endpoint flag nor the endpoint environment variable (envKeyEndpoint) is set, and the client context did not already carry an API client. The CLI cannot reach any Ory Kratos server without one.","triggerScenarios":"Thrown at cmd/cliclient/client.go:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the --endpoint flag (e.g. --endpoint https://kratos.example.com) on the command being run","Export the endpoint environment variable that NewClient falls back to (envKeyEndpoint)","Verify the flag name with --help if unsure"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b86338da04a040247a07f46100a86dcfb3875909","analyzedAt":"2026-09-07T15:58:15.934Z","contentChangedAt":"2026-09-07T15:58:15.934Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}