Authentication Commands
Plain meaning: Verify and manage credentials for external services.
Overview
The authentication commands help you verify that your credentials are properly configured and can successfully authenticate with Wikiverse (Wikidata, Wikipedia, Wikimedia Commons) and OpenStreetMap services.
Wikiverse Authentication
Wikiverse commands manage authentication for all Wikimedia projects (Wikidata, Wikipedia, Wikimedia Commons) using bot password credentials.
Login
gkc auth wikiverse login
Logs into Wikiverse using bot password credentials.
Options:
- --interactive: Prompt for credentials if environment variables are missing
- --api-url: Override the Wikiverse API URL
Example:
gkc auth wikiverse login --interactive
Status
gkc auth wikiverse status
Checks whether credentials are available and whether a CSRF token can be obtained. This is the recommended way to verify your authentication setup.
Options:
- --api-url: Override the Wikiverse API URL
Example:
gkc auth wikiverse status
gkc --json auth wikiverse status
Token
gkc auth wikiverse token
Retrieves a CSRF token for debugging purposes. Tokens are redacted by default for security.
Options:
- --interactive: Prompt for credentials if environment variables are missing
- --api-url: Override the Wikiverse API URL
- --show-token: Display the full token (use with caution)
Example:
gkc auth wikiverse token
gkc auth wikiverse token --show-token
OpenStreetMap Authentication
OpenStreetMap commands verify that OSM credentials are properly configured.
Login
gkc auth osm login
Confirms whether OpenStreetMap credentials are present.
Options:
- --interactive: Prompt for credentials if environment variables are missing
Example:
gkc auth osm login --interactive
Status
gkc auth osm status
Reports whether OpenStreetMap credentials are available.
Example:
gkc auth osm status
gkc --json auth osm status
Environment Variables
Wikiverse
These environment variables configure Wikiverse authentication:
WIKIVERSE_USERNAME: Your bot username (format:YourUsername@BotName)WIKIVERSE_PASSWORD: Your bot passwordWIKIVERSE_API_URL: API URL (optional, defaults to Wikidata)
Example:
export WIKIVERSE_USERNAME="MyUser@MyBot"
export WIKIVERSE_PASSWORD="abc123def456"
OpenStreetMap
These environment variables configure OSM authentication:
OPENSTREETMAP_USERNAME: Your OSM usernameOPENSTREETMAP_PASSWORD: Your OSM password
Example:
export OPENSTREETMAP_USERNAME="myuser"
export OPENSTREETMAP_PASSWORD="secret123"
Output Formats
Human-Readable Output
By default, commands output simple status messages:
$ gkc auth wikiverse status
Credentials and token validated
authenticated: True
logged_in: True
api_url: https://www.wikidata.org/w/api.php
token_ok: True
JSON Output
Use the --json flag for machine-readable output suitable for scripts:
$ gkc --json auth wikiverse status
{
"command": "auth.wikiverse.status",
"ok": true,
"message": "Credentials and token validated",
"details": {
"authenticated": true,
"logged_in": true,
"api_url": "https://www.wikidata.org/w/api.php",
"token_ok": true
}
}
Security Notes
- Tokens are automatically redacted in output unless
--show-tokenis explicitly used - Never commit credentials or tokens to version control
- Use environment variables or interactive prompts instead of command-line arguments for credentials
- The
--jsonoutput is safe to log as it redacts sensitive information by default
Related Documentation
- Authentication Guide - Detailed guide for setting up authentication in your code
- CLI Overview - Main CLI documentation