gget

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2024 License: MPL-2.0 Imports: 26 Imported by: 0

README

gemini get

Gemini get (gget) is a terminal application that can be used to fetch gemini pages. gget also supports uploading files with titan and using client certificates.

Usage

There are two modes of gget: fetching and client certificate generation.

Gget aims to be intelligent about how it is being used. Outputs from the server always go to stdout. Information about the request goes to stderr. If stderr is being piped, then colored output is automatically disabled. If stdin is piped, then the request will be converted to a titan request and upload the piped data.

Fetching

You do not need to specify the scheme of the url. gget will automatically assume what scheme you are trying to use.

gget [options] <URL> [options]

Options:

  • -color Enable colored output

  • -no-color Disable colored output

  • -no-verify Don't verify server certificate

  • -input Enable asking for input

  • -no-input Disable asking for input

  • -redirects int Max number of redirects (default 10)

  • -no-redirects Disable redirects

  • -cert string Client certificate to use

  • -key string Client certificate key to use

Titan options:

  • -delete Send a titan delete request
  • -token string Token to use with titan
  • -upload string File to upload using titan
  • -mime string Content type of the file to be uploaded
Examples
>>> gget geminiprotocol.net > /dev/null
gemini://geminiprotocol.net
31 gemini://geminiprotocol.net/
gemini://geminiprotocol.net/
20 text/gemini

>>> gget my.capsule.com/file.gmi -upload file.gmi
titan://geminiprotocol.net/file.gmi;size=83
53 Proxy request refused
 Unsupported URL scheme

>>> cat file.gmi | gget my.capsule.com/file.gmi
titan://geminiprotocol.net/file.gmi;size=83
53 Proxy request refused
 Unsupported URL scheme

>>> gget my.capsule.com/file.gmi -delete
titan://geminiprotocol.net/file.gmi;size=0
53 Proxy request refused
 Unsupported URL scheme

Generating client certs

You can generate client certs using the gencert mode. It generates an ECDSA-P384 certificate. If no output file is given, then both the certificate and key will be exported to the same file. You may have the key separated from the certificate by supplying the -key option.

gget gencert [options] <COMMON NAME> [options]

Options:

  • -color Enable colored output

  • -no-color Disable colored output

  • -expires value Time to expire: year, month, week, day, hour (default 1y)

  • -file string File to save the certificate as (default .crt)

  • -key string File to save the certificate key as

Examples
>>> gget gencert temp -expires 1h
Generating private key
Generating certificate
  Serial number a502a8b91e5ba106b6d584e5f1724856c70ba977
  CN temp
  Expires Sat, 23 Nov 2024 16:13:01 MST
Writing certificate to temp.crt
Writing key to temp.crt

>>> gget gencert temp -expires 1h -key temp.key
Generating private key
Generating certificate
  Serial number a502a8b91e5ba106b6d584e5f1724856c70ba977
  CN temp
  Expires Sat, 23 Nov 2024 16:13:01 MST
Writing certificate to temp.crt
Writing key to temp.key

>>> gget gencert temp -expires 1h -file my-cert.pem -key my-key.pem
Generating private key
Generating certificate
  Serial number a502a8b91e5ba106b6d584e5f1724856c70ba977
  CN temp
  Expires Sat, 23 Nov 2024 16:13:01 MST
Writing certificate to my-cert.pem
Writing key to my-key.pem

Install from source

You can build gget with golang. If you don't have golang installed, you can download it from go.dev. You will need at least go 1.22.3.

You can build gget by running the following command:

go install git.sr.ht/~ttocsneb/gget@latest

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL