# hub deploy

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

Deploy the folder or a GitHub repository. Public repositories need no GitHub grant; use `--watch` for push-to-deploy. Prints the URL when the app is live.

Deploy the current local files by default, including uncommitted changes. Use `--git` for a GitHub repository. The app name defaults to `hub.yaml`, the folder, or the repository. Hub detects the project, waits for the release, and prints its URL. New apps are accessible to your organization.

Use `--pushed` to deploy the last pushed commit from a GitHub checkout. Public repositories clone anonymously. Private repositories require a GitHub grant. New GitHub repositories deploy once; redeploying the same repository keeps its auto-deploy setting. Use `--watch` or `--no-watch` to change it (watching requires a GitHub grant).

Existing uploads require confirmation because Hub cannot verify folder identity. Changing GitHub repository, branch or path also requires confirmation. Use `--force` for scripts after checking the target; JSON and MCP never prompt. Managed Workspace cannot be replaced by a plain deploy, even with `--force`. Choose another name.

## Usage

```sh
hub deploy [options] [dir]
```

## Arguments

| Argument | Description                         |
| -------- | ----------------------------------- |
| `[dir]`  | App folder. Optional. Default: `.`. |

## Options

| Option              | Description                                                                                                        |
| ------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `--name <app>`      | Override the app name from `hub.yaml`, the folder, or the repository.                                              |
| `--force`           | Confirm replacing an existing upload or changing GitHub source; cannot replace managed Workspace.                  |
| `--instance <name>` | Instance to deploy to, default prod.                                                                               |
| `--public`          | Let anyone open it, with no login.                                                                                 |
| `--logs`            | Print the full build log instead of the compact summary.                                                           |
| `--detach`          | Return once the upload finishes, without following the release.                                                    |
| `--git <repo>`      | Connect and deploy a GitHub repository (owner/name or a URL), with no local checkout.                              |
| `--branch <name>`   | Branch to deploy, with `--git` (default the repository default).                                                   |
| `--path <path>`     | Subfolder to deploy, with `--git` (default the repository root).                                                   |
| `--watch`           | With `--git` or `--pushed`, redeploy on every push (requires a GitHub grant).                                      |
| `--no-watch`        | With `--git`, do not redeploy on every push.                                                                       |
| `--pushed`          | Deploy the last pushed commit whatever the folder holds; fails when nothing here is on GitHub. Not with `--local`. |
| `--local`           | Upload the current local files (default).                                                                          |
| `--json`            | Return a structured release immediately, without waiting for the build.                                            |

## Examples

```sh
# Deploy the files in this folder
hub deploy

# Deploy a GitHub repository once
hub deploy --git owner/repository

# Deploy local files to staging
hub deploy --instance staging
```