# uip codedapp push

> Syntax and options for `uip codedapp push`, which uploads local source to a Studio Web coded app project.

`uip codedapp push` uploads local source to a Studio Web project. It uploads the build output in `--build-dir` (default `dist`) and the project's source files from the project root, after an optional resource import. Use it to ship local edits back to a project that was originally pulled from Studio Web.

## Synopsis

```
uip codedapp push [options]
```

## Options

| Flag | Description |
|---|---|
| `--project-id <id>` | WebApp project ID. When omitted, read from the `UIPATH_PROJECT_ID` environment variable, then from `UIPATH_PROJECT_ID` in the `.env` file. Refer to [Project ID](#project-id). |
| `--solution-name <name>` | Name of the Studio Web solution to create when no project ID is set. Goes with `--project-name`. |
| `--project-name <name>` | Name of the coded app project to create in that solution when no project ID is set. Goes with `--solution-name`. |
| `--build-dir <dir>` | Build output directory. Default: `dist`. |
| `--ignore-resources` | Skip importing referenced resources. |
| `--allow-large-files` | Allow pushing files between 2 MB and 10 MB without a confirmation prompt. Required in non-interactive runs when any file is 2 MB or larger. |
| `-v, --version <version>` | Set an explicit code version (for example, `2.0.0`). |
| `--verbose` | Show detailed progress logs. |
| `--base-url <url>` | UiPath base URL (auth override). |
| `--org-id <id>` | Organization ID (auth override). |
| `--tenant-id <id>` | Tenant ID (auth override). |
| `--access-token <token>` | Access token (auth override). |

## Project ID

`push` uploads into an existing Studio Web project. It takes the project ID from the first of these that is set: `--project-id`, the `UIPATH_PROJECT_ID` environment variable, or `UIPATH_PROJECT_ID` in the `.env` file of the current directory.

When none is set, `push` creates a new Studio Web solution with a coded app project in it, and saves the new project ID as `UIPATH_PROJECT_ID` in `.env`, so the next push reuses it:

- With `--solution-name` and `--project-name`, it creates the solution and project with those names, without prompting.
- At an interactive terminal without them, it asks whether to create a new solution or use an existing one, and prompts for any missing name.
- In a non-interactive run, both names are required. Without them, `push` fails and names the options to pass.

Passing `--solution-name` or `--project-name` while a project ID is set from any of the three sources is refused, so a push never goes to an existing project when you asked for a new one.

## Environment variables

When the project has a `.env.example` file, or a `.env.template` file when there is no `.env.example`, `push` adds its `UIPATH_APPS_*` names and values to the environment variables of the app in its Studio Web solution. Whoever deploys the app then sees what can be configured.

- Only names that the solution does not list yet are added. A value already set in Studio Web is not changed.
- A name removed from the file stays in the solution until someone removes it there.
- A blank value (`NAME=`) leaves the variable unset, so the app's own fallback applies.
- The plain `.env` file is never read or pushed.

:::important
Values in `.env.example` reach every deployment as its defaults, and anyone who can open the app can read them. Do not put secrets in the file.
:::

To set the values of a deployed standalone app, use [`uip codedapp deploy --env-vars-file`](./uip-codedapp-deploy.md#environment-variables).

## Excluding files

`push` reads exclusion patterns from `.gitignore` and `.uipignore` in the project root. `.uipignore` uses the same syntax as `.gitignore`, and its patterns take precedence when the two files disagree. The following are always excluded, with or without an ignore file:

- `node_modules/` and `.uipath/`
- `.gitignore`, `.uipignore`, `.gitkeep`
- `.env` files, including `.env.local`, `.env.*.local`, `.env.development`, `.env.production`, `.env.test`, and `.env.example`
- Any other file or folder whose name starts with a dot

## File checks

Before uploading, `push` checks every file it would send:

| Check | Result |
|---|---|
| File extension not in the allowed set of web-related types | Push blocked. The disallowed files are listed. |
| File of 10 MB or larger | Push blocked. |
| File of 2 MB or larger, below 10 MB | Interactive: confirmation prompt. Non-interactive: push blocked unless you pass `--allow-large-files`. |
| `action-schema.json` present and invalid | Push blocked. |
| `action-schema.json` of a coded action app uses one property name in more than one of `inputs`, `outputs`, `inOuts`, and `outcomes` | Push blocked, before anything is uploaded. Refer to [Duplicate action schema property names](#duplicate-action-schema-property-names). |

### Duplicate action schema property names

The Apps service rejects an action schema that uses one property name in more than one of `inputs`, `outputs`, `inOuts`, and `outcomes` on a first publish or install. For a coded action app, `push` therefore compares the local `action-schema.json` with the one the last push uploaded:

| Case | Result |
|---|---|
| The duplicate name is not in the last pushed schema | Push blocked. Rename the property, then push again. |
| An earlier push already uploaded that name in those sections | Push continues with a warning. A deployed app keeps the name on upgrade, and renaming it breaks the app's tasks. A first install of the solution, for example in another tenant, still rejects it. |
| Earlier pushes did not upload `action-schema.json`, for example because an ignore rule leaves it out | Push continues with a warning. |
| The remote project cannot be read | Push blocked, without uploading. Push again later. |

## Examples

```bash
# Push from the default ./dist build directory
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001

# Custom build directory and explicit version
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --build-dir build \
    --version 2.0.0

# Push files between 2 MB and 10 MB without a prompt (CI)
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001     --allow-large-files

# First push: create a new Studio Web solution and coded app project (CI)
uip codedapp push --solution-name "Finance Apps" --project-name "InvoiceViewer"

# Skip resource imports
uip codedapp push --project-id a1b2c3d4-0000-0000-0000-000000000001 \
    --ignore-resources
```

## Data shape (--output json)

```json
{
  "Code": "PushCompleted",
  "Data": { "message": "Push completed successfully." }
}
```

A failed push returns `Result: "Failure"` with `Message: "Push failed"` and the cause in `Instructions`.

## Related

- [uip codedapp pull](./uip-codedapp-pull.md) — fetch a remote project to local disk before editing.
- [uip codedapp pack](./uip-codedapp-pack.md) — package the build for publication once it's pushed.

## See also

- [Coded Apps tool overview](./uip-codedapp.md)
- [Global options](./global-options.md)
- [Exit codes](./exit-codes.md)
