Skip to content

hostinger/api-cli

Repository files navigation

Hostinger API CLI

hapi is the command line interface for the Hostinger API.

This repository is generated. Do not open pull requests here — every file is overwritten by the next generation run. The CLI is generated from the OpenAPI specification by hostinger/public-api-generator (see the cli/ directory there). Report issues or contribute in that repository.

Installation

Download the binary for your platform from the releases page.

Configuration

Create $HOME/.hapi.yaml:

api_token: <your API token>

or set the HAPI_API_TOKEN environment variable. Generate a token at hPanel → API.

Usage

hapi <group> <subgroup> <verb> [args] [flags]

Examples:

hapi billing catalog list
hapi vps virtual-machines list
hapi vps vm start 123          # vm is an alias for virtual-machines
hapi dns records list example.com

Output format defaults to a table; use --format json|table|tree to change it. Command documentation lives in docs/, and manifest.json maps every API operation to its command. Shell autocompletion: see AUTOCOMPLETE.md.

Contributors

Languages