Skip to content
Automating / CLI

CLI

hoster -- every action in the browser as a command, signed in as you, with your role.

hoster is one file of standard-library Ruby, served by your KamalCloud. No bundler, no gems, no toolchain – whatever #!/usr/bin/env ruby finds has to be able to run it, and that is the whole dependency list.

It reads /openapi, the app’s own description of what it can do, so every action a person can take in the browser is already a command. It never needs updating when KamalCloud grows.

Installing

curl -fsSL https://app.kamalcloud.com/install | sh
hoster login https://app.kamalcloud.com

That fetches the CLI into ~/.local/bin, which is on the path of most distributions and needs no sudo; where it is not on yours, the script says so. hoster login opens the browser, you sign in there, and the CLI is handed a token of its own. Add --read-only for a sign-in that can look but not change anything.

For CI and scripts, pass a personal token instead:

curl -fsSL https://app.kamalcloud.com/install | sh -s -- hst_xxxxxxxx

The sign-in is saved in ~/.config/hoster/config.json. HOSTER_URL and HOSTER_TOKEN override it, which is the way to do it in CI.

Commands

hoster commands                  # everything you can run
hoster help servers create       # one command's fields
hoster servers index             # every machine
hoster apps show 3               # one app; ids fill the path in order
hoster deploy 7 --wait           # deploy an environment and follow its log until it settles
hoster rollback 7 --yes          # a rollback takes the live release offline, so it asks first
hoster security scans create     # scan every server now

Fields are flags, and dotted keys nest: --server.name web-3. @path reads a value from a file.

Output is JSON when piped and text in a terminal; --json and --human force one or the other. --ids-only, --count and --field a.b.c cut it down for a script.

Asking first

Anything that costs money, cannot be undone or takes something offline stops and says what it would do. Run it again with --yes once the person agrees. Deleting an environment or an app is browser-only, behind an authenticator code.

Exit statuses

One per kind of failure, so a pipeline can tell them apart (hoster help exit-codes):

Status Meaning
0 It worked
1 It failed, or what --wait followed failed
2 Wrong or missing inputs
3 No such record
4 Not signed in, or the token was revoked
5 Your role can’t, or KamalCloud refused it as things are
6 Fix the fields named in the errors
7 This sign-in is read-only
8 Can’t reach KamalCloud
9 It needs --yes

AI apps

hoster mcp                       # a stdio MCP server for desktop apps
hoster agent setup               # teach Claude Code: a skill and a startup check
hoster doctor                    # check the install, the sign-in and the agent setup

See MCP for what a client is offered.