Export
Export packages to local folders without creating a workspace
Introduction
The ipm export
command enables you to export packages from IPMHub directly to local folders without configuring them as workspaces. This is particularly useful for scenarios where you need to extract package contents for reference, inspection, or integration into non-IPM environments.
Key Benefits
- Direct Export: Extract package files to any folder without workspace configuration
- Version Control: Export specific versions of packages
- Simplified Access: Get package content without creating workspace dependencies
- Reference Material: Create local copies of packages for documentation or learning
Use Cases
The export command is designed for scenarios such as:
- Creating reference copies of packages for documentation
- Sharing package contents with team members who don’t use IPM
- Inspecting package structure and files
- Integrating package contents into other build systems
- Creating templates based on existing packages
Using the Export Command
Basic Export
To export the latest version of a package to a local folder:
ipm export --package publisher/package-name --destination ./export-folder
Export Specific Version
To export a specific version of a package:
ipm export --package publisher/package-name --version 1.2.3 --destination ./export-folder
Non-Interactive Export
For automated scenarios, you can use non-interactive authentication:
ipm export --package publisher/package-name --destination ./export-folder --non-interactive --client-secrets YOUR_SECRET
Important Notes
- The destination folder (
--destination
) must be empty or non-existent - The command will create the destination folder if it doesn’t exist
- Exported packages contain all files from the original package
- The export command requires authentication, similar to
ipm add
Differences Between Export and Add
While both export
and add
retrieve package content from IPMHub, they serve different purposes:
Feature | ipm export |
ipm add |
---|---|---|
Creates workspace files | No | Yes |
Adds entries to ipmhub.json |
No | Yes |
Supports any destination folder | Yes | No (uses workspace structure) |
Compatible with ipm sync |
No | Yes |
Package tracking | No | Yes |
Example Workflow
Here’s a common workflow for using the export command:
- Identify the package you want to export
- Create or identify a destination folder
- Run the export command
- Access the exported package content
# Create a folder for your export
mkdir -p ./reference-materials/my-package
# Export the package
ipm export --package publisher/my-package --destination ./reference-materials/my-package
# Explore the contents
ls -la ./reference-materials/my-package
This creates a clean copy of the package for reference or other purposes without integrating it into your IPM workflow.