Skip to content

Ratakor/neocities-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neocities-zig

neocities-zig is a CLI and a library for the Neocities REST API.

CLI Installation

AUR (Arch Linux)

git clone https://aur.archlinux.org/neocities-zig-bin.git
cd neocities-zig-bin
makepkg -si

Manual Installation

Grab one of the release according to your system. Zsh completions are available here.

Building

Requires zig 0.15.1

git clone https://github.com/ratakor/neocities-zig.git
cd neocities-zig
zig build -Doptimize=ReleaseSafe

Configuration

Config File

When launching neocities for the first time you will be granted with a menu where you can enter your username and password. This will get an api key from neocities and save it in a config file so you won't have to connect again.

Environment Variables

  • NEOCITIES_API_KEY: use this if you don't want a config file.
  • NEOCITIES_USERNAME: only used for setting up the config file.
  • NEOCITIES_PASSWORD: only used for setting up the config file.

Library Installation

Add it to an existing project with this command:

zig fetch --save git+https://github.com/ratakor/neocities-zig

Add the module to build.zig like that:

const neocities = b.dependency("neocities", .{});
exe.root_module.addImport("Neocities", neocities.module("neocities"));

And import it on a file.zig:

const Neocities = @import("Neocities");

Check src/main.zig for a detailed example on how to use the library.

CLI Usage

Usage: neocities <command> [options]

Commands:
  upload     | Upload files to your Neocities website.
  delete     | Delete files from your Neocities website.
  info       | Display information about a Neocities website.
  list       | List files from your Neocities website.
  key        | Display the API key.
  logout     | Remove the API key from the configuration file.
  help       | Display information about a command.
  version    | Display program version.

About

Zig CLI and API for neocities.org

Topics

Resources

License

Stars

Watchers

Forks

Languages