diff --git a/README.md b/README.md index 4afe8f9..7d17bf7 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,11 @@ $ alpacon login $ alpacon login -s [SERVER URL] -u [USERNAME] -p [PASSWORD] ``` -Successful login creates `config.json` in `~/.alpacon`, containing server address, API token, and token expiration (~1 week). -This file is essential for command execution and a new login is required upon token expiration. +A successful login generates a `config.json` file in `~/.alpacon`, which includes the server address, API token, and token expiration time (approximately 1 week). +This file is crucial for executing commands, and you will need to log in again once the token expires. + +Upon re-login, the Alpacon CLI will automatically reuse the server address from `config.json`, unless you provide all the flags (-s, -u, -p). +If you need to connect to a different server or change the server address, you can either directly modify the `config.json` file in ~/.alpacon or provide all flags to specify a new server URL. #### Default Server URL If you do not explicitly specify the server URL (-s) in the command, the default value `https://alpacon.io` is used. diff --git a/cmd/login.go b/cmd/login.go index d8c7681..0f57814 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -47,7 +47,7 @@ func promptForCredentials() { configFile, err := config.LoadConfig() if err == nil && configFile.ServerAddress != "" { loginRequest.ServerAddress = configFile.ServerAddress - fmt.Println("Using server address from config:", configFile.ServerAddress, ". To modify it, edit `~/.alpacon/config.json`") + fmt.Println("Using server address from config:", configFile.ServerAddress, ". Modify it in `~/.alpacon/config.json` or use all flags (-s, -u, -p) for changes.") } else { loginRequest.ServerAddress = utils.PromptForInput("Server Address[https://alpacon.io]: ") if loginRequest.ServerAddress == "" {