[mirror] Command-line application for uploading a site to a git-pages server
Go 79.5%
Nix 14.6%
Dockerfile 6.0%
31 1 13

Clone this repository

https://tangled.org/whitequark.org/git-pages-cli
git@tangled.org:whitequark.org/git-pages-cli

For self-hosted knots, clone URLs may differ based on your setup.

README.md

git-pages-cli#

git-pages-cli is a command-line application for publishing sites to git-pages.

If you want to publish a site from a Forgejo Actions workflow, use git-pages/action instead.

Installation#

You can install git-pages-cli using one of the following methods:

  1. Downloading a binary. You can download the latest build or pick a release.

  2. Using a Docker container. Choose between the latest build or a release tag. Then run:

    $ docker run --rm codeberg.org/git-pages/git-pages-cli:latest ...
    
  3. Installing from source. First, install Go 1.25 or newer. Then run:

    $ go install codeberg.org/git-pages/git-pages-cli@latest
    

Usage#

To prepare a DNS challenge for a given site and password:

$ git-pages-cli https://example.org --password xyz --challenge
_git-pages-challenge.example.org. 3600 IN TXT "317716dee4379c167e8b5ce9df38eb880e043e5a842d160fe8d5bb408ee0c191"
$ git-pages-cli https://example.org --password xyz --challenge-bare
317716dee4379c167e8b5ce9df38eb880e043e5a842d160fe8d5bb408ee0c191

To publish a site from a git repository available on the internet (--password may be omitted if the repository is allowlisted via DNS):

$ git-pages-cli https://example.org --upload-git https://codeberg.org/username/example.org.git
$ git-pages-cli https://example.org --password xyz --upload-git https://codeberg.org/username/example.org.git

To publish a site from a directory on your machine:

$ git-pages-cli https://example.org --password xyz --upload-dir site-contents

To delete a site:

$ git-pages-cli https://example.org --password xyz --delete

It is not possible to publish a site to a domain for the first time using HTTPS, since the git-pages server is not allowed to acquire a TLS certificate for a domain before a site is published on that domain. Either use plain HTTP instead, or provide a hostname for which the server does have a TLS certificate using the --server option:

$ git-pages-cli https://example.org --server grebedoc.dev --password xyz --upload-dir ...

Advanced usage#

To retrieve the site manifest (for debugging only: manifest schema is not versioned and subject to change without notice, including renaming of existing fields):

$ git-pages-cli https://example.org --password xyz --debug-manifest
{
  "contents": {
    "": {
      "type": "Directory"
    },
    "index.html": {
      "type": "InlineFile",
      "size": "5",
      "data": "bWVvdwo=",
      "contentType": "text/html; charset=utf-8"
    }
  },
  "originalSize": "5",
  "compressedSize": "5",
  "storedSize": "0",
  "redirects": [],
  "headers": [],
  "problems": []
}

License#

0-clause BSD