# uip codedapp pack

> Syntax and options for `uip codedapp pack`, which packages a built coded app into a `.nupkg` archive for publication.

`uip codedapp pack` packages a built coded app into a `.nupkg` archive ready for publication. It reads the `<dist>` directory, applies the supplied package metadata, and writes the archive to `--output-dir` (defaults to `./.uipath`). Use `--dry-run` to check the package configuration and preview the output path without writing anything to disk. This is a local, unauthenticated packaging step — it accepts no login/auth-override flags; those only apply to `push`/`pull`/`publish`/`deploy`.

## Synopsis

```
uip codedapp pack <dist> [options]
```

- `<dist>` — path to the dist folder containing the built application. The folder must contain `index.html` at its root; only static builds are supported.

## Package ID

The package ID is derived from `--name`: the name is lowercased, spaces and underscores become hyphens, other characters outside `a-z`, `0-9`, and `-` are removed, repeated hyphens collapse to one, and leading or trailing hyphens are trimmed. For example, `--name "My App"` produces the package ID `my-app`. When the name changes, the CLI prints a warning that names the sanitized value. The display title keeps the name as typed unless you pass `--display-name`.

When `--name` is omitted in an interactive terminal, the command prompts for it. In a non-interactive run, a missing name fails the command.

## Options

| Flag | Description |
|---|---|
| `-n, --name <name>` | Package name. The package ID is derived from it (refer to [Package ID](#package-id)). |
| `--display-name <name>` | Human-readable app title shown in UiPath. Defaults to `--name` as typed. |
| `-v, --version <version>` | Package version. Default: `1.0.0`. |
| `--output-dir <dir>` | Output directory. Default: `./.uipath`. |
| `--author <author>` | Package author. Default: `UiPath Developer`. |
| `--description <desc>` | Package description. |
| `--main-file <file>` | Main entry file. Default: `index.html`. |
| `--content-type <type>` | Content type: `webapp`, `library`, or `process`. Default: `webapp`. |
| `--repository-url <url>` | Source repository URL, recorded in the package for traceability. |
| `--repository-commit <sha>` | Source repository commit hash, recorded for traceability. |
| `--repository-branch <branch>` | Source repository branch. |
| `--repository-type <type>` | Source repository type. Defaults to `git` when `--repository-url` is set. |
| `--release-notes <text>` | Release notes for the package. |
| `--project-url <url>` | Automation Hub idea URL. |
| `--dry-run` | Show what would be packaged without creating the package or writing any file. |

## Examples

```bash
# Default — writes ./.uipath/myapp.1.0.0.nupkg
uip codedapp pack ./dist --name "MyApp" --version "1.0.0"

# Custom output directory and author
uip codedapp pack ./dist \
    --name "MyApp" --version "2.0.0" \
    --output-dir ./packages \
    --author "Contoso Ltd."

# Separate display title — package id stays my-app
uip codedapp pack ./dist --name "my-app" --display-name "My App" --version "1.0.0"

# Check the package configuration without writing anything to disk
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --dry-run

# Write the .nupkg into a directory other than ./.uipath
uip codedapp pack ./dist --name "MyApp" --version "1.0.0" --output-dir ./out
```

## Data shape (--output json)

```json
{
  "Code": "PackCompleted",
  "Data": {
    "Message": "Package created successfully.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}
```

A dry run (`--dry-run`) returns a different code and message, and `Output` shows the path the package would take:

```json
{
  "Code": "PackDryRunCompleted",
  "Data": {
    "DryRun": true,
    "Message": "Dry run - no package created.",
    "Package": "myapp@1.0.0",
    "Output": ".uipath/myapp.1.0.0.nupkg"
  }
}
```

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

## Related

- [uip codedapp push](./uip-codedapp-push.md) — ship the source to Studio Web before packaging it.
- [uip codedapp publish](./uip-codedapp-publish.md) — upload the resulting `.nupkg` to UiPath.

## See also

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