Using the CLI
The easiest way to create a new piece is using the built-in CLI command:Piece Name
Enter the name of your piece (e.g.,
my-service)- Use lowercase with hyphens
- Must be unique across all pieces
- Create the piece directory structure
- Generate boilerplate code
- Add the piece to the workspace configuration
Piece Structure
After running the CLI, your piece will have this structure:Anatomy of a Piece
Let’s look at a real example from the GitHub piece:packages/pieces/community/github/src/index.ts
Key Components
- Metadata
- Authentication
- Actions & Triggers
Example: Building a Simple Piece
Let’s create a simple weather service piece:Piece Configuration Options
The name shown in the Activepieces UI
A brief description of the piece’s functionality
URL to the piece logo (PNG or SVG). Should be hosted on CDN:
https://cdn.activepieces.com/pieces/your-piece.pngAuthentication configuration. See Authentication
Categories for organizing pieces:
COMMUNICATIONPRODUCTIVITYMARKETINGSALES_AND_CRMDEVELOPER_TOOLSANALYTICSCONTENT_AND_FILESCOMMERCE- And more…
Minimum Activepieces version required (e.g.,
"0.30.0")Maximum supported version (optional, for deprecation)
GitHub usernames of piece contributors
Array of action definitions. See Create Action
Array of trigger definitions. See Create Trigger
Real-World Examples
Look at these community pieces for inspiration:Slack Piece
- OAuth2 authentication
- 20+ actions
- Multiple webhook triggers
- Block Kit support
GitHub Piece
- OAuth2 auth
- REST API integration
- GraphQL support
- Repository operations
Google Sheets
- OAuth2 with Google
- CRUD operations
- Bulk updates
- Dynamic dropdown
Airtable
- API Key auth
- Record management
- Field mapping
- Attachment handling
Testing Your Piece
Once created, test your piece locally:Best Practices
Naming Conventions
Naming Conventions
- Piece name: lowercase-with-hyphens (e.g.,
my-service) - Display name: Title Case (e.g.,
My Service) - Export name: camelCase (e.g.,
export const myService = createPiece(...)) - Action/Trigger names: camelCase with suffix (e.g.,
sendMessageAction)
Logo Guidelines
Logo Guidelines
- Use official brand logos when possible
- PNG or SVG format
- Square aspect ratio (1:1)
- Upload to Activepieces CDN
- Fallback: Use a placeholder icon
Categories
Categories
- Choose the most relevant category
- Use only one primary category
- Consider how users will search for your piece
Versioning
Versioning
- Start with version
0.0.1 - Follow semantic versioning (SemVer)
- Set
minimumSupportedReleaseappropriately - Document breaking changes
Next Steps
Add Authentication
Configure OAuth2, API keys, or custom auth
Create Actions
Add actions that perform operations
Create Triggers
Add triggers that start flows
Properties Guide
Learn about all property types