# transform-container

## Description

* This command can be used to transform a local Container using a given Container transformer.

## Currently Available Official Transformers

* [pbxproj](https://github.com/electrode-io/ern-container-transformer-pbxproj)\
  Can be used to patch one or more pbxproj (iOS project file) included in the Container, in specific ways.
* [build-config](https://github.com/electrode-io/ern-container-transformer-build-config)\
  Can be used to update Build Configuration(s) -build settings- of a generated iOS Container.
* [script](https://github.com/electrode-io/ern-container-transformer-script)\
  This transformer allows for executing an arbitrary script to transform the Container in some custom way. It supports transformation of both iOS and Android Containers.
* [git-patch](https://github.com/electrode-io/ern-container-transformer-git-patch)\
  Can be used to apply one or more sequential git patches to the Container.

### Syntax

`ern transformer-container`

**Options**

`--containerPath`

* The local file system path to the directory containing the Container to transform.
* **Default** If this option is not provided, the command will look for a Container in the default platform directory `~/.ern/containergen/out/[platform]`.=

`--platform/-p`

* Specify the native platform of the target Container to transform.
* This option is required, there is no default (unless `--descriptor` is used)

`--transformer/-t`

* Specify the Container transformer to use (for ex `build-config`).
* Can also include a specific version or a version range (for ex `build-config@1.0.0` or `build-config@^1.0.0`)
* If no version is specified, the latest available version of the publisher will be used at the time of publication (this is a bit risky given that new major publisher versions will contain breaking changes. We **recommend** that you use a specific version or version range allowing minor and patch updates only)
* It is also possible to pass a local file system path to a Container transformer package (only used for transformers development).
* This option is required, there is no default (unless `--descriptor` is used)

`--extra/-e`

* Extra configuration specific to the transformer (as json)
* Some transformers might not need any extra configuration. Check the specific Container transformer documentation for reference.
* There is three different ways to provide the json extra configuration :
  * **As a json string** &#x20;

    For example `--extra '{"configKey": "configValue"}'`
  * **As a file path** &#x20;

    For example `--extra <path>/transformer-config.json` &#x20;

    In that case, the configuration will be read from the file
  * **As a Cauldron file path** &#x20;

    For example `--extra cauldron://config/publishers/transformer-config.json` &#x20;

    In that case, the configuration will be read from the file stored in Cauldron. &#x20;

    For this way to work, the file must exist in Cauldron (you can add a file to the cauldron by using the [ern cauldron add file](https://github.com/electrode-io/electrode-native/tree/ae752c5189387f07bf0266cc9e5aaa69b63f9fed/docs/cli/add/file.md) command).

### Related commands

[ern create-container](/cli-commands/create-container.md) | Create a new Container (native or JavaScript only) locally to the workstation.\
[ern publish-container](/cli-commands/publish-container.md) | Publish a Container.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://native.electrode.io/cli-commands/transform-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
