# CLI reference

Source: https://docs.myhub.host/cli

Install the CLI with npm. It needs Node.js 22.12 or newer.

```sh
npm install --global @hubhq/cli@latest
```

Commands that act on one app start with `hub app <name>`. The name is the app, or `app/instance` for an instance other than `prod`, such as `my-app/staging`. In a terminal, `hub --help`, `hub app my-app --help` and `hub app my-app logs --help` print the same text as these pages.

## Account

| Command                     | Description                   |
| --------------------------- | ----------------------------- |
| [`hub login`](https://docs.myhub.host/cli/login)   | Log in, or create an account. |
| [`hub logout`](https://docs.myhub.host/cli/logout) | Forget the saved login.       |
| [`hub whoami`](https://docs.myhub.host/cli/whoami) | Show who is logged in.        |

## Apps

| Command                      | Description                                           |
| ---------------------------- | ----------------------------------------------------- |
| [`hub deploy`](https://docs.myhub.host/cli/deploy)  | Deploy a folder, or a GitHub repository with `--git`. |
| [`hub apps`](https://docs.myhub.host/cli/apps)      | List your apps and their instances.                   |
| [`hub app <name>`](https://docs.myhub.host/cli/app) | Check, share and run one app.                         |

## Agent tools

| Command                   | Description                                         |
| ------------------------- | --------------------------------------------------- |
| [`hub skill`](https://docs.myhub.host/cli/skill) | Print the bundled Hub deployment skill as Markdown. |

## Team

| Command                       | Description                   |
| ----------------------------- | ----------------------------- |
| [`hub invite`](https://docs.myhub.host/cli/invite)   | Invite someone to your org.   |
| [`hub members`](https://docs.myhub.host/cli/members) | List the members of your org. |
| [`hub leave`](https://docs.myhub.host/cli/leave)     | Leave your org.               |

## More

| Command                           | Description                                                                 |
| --------------------------------- | --------------------------------------------------------------------------- |
| [`hub workspace`](https://docs.myhub.host/cli/workspace) | Manage the org workspace.                                                   |
| [`hub validate`](https://docs.myhub.host/cli/validate)   | Check the `hub.yaml` in an app folder.                                      |
| [`hub usage`](https://docs.myhub.host/cli/usage)         | Show organization plan, allocation usage, runtime inventory and AI Credits. |
| [`hub tokens`](https://docs.myhub.host/cli/tokens)       | Manage org-scoped deploy tokens for CI (admin required).                    |

## Global options

Every command takes these, and `--help`.

| Option          | Description                                              |
| --------------- | -------------------------------------------------------- |
| `-V, --version` | Output the version number.                               |
| `--url <url>`   | Control plane URL, overrides the saved login and config. |

## Examples

```sh
# Log in, or create an account
hub login

# Deploy the files in this folder
hub deploy

# List your apps
hub apps

# Follow build and runtime logs
hub app my-app logs

# Everything you can do with one app
hub app my-app --help
```