> ## 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.

# App overview

> The developer's loop: build the app, push it to its blob, try it, commit a version

An app is written in a git repository and published as a blob. The `app` command group is the path between the two:
`build` compiles the repository's sources, `push` makes the app blob's draft equal that build, `pull` copies edits made
in the visual editor back, `commit` turns the draft into a version, and `ls` lists the versions. What an app is, and
how an organization installs it, is defined elsewhere; this group makes the files.

The examples use the fictional Field Reports app, `acme-corp/field-reports`.

## The repository

```text theme={null}
field-reports/                          the repository
  app.yaml                              the app: alias, label, version, inputs, accounts, migration
  README.md  LICENSE                    the app blob's Readme and License
  blobs/
    flows/
      blob.yaml                         a blobhub.compute.workflow blob and its manifest
      definitions/                      graphs and layouts
      src/                              Python, compiled into the graphs' code components
    schedules/
      blob.yaml                         a blobhub.compute.scheduler blob
  schemas/config.json                   what the `config` input is checked against
  build/                                git-ignored: written by build, uploaded by push
  tests/  tools/  docs/                 the repository's own; never uploaded
```

The app is `app.yaml`, `blobs/` and `schemas/`, with `README.md` and `LICENSE`. Everything else is the repository's.
[`app.yaml`](https://docs.blobhub.io/blob-types/app/app-yaml) and each folder's [`blob.yaml`](https://docs.blobhub.io/blob-types/app/blob-yaml) are the definition
formats; a blob's [content and runtime](https://docs.blobhub.io/blob-types/app/blob-yaml.md#content-and-runtime) are described there.

## The loop

```mermaid theme={null}
sequenceDiagram
  participant D as Developer
  participant C as blobhub app
  participant A as App blob draft
  participant I as Installer blob
  D->>C: push --install reports-dev
  C->>C: build into build/
  C->>A: put changed files, delete removed ones
  A-->>C: describe, problems if any
  C->>I: install the draft over reports-dev
  I-->>C: log lines, then ready
  C-->>D: what changed, the log
  D->>I: edit a graph in the visual editor
  D->>C: pull reports-dev
  C-->>D: definitions/*.json updated
```

1. **Develop** in the repository.
2. **`blobhub app push --install reports-dev`** builds, uploads what changed to the app blob's draft, and installs the
   draft over a development installation in the same organization. A second run sends only what changed. It confirms
   by itself over a new or development installation whose plan deletes no blob; a plan that deletes one, or a
   committed installation that is `uninstalled`, waits for `--yes`. A ready or failed installation of committed
   versions never takes the draft, `--yes` or not ([`--install`](https://docs.blobhub.io/cli/app/commands/push#--install)).
3. **Edit visually** where it helps. A
   [development installation's](https://docs.blobhub.io/blob-types/installer/overview.md#development-installations) blobs are editable,
   so the workflow editor and the playground work on them as on any blob.
4. **`blobhub app pull reports-dev`** copies those edits back into `blobs/<alias>/definitions/`.
5. **`blobhub app commit -m "Weekly digest"`** makes the draft the version in `app.version`.

## `build/` is the app blob

`build/` has the sources' paths, with two differences: code and widgets are compiled into the definitions, so `src/`
and widget projects are not copied, and each manifest loses its `build` keys. The app blob holds `build/` file for file,
except `README.md` and `LICENSE`, which become the draft's Readme and License. It is a pure function of the sources, so
the same sources give the same bytes and a second push uploads nothing. Git ignores `build/`; it is disposable, and
`build` warns with `BUILD_NOT_IGNORED` when it is not ignored.

## The first push creates the app blob

The first `push` creates the app blob named by `app.alias`, in the organization `--org` names, private, and waits until
it is ready. An alias held by a blob this key cannot read is `BLOB_NOT_ACCESSIBLE`, and one held by a blob of another
type is `BLOB_TYPE_MISMATCH`. A push whose
blob's default revision is already committed creates a new draft revision first. Nothing else is created: the blobs the
app makes are made by an [installation](https://docs.blobhub.io/cli/installer/overview.md), never by a push.

## The commands

```bash theme={null}
blobhub app build  [-f app.yaml]
blobhub app push   [-f app.yaml] [--install <alias> [--installer <org/blob>] [--input <name=value>] [--yes]]
blobhub app pull   <alias> [-f app.yaml]
blobhub app commit [-f app.yaml] -m <message>
blobhub app ls     <org>/<app>
```

| Command | What it does | Network | Writes |
| - | - | - | - |
| [`build`](https://docs.blobhub.io/cli/app/commands/build) | Compiles the sources into `build/`. | None | `build/` |
| [`push`](https://docs.blobhub.io/cli/app/commands/push) | Builds, then makes the app blob's draft equal `build/`; `--install` installs the draft. | Write | The draft; with `--install`, an installation |
| [`pull`](https://docs.blobhub.io/cli/app/commands/pull) | Copies visual edits of an installation back into the sources. | Read | Definition files |
| [`commit`](https://docs.blobhub.io/cli/app/commands/commit) | Turns the draft into the version `app.version`. | Write | A version |
| [`ls`](https://docs.blobhub.io/cli/app/commands/ls) | Lists the app blob's versions. | Read | Nothing |

The CLI never waits on input. A command that would ask a question prints what it found and refuses, and `--yes` is how
a confirmation is given; the installation commands are in [the installer group](https://docs.blobhub.io/cli/installer/overview.md).

## See also

* [Building an App](https://docs.blobhub.io/general/building-an-app.md) — the whole path with Field Reports, from the repository to an install
  in another organization.
* [App blob type](https://docs.blobhub.io/blob-types/app/overview.md) — revisions, versions and who may push and commit.
* [`app.yaml`](https://docs.blobhub.io/blob-types/app/app-yaml) and [`blob.yaml`](https://docs.blobhub.io/blob-types/app/blob-yaml) — the formats `build` reads.
* [Installer blob type](https://docs.blobhub.io/blob-types/installer/overview.md) — installations, development installations and
  [the log](https://docs.blobhub.io/blob-types/installer/overview.md#the-log).
* [Installer commands](https://docs.blobhub.io/cli/installer/overview.md) — install, uninstall, remove, list and follow an installation.
* [Error codes](https://docs.blobhub.io/cli/error-codes.md) — every code these commands can raise.


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