> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# blobhub app commit

> Turn the app blob's draft into the version named by app.version

`commit` makes the draft a version. A version is a committed revision named by `app.version`; it never changes again,
and a fix is the next version.

## Synopsis

```bash theme={null}
blobhub app commit [-f <path>] -m <message>
```

| Flag | Default | Description |
| - | - | - |
| `-f`, `--file` | `app.yaml` | The app's `app.yaml`, which names the app blob and the version. |
| `-m`, `--message` | required | The commit's comment, shown as the last column of [`app ls`](https://docs.blobhub.io/cli/app/commands/ls). |

## What it does

It checks what it can before it asks the platform to commit:

1. The app blob's default revision must be a draft. Otherwise `APP_NO_DRAFT`, hinting `blobhub app push`.
2. The draft must be the one `app.yaml` describes: its `describe` version must equal `app.version`. Otherwise
   `APP_DRAFT_STALE`, hinting `blobhub app push`.
3. `describe` must report no problem. Otherwise it prints each as `problem: <text>` on stdout and exits with
   `APP_HAS_PROBLEMS`, the message `N problems`. An answer whose `problems` is missing or not a list of sentences is
   never read as none: it is `API_TRANSIENT_ERROR`, `cannot read the platform's answer: ...; nothing was committed`.
4. No committed revision may already hold this `app.version`. Otherwise `APP_VERSION_EXISTS`; bump `app.version`, push
   and commit again.

The platform runs the same checks when it commits, and its refusals map to the same codes: `invalid_app` to
`APP_HAS_PROBLEMS` and `version_in_use` to `APP_VERSION_EXISTS`; `blob_not_ready` is `BLOB_NOT_READY`, as on every
command. The CLI prints each problem a refusal names as `problem: <text>` on stdout, as its own checks do, then fails
with the platform's own message; under `--json`, stdout is empty and the problems an `invalid_app` refusal names are
in `problems`. Nothing is committed.

It then commits with the message as the comment and waits up to 120 seconds for the revision's phase to become
`commit`. The line names the revision by the first eight characters of its id:

```text theme={null}
committed acme-corp/field-reports 0.3.0 as revision 7c1e2a90; a version is never reopened
```

With `--json`, the result is `app`, `version` and `revision_id`, the whole id.

## Errors

| Code | When |
| - | - |
| `MANIFEST_NOT_FOUND`, `MANIFEST_INVALID` | `app.yaml` is absent or unusable. |
| `FORMAT_UNSUPPORTED`, `FORMAT_PARSE_ERROR` | `app.yaml` has an unsupported extension, or does not parse. |
| `VALUE_NOT_JSON` | `app.yaml` is a YAML document that holds itself, an alias inside its own anchor: `<file>: <path>: holds itself`. |
| `BLOB_REFERENCE_INVALID` | No organization for the app blob: pass `--org` or set `BLOBHUB_ORG`. |
| `BLOB_NOT_ACCESSIBLE` | The app blob is absent or not readable with this key. |
| `BLOB_TYPE_MISMATCH` | A blob of another type holds the alias `app.alias`. |
| `APP_NO_DRAFT`, `APP_DRAFT_STALE` | There is no draft, or it holds another version than `app.yaml`; run `blobhub app push`. |
| `APP_HAS_PROBLEMS` | `describe`, or the platform at commit, reports problems; each is printed as `problem: <text>`. |
| `APP_VERSION_EXISTS` | The app blob already holds a version `app.version`, as the CLI found or the platform refused. |
| `BLOB_NOT_READY` | The app blob is not `ready`; one being deleted or failed is refused with the platform's `blob <org>/<blob> is <status>`, with no hint. Or the platform refused a call `blob_not_ready`, the commit included. Nothing is committed. |
| `REVISION_PENDING` | The revision's phase did not become `commit` within 120 seconds. |
| `CREDENTIALS_NOT_FOUND`, `PROFILE_NOT_FOUND`, `INSECURE_CREDENTIALS_PERMISSIONS` | No usable credential, a credentials file the CLI refuses to read, or an API URL or key no request can carry ([Error codes](https://docs.blobhub.io/cli/error-codes.md#credentials-and-authentication)). |
| `API_RATE_LIMITED`, `API_TRANSIENT_ERROR`, `API_NETWORK_ERROR` | A call failed. `API_TRANSIENT_ERROR` is also a `describe` answer whose `problems` the CLI cannot read. |

Every code above, with its remediation, is in [Error codes](https://docs.blobhub.io/cli/error-codes.md).

## See also

* [`blobhub app push`](https://docs.blobhub.io/cli/app/commands/push) — makes the draft the commit reads.
* [`blobhub app ls`](https://docs.blobhub.io/cli/app/commands/ls) — lists the versions committed.
* [App blob versions](https://docs.blobhub.io/blob-types/app/overview.md#versions) — what a version is, and why one is never reopened.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.