# Applications

> Build, logs, routes, variables, and secrets.

Web page: /docs/cli/apps/

Write `dflow.json` in the repository first. That file is the source of truth. Create the application with [dflow apps:create](/docs/cli/path/apps-create), then apply the file with [dflow apps:document](/docs/cli/apps/apps-document). Deploy an image with [dflow apps:deploy](/docs/cli/path/apps-deploy), or build from Git or a local directory with [dflow apps:build](/docs/cli/apps/apps-build), when you do not have the file yet. Those commands update the stored copy. Request a hostname with [dflow apps:route:set](/docs/cli/path/apps-route-set).

If the deploy `status` is `failed`, stop. Fix the image or the build before you ask for a route.

[dflow apps:restart](/docs/cli/path/apps-restart) replaces the running containers and keeps the same release. [dflow apps:logs](/docs/cli/apps/apps-logs) reads what the containers printed. Environment variables are visible. Secrets are names only, until you set a new value.

- [dflow apps:list](/docs/cli/apps/apps-list)
- [dflow apps:inspect](/docs/cli/apps/apps-inspect)
- [dflow apps:report](/docs/cli/apps/apps-report)
- [dflow apps:document](/docs/cli/apps/apps-document)
- [dflow apps:build](/docs/cli/apps/apps-build)
- [dflow apps:logs](/docs/cli/apps/apps-logs)
- [dflow apps:events](/docs/cli/apps/apps-events)
- [dflow apps:events:pods](/docs/cli/apps/apps-events-pods)
- [dflow apps:releases:list](/docs/cli/apps/apps-releases-list)
- [dflow apps:rollback](/docs/cli/apps/apps-rollback)
- [dflow apps:delete](/docs/cli/apps/apps-delete)
- [dflow apps:route:show](/docs/cli/apps/apps-route-show)
- [dflow apps:route:delete](/docs/cli/apps/apps-route-delete)
- [dflow apps:env:get](/docs/cli/apps/apps-env-get), [dflow apps:env:set](/docs/cli/apps/apps-env-set), and [dflow apps:env:unset](/docs/cli/apps/apps-env-unset)
- [dflow apps:secret:list](/docs/cli/apps/apps-secret-list), [dflow apps:secret:set](/docs/cli/apps/apps-secret-set), and [dflow apps:secret:unset](/docs/cli/apps/apps-secret-unset)
