Command-line interface for Hostinger VPS, DNS, domain, firewall, and SSH key management. JSON output by default so AI agents and scripts can consume it directly, with a human-friendly mode when you're working interactively.
npm install -g @fredlackey/cli-hostinger
Every command accepts credentials directly as flags. No setup step is required.
hostinger vps list --api-token <token>
hostinger dns list --domain example.com --api-token <token>
hostinger firewall add-rule \
--api-token <token> \
--id <firewall-id> \
--protocol tcp \
--port 443 \
--source any
If you've already run hostinger configure, you can omit the credential flags:
hostinger vps list
hostinger vps restart --id <vm-id>
hostinger key create --name deploy --key @~/.ssh/id_ed25519.pub
The configure command is optional. Every command accepts credentials directly as flags (e.g. --api-token). You never need to run configure to use this tool. It exists as a convenience so you don't have to pass the same flags on every invocation.
hostinger configure --api-token <token>
Running hostinger configure without flags prompts for the token interactively. Credentials are stored in ~/.config/cli-hostinger/config.json and that file is the only config source. There are no environment variables to set.
Create a token at Hostinger > Profile > API Tokens.
If a required credential is missing at runtime, the error tells you exactly what to do:
{
"error": "Missing required value: --api-token. Pass it as a flag or run \"hostinger configure\"."
}For the complete list of commands and flags, see COMMANDS.md.
All commands write JSON to stdout by default. When run in an interactive terminal, output switches to a human-friendly format with colors. Use the global --json and --interactive flags to override the auto-detection.
If you find a gap or have a feature request, open an issue or submit a pull request on GitHub.
If you have questions, comments, or just want to talk shop, feel free to reach out.
Fred Lackey
fred.lackey@gmail.com
https://fredlackey.com
Apache-2.0