A command-line interface for working with Membrane in local development environment.
A command-line interface for working with Membrane in local development environment.
``bash`
npm install -g @membranehq/clior
yarn global add @membranehq/clior
bun install -g @membranehq/clior
pnpm install -g @membranehq/cli
`bashInitialize with your workspace credentials (interactive)
membrane init
See the Configuration section below for alternative ways to configure credentials.
Commands
`bash
Initialize workspace configuration
membrane init --key --secret Pull workspace elements from remote
membrane pull [--force]Push workspace elements to remote
membrane push [--force]Get help
membrane --help
membrane --helpCheck version
membrane --version
`Configuration
The CLI can be configured using either environment variables or a configuration file (
membrane.config.yml). Environment variables take precedence over the configuration file.$3
`bash
export MEMBRANE_WORKSPACE_KEY=
export MEMBRANE_WORKSPACE_SECRET=
export MEMBRANE_API_URI=https://api.your-membrane-instance.com # Optional: for self-hosted instances (default: https://api.integration.app)
export MEMBRANE_CONSOLE_URI=https://console.your-membrane-instance.com # Optional: for self-hosted instances (default: https://console.integration.app)
export MEMBRANE_TEST_CUSTOMER_ID= # Optional: for testing integrations
`$3
The CLI uses a configuration file at
membrane.config.yml:`yaml
workspaceKey:
workspaceSecret: Optional
apiUri: https://api.your-membrane-instance.com # For self-hosted instances (default: https://api.integration.app)
consoleUri: https://console.your-membrane-instance.com # For self-hosted instances (default: https://console.integration.app)testCustomerId: test-customer # Internal ID of customer for testing integrations
`Note: When both environment variables and configuration file are present, environment variables take precedence.
Self-Hosting: For details on self-hosting Membrane, see Self-Hosting Documentation.
Version Control
membrane.config.yml contains secrets. You should exclude it from version control.membrane folder can and should be stored in version control to keep your integration configurations versioned.Transferring elements between workspaces with
pull and pushThe CLI provides a
pull and push command to transfer workspace elements between environments. You'd typically use this to move integrations, actions, flows, and other configurations from development to production.How it works:
Workspace elements (integrations, actions, data sources, flows, field mappings, etc.) are stored as YAML files in the
./membrane directory. Each element has a unique UUID that identifies it across workspaces.When you pull, the CLI:
- Exports all elements from the remote workspace as YAML
- Compares them with your local
./membrane directory by UUID
- Identifies what's new, changed, or deleted in the remote workspace
- Downloads connector source code for custom connectors
- Updates your local files to match the remote stateWhen you push, the CLI:
- Packages your local
./membrane directory as an export
- Compares it with the current state of the remote workspace
- Identifies what's new, changed, or deleted locally
- Uploads connector source code for custom connectors
- Applies the changes to the remote workspaceChanges are applied in dependency order (integrations before integration-level elements, parents before children) to maintain referential integrity. Conflicts occur when an element exists in only one location; use
--force to resolve by preferring the source.Example:
`bash
Pull from development workspace
export MEMBRANE_WORKSPACE_KEY="dev-workspace-key"
export MEMBRANE_WORKSPACE_SECRET="dev-workspace-secret"
membrane pullPush to production workspace
export MEMBRANE_WORKSPACE_KEY="prod-workspace-key"
export MEMBRANE_WORKSPACE_SECRET="prod-workspace-secret"
membrane push
``MIT