Ruby Library

Beyond the CLI, Neocities Red ships a clean Ruby client you can embed in scripts, rake tasks and static site generator builds.

Basic client

Ruby
require 'neocities-red'

client = NeocitiesRed::Client.new(api_key: 'YOUR_API_KEY')

client.upload(local_path, remote_path)
client.delete(remote_path)
client.list(remote_path)
client.info(sitename)

The client supports both API-key (api_key:) and basic-auth (sitename:/password:) authentication, retries transient failures (429/5xx) automatically, and exposes low-level helpers like upload_hash, delete_wrapper_with_dry_run, key and download.

Advanced: services

For larger automation, use the namespaced service classes:

Ruby
client = NeocitiesRed::Client.new(
  sitename: 'o200',
  password: 'secret'
)

service = NeocitiesRed::Services::File::List.new(
  client,
  '.',
  true
)

files = service.show

Service namespaces

  • NeocitiesRed::Services::File — Uploader, FolderUploader, List, Remover
  • NeocitiesRed::Services::Site — Pusher, Differencer, Exporter, Informer
  • NeocitiesRed::Services::Common — Exclusions, WorkerPool, Pizza

Prefer the CLI? Every service is also exposed as a command — see the CLI reference.