Authentication

Neocities Red resolves your Neocities credentials in a predictable order — so you can log in interactively or script it in CI.

Credential resolution order

  1. --api-key flag — neocities-red --api-key <key> push .
  2. NEOCITIES_API_KEY environment variable
  3. Stored config — the API key saved by a previous interactive login
  4. Interactive login — prompts for sitename/username and password

Environment variables

For non-interactive logins (for example, in CI), you can set:

VariablePurpose
NEOCITIES_API_KEYAPI key used as a Bearer token
NEOCITIES_SITENAMEDefault sitename/username for the login prompt
NEOCITIES_PASSWORDDefault password for the login prompt
Non-interactive push
NEOCITIES_API_KEY="your-api-key" neocities-red push .

Stored config file

The config file is stored per platform:

PlatformLocation
Linux$XDG_CONFIG_HOME/neocities/config.json (defaults to ~/.config/neocities/config.json)
macOS~/Library/Application Support/neocities/config.json
Windows%LOCALAPPDATA%\neocities\config.json
FreeBSD / other~/.neocities/config.json

Logout

Remove the stored API key with:

Logout
neocities-red logout -y