# Integration.app CLI

A command-line interface for syncing workspaces with local environment

## Installation
```bash
npm install -g @integration-app/membrane-cli
# or
yarn global add @integration-app/membrane-cli
# or
bun install -g @integration-app/membrane-cli
# or
pnpm install -g @integration-app/membrane-cli

```

## Quick Start
```bash
# Initialize your membrane config
membrane init

# Pull data from a workspace
membrane pull

# Push data to a workspace
membrane push
```

## Commands Reference
```bash
# View membrane help
membrane --help
# View membrane <command> help
membrane <command> --help

# Check CLI version
membrane --version
```

## Configuration
The CLI uses a configuration file at `membrane.config.yml`:

```yaml
workspaces:
  default:
    key: your_key
    secret: your_secret
    apiUri: https://api.integration.app  # Optional
  prod:
    key: prod_key
    secret: prod_secret
  dev:
    key: dev_key
    secret: dev_secret
```

## Connectors 

Public connectors are pulled and pushed as .yml files that contain references to the public connector registry. Custom connectors have additionally a .zip file with the connector code. 

If you need to migrate public connectors to a self-hosted version of Membrane, use `--all-connectors` flag for the `pull` command: `membrane pull --all-connectors`. 
This will pull .zip files of all connectors, including public ones.

### Connector Source Code 

If you want to edit connector source code, unarchive `src.zip` file and edit the code in the `src` directory.

When working with `src` directories inside connector directories, this CLI does the following:
* `pull`: if `src` directory exists for a given connector, its code will be pulled as `src.zip` and extracted into the `src` directory after the standard pull.
* `push`: if `src` directory exists for a given connector, its code will be zipped into `src.zip` before performing the standard push.

## Version Control

`membrane.config.yml` contains secrets. You should exclude it from version control.


## License

MIT
