Nevermore: a Poet's Mantra


    0.0.10 • Public • Published

    Hetzner CLI


    Global Installation

    $ npm install hetzner -g

    On top level, the CLI needs the --api-key argument.

    $ hetzner --api-key XXX ...

    Example with zones

    $ hetzner --api-key XXX zones get


    Get zones

    # Get all zones
    $ zones get
    # Get all zones that are matching the phrase 'blue'
    $ zones get blue
    # Get all zones that are matching exactly
    $ zones get

    Update zone

    Argument Type Description Required
    --ttl Number Current zone TTL No
    # Updates TTL of zone to 300
    $ zones update --ttl 300

    Create Zone

    Argument Type Description Required
    --ttl Number New zone's TTL No
    # Creates new zone with TTL 3600
    $ zones create --ttl 3600

    Delete Zone

    # Deletes zone
    $ zones delete

    Export Zone

    # Export zone
    $ zones export


    Argument Type Description Required
    --zone String Current zone query No

    Addressing records

    Internally, Hetzner's records are related to unqiue ids as zones described above. When using this CLI, you can either address them by their unique id but also by the following search query www:AAAA. In combination with the --zone argument, this makes using this CLI much more easy because you do not have to write down a record's id before addressing it. For security reasons, this will not work if you call update and there are more than one matching records. Normally, this only happens if you're using the query syntax as :AAAA (which points to all type AAAA records in the --zone) or as www: (which points to all www records in the --zone). If you're specifying type and type, two matching records would mean that your DNS records are ambiguous.

    Find records

    Argument Type Description Required
    --detail Boolean Show id of records No
    # Find all www records
    $ records --zone get www:
    # Find all records of type AAAA
    $ records --zone get :AAAA
    # Find all www records of type AAAA (Should only return one)
    $ records --zone get www:AAAA
    # Find all records of any type
    $ records --zone get
    # This works even great to find all records of any type
    $ records --zone get :
    # Find all records of any type with their id
    $ records --zone get --detail

    Update record

    Argument Type Description Required
    --name String Record's updated name No
    --type String Record's updated type No
    --value String Record's updated value No

    By query

    # Updates A type record's IPv4 address
    $ records --zone update www:a --value
    # Updates A type record's name from 'www' to 'sub'
    $ records --zone update www:a --name sub
    # This is will make pointing to the IPv4, pointed before
    # Tries to a A type record to type AAAA without updating the value to a valid IPv6 address
    $ records --zone update www:a --type AAAA # this will fail

    By id

    If you know your record's unique id, you can also pass it instead of the query xxx:xxx

    # Updates the IPv4 value of a record withe id XXXXXXXXXXXXXXXXX
    # As you can see you do not have to give the zone as an argument, which is more performant
    $ records update XXXXXXXXXXXXXXXXX --value

    Create record

    By query

    # Creates a A type 'www' record in zone
    $ records --zone create www:A

    Delete record

    By query

    # Deletes the A type 'www' record
    $ records --zone delete www:a

    By id

    # Deletes the specific record with the id XXXXXXXXXXXXXXX
    $ records delete XXXXXXXXXXXXXXX



    npm i hetzner

    DownloadsWeekly Downloads






    Unpacked Size

    19.4 kB

    Total Files


    Last publish


    • mauriceconrad