The command line: hostbrid

What you get: doing what the panel does by typing one line. Create a site, change its PHP, add a DNS record or list your mailboxes without opening the browser — and, above all, put that inside a script or a pipeline.

It is a single Python 3 file. The hosting and VPS REST commands provide shortcuts; tools discovers the complete MCP catalogue authorized by your key, with its current schemas. No dependencies need installing.

Before you start

You need an API key. You create it in the panel, under Account ‣ AI keys, and it is shown only once. If you do not have one yet, see The API, for automating your account — the first part explains how it is created and what permissions it carries.

Getting it onto your machine

mkdir -p ~/bin
curl -fSLo ~/bin/hostbrid https://my.hostbrid.com/cli/hostbrid.py
chmod +x ~/bin/hostbrid

Check that it responds:

hostbrid --version

Log in

hostbrid login

It asks you for the key and checks it before saving it, so if it tells you the key is ready, it is ready. It is stored in ~/.config/hostbrid/config.json, with permissions so that only you can read it.

To log out, hostbrid logout. Careful: that deletes it from this machine, but the key is still valid. To really kill it you have to revoke it in the panel.

What you will use most

hostbrid whoami                 # de qué cuenta es esta clave
hostbrid sites list             # tus sitios
hostbrid sites show 12          # uno, con todo su detalle
hostbrid dns-zones list         # tus zonas de DNS
hostbrid mailboxes list         # tus buzones

Every command follows the same pattern:

hostbrid <recurso> <acción> [id] [campo=valor ...]

The actions are list, show, create, update and delete. The resources are the same ones you see in the API reference: sites, domains, databases, dns-zones, dns-records, mailboxes, mail-aliases, ftp-accounts, ssl-certificates and a few more. You see them all with hostbrid --help.

Creating things

Data goes in as campo=valor, with no quotes and no braces:

hostbrid sites create domain=ejemplo.com php_version=8.3
hostbrid dns-records create zone=4 name=www type=A value=203.0.113.10

To change something, pass only the field that changes — everything else stays as it is:

hostbrid sites update 12 php_version=8.4

Note

Creating, changing and deleting need your key to hold those permissions, and a newly created key only reads. If it replies that a permission is missing, the reply tells you which one: ask for it in a ticket.

Delete

hostbrid sites delete-preview 12
# Abre confirma_en y aprueba en tu sesión del panel.
hostbrid sites delete 12 --testigo TESTIGO

The preview returns the impact and the confirma_en link. Review and approve in the panel before using the execution token. --si does not replace that approval.

There are three things you cannot delete from here, not even with confirmation — your customer record, your plan and your white label. That deletion cannot be undone with another command, so you do it in the panel, with your eyes on it.

Inside a script or a pipeline

Two things make this work well under automation:

The key is passed in an environment variable, with no configuration file:

export HOSTBRID_TOKEN=nxp_tu_clave
hostbrid sites list

Standard output carries the data and nothing else. Warnings and errors go to standard error, so you can pipe straight through without filtering anything:

hostbrid sites list --json | jq -r '.results[].domain'

For sensitive operations, the pipeline needs the token from a preview approved in the panel. A local confirmation argument does not replace it.

The complete authorized catalogue

hostbrid_get_plan is the stable identifier in every language. Titles and descriptions are translated; commands in your scripts do not change when you switch languages. The previous name, hostbrid_ver_plan, remains accepted when calling the tool for compatibility and is not duplicated in the catalogue.

hostbrid tools list
hostbrid tools list --filter plan
hostbrid tools show hostbrid_get_plan
hostbrid tools call hostbrid_get_plan --arguments '{}'

list follows every page before returning the catalogue; filtering happens locally. show returns the schema of a tool accessible with that key. The arguments to call are a JSON object:

hostbrid tools call hostbrid_get_plan --arguments @argumentos.json
printf '%s' '{}' | hostbrid tools call hostbrid_get_plan --arguments @-

The private catalogue uses /mcp and requires a key with the corresponding MCP permissions. It does not expand REST permissions. To query the public catalogue without an account, explicitly choose hostbrid tools list --public; this mode uses /mcp/public and sends no saved key.

The output of tools is always JSON. call preserves the server’s content, structuredContent and isError, including preview or approval links. A result with isError: true exits with code 1. Usage errors exit with code 2; transport and JSON-RPC errors exit with code 1 and a diagnostic on stderr.

There are no automatic retries. If a call is interrupted, check its result before repeating it; when a tool accepts clave_idempotencia, keep the same value when repeating the operation. The CLI does not invent or change that argument and does not approve purchases or confirmations for you.

Each request has a 30-second deadline (--timeout 1 through --timeout 120 in tools). Each response is limited to 16 MiB, and the catalogue to 100 pages and 10000 tools: exceeding a limit fails without presenting a partial list. Streamable HTTP JSON and SSE responses are supported; an interrupted stream is not resumed and the operation is not repeated.

HOSTBRID_SERVIDOR lets you choose another HTTPS origin without a path, username or password. HTTP is accepted only for localhost. HTTP redirects are rejected to avoid sending the key to another destination.

When the command does not exist yet

If the API has something this program does not know how to call yet:

hostbrid api GET sites/12/
hostbrid api POST databases/ name=mitienda site=12

That way you are not left waiting for a new version.

What this program does not do

The CLI only executes operations authorized by the server. The MCP catalogue may include projects, deployments and other account services, depending on the key’s permissions. Paid operations and sensitive actions retain the panel’s approval requirements; the CLI does not bypass them.

Frequent problems

“The key is not valid (401)”

Either you revoked it, or it was copied wrong. Run hostbrid login again.

“Insufficient permission (403)”

Your key is missing a permission, and the message says which one. You ask for them in a ticket.

“It does not exist, or it is not yours (404)”

The identifier is wrong, or it belongs to another account. The API answers the same way in both cases on purpose: telling them apart would confirm which identifiers exist.

“You have gone over the limit (429)”

Too many requests per minute with that key. Wait and retry.

«command not found: hostbrid» after downloading it

The file is downloaded but it is not executable, or it is not in your PATH. Give it execute permission and call it with its full path the first time.

I don’t want to save the key on the computer

Don’t save it: put it in the HOSTBRID_TOKEN environment variable and skip the login. That’s what you do in a pipeline.

Deletion requires an approval token

Run the preview, open confirma_en and approve in the panel. Use the returned token; --si does not replace approval.

My jq doesn’t receive anything and the command does work

You are capturing the error output instead of the data. The standard output only goes the data; the warnings go separately, just so this works.

I want to delete my customer profile or my plan and it won’t let me

Those three deletions - customer card, plan and white label - are not made from the terminal on purpose: they are not undone, so they are made in the panel, looking at it.

The command I need does not exist

Check hostbrid tools list and hostbrid tools show NOMBRE. For REST routes, use hostbrid api with the method and path.