Configuration
goto uses a TOML configuration file for storing credentials and settings.
Configuration File Location
The configuration file is stored at:
- Linux:
~/.config/goto/goto-config.toml - Windows:
%APPDATA%/goto/goto-config.toml - macOS:
~/Library/Application Support/goto/goto-config.toml
File Format
The configuration file uses TOML format:
[credentials]
[credentials."example.com:latest"]
id = "example.com:latest"
username = "user@example.com"
password = "password"
[credentials."api.internal.com"]
id = "api.internal.com"
username = "apiuser"
password = "secret123"Accessing Credentials in Scripts
Use the global config object to access stored credentials:
// Access specific credential
creds := config.Credentials["example.com:latest"]
username := creds.Username
password := creds.Password
// Use in API calls
auth := username + ":" + password
headers := {
"Authorization": "Basic " + base64.encode(auth)
}
response := fetch("https://example.com/api", {
"headers": headers
})Adding Credentials
Method 1: Manual Editing
- Locate your configuration file
- Open in a text editor
- Add a new credential entry:
[credentials."myservice.com"]
id = "myservice.com"
username = "myusername"
password = "mypassword"- Save the file
- Restart goto
Method 2: Programmatic (Advanced)
In a goto script (requires write permissions):
// This is typically not recommended
// Manual editing is preferredSecurity Considerations
⚠️
Security Note: Credentials are stored in plain text in the configuration file. Only store credentials for internal, trusted services.
- Limit file permissions (read/write for owner only)
- Don’t share your configuration file
- Don’t commit configuration files to version control
- Use service accounts when possible
- Rotate passwords regularly
Environment-Specific Configuration
For different environments (dev, test, prod), use different credential IDs:
[credentials."api.internal.com:dev"]
id = "api.internal.com:dev"
username = "devuser"
password = "devpass"
[credentials."api.internal.com:prod"]
id = "api.internal.com:prod"
username = "produser"
password = "prodpass"Access in script:
env := "prod" // or "dev"
credId := "api.internal.com:" + env
creds := config.Credentials[credId]Troubleshooting
Credentials Not Found
If config.Credentials["myid"] returns nil:
- Check the credential ID matches exactly (case-sensitive)
- Verify the configuration file exists
- Ensure TOML syntax is correct
- Restart goto after editing
File Permissions
On Linux/macOS, ensure proper permissions:
chmod 600 ~/.config/goto/goto-config.tomlThis restricts access to the file owner only.