docs/build-pieces/misc/publish-piece.mdx
You can use the CLI to publish custom pieces to the platform. This process packages the pieces and uploads them to the specified API endpoint.
The CLI scans the packages/pieces/ directory for the specified piece. It checks the name and version in the package.json file. If the piece is not already published, it builds, packages, and uploads it to the platform using the API.
To publish a piece, follow these steps:
npm run publish-piece-to-api
Piece Folder Name: This is the name associated with the folder where the action resides. It helps organize and categorize actions within the piece.
API URL: This is the URL of the API endpoint where the piece will be published (ex: https://cloud.activepieces.com/api).
API Key Source: This is the source of the API key. It can be either Env Variable (AP_API_KEY) or Manually.
In case you choose Env Variable (AP_API_KEY), the CLI will use the API key from the .env file in the packages/server/api directory.
In case you choose Manually, you will be asked to enter the API key.
Examples:
npm run publish-piece-to-api
? Enter the piece folder name : google-drive
? Enter the API URL : https://cloud.activepieces.com/api
? Enter the API Key Source : Env Variable (AP_API_KEY)
npm run publish-piece-to-api
? Enter the piece folder name : google-drive
? Enter the API URL : https://cloud.activepieces.com/api
? Enter the API Key Source : Manually
? Enter the API Key : ap_1234567890abcdef1234567890abcdef