SF-CIUtils is a powerful toolkit for Salesforce developers who want to supercharge their CI/CD workflows! This plugin for the Salesforce CLI provides essential utilities that make continuous integration and deployment with Salesforce a breeze.
Think of it as your Swiss Army knife for Salesforce CI/CD operations - whether you're validating repository metadata, monitoring deployments, managing file uploads, or handling user permissions, SF-CIUtils has got you covered!
- Validate Repository Metadata: Compare your local metadata with what's in your org to catch metadata drift
- Report on Deployments: Get detailed, real-time information about your deployments
- Create Files: Upload files to Salesforce with ease
- Remove Assignments: Efficiently manage permission sets, permission set groups, and group assignments
sf plugins install @marsson/ciutils
Or install a specific version:
sf plugins install @marsson/ciutils@x.y.z
This command helps you validate your local metadata against what's in your Salesforce org. It's like having a detective that spots differences between your local files and what's actually deployed!
sf validate repository metadata --folder path/to/metadata --target-org your-org
Example: Check if your local Apex classes match what's in your production org:
sf validate repository metadata --folder force-app/main/default/classes --target-org production
Keep an eye on your deployments with this command. It's like having a deployment dashboard right in your terminal!
sf reporton deployment --deploymentid 0AfXXXXXXXXXXXXXXX --target-org your-org
Example: Monitor a deployment and wait for it to complete:
sf reporton deployment --deploymentid 0AfXXXXXXXXXXXXXXX --target-org production --awaitcompletion
Upload files to your Salesforce org with this handy command. Perfect for adding documents, images, or any other files to your org!
sf create file --file path/to/file --target-org your-org
Example: Upload an image and attach it to a record:
sf create file --file assets/logo.png --title "Company Logo" --parent-id 001XXXXXXXXXXXXXXX --target-org production
Efficiently manage user permissions by removing assignments from users. Great for cleaning up access during user offboarding!
sf remove assignments --object PermissionSet --usernames user@example.com --target-org your-org
Example: Remove multiple permission sets from multiple users:
sf remove assignments --object PermissionSet --usernames user1@example.com user2@example.com --target-org production
To contribute to SF-CIUtils, follow these steps:
-
Clone the repository:
git clone https://github.com/marsson/sf-ciutils.git
-
Install dependencies:
yarn install
-
Build the plugin:
yarn build
-
Link to your local Salesforce CLI:
sf plugins link .
-
Run tests:
yarn test
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
- Thanks to the Salesforce CLI team for their amazing work
- Shoutout to all the contributors who have helped make this project better
- Special thanks to the Salesforce developer community for their continuous support
Happy coding! May your deployments be swift and your validations pass on the first try! 🎉