Overview
The Harness CLI provides comprehensive artifact management capabilities:- Push artifacts from your local machine
- Pull artifacts to your development environment
- List and search artifacts across registries
- Manage metadata for organization and tracking
- Copy artifacts between registries
- Delete artifacts when no longer needed
Supported Package Types
Generic
Maven
NPM
Go
Python
NuGet
Conda
Composer
Cargo
Dart
RPM
Quick Start
Pushing Artifacts
Generic Artifacts
Upload any file type to the registry:Target registry identifier
Path to file to upload (supports glob patterns like
*.zip)Package name
Version for the artifact
Custom filename (defaults to actual filename)
File path within the package (defaults to filename)
Base URL for the Packages service
Maven Artifacts
Upload Maven JAR or WAR files with POM:Maven push requires both the artifact file (.jar/.war) and POM file (.xml/.pom). The CLI validates that both files reference the same Maven coordinates.
- Validates file extensions (.jar, .war, .pom, .xml)
- Extracts Maven coordinates from POM file
- Extracts Maven coordinates from JAR/WAR artifact
- Compares groupId, artifactId, and version
- Generates MD5 and SHA1 checksums
- Uploads artifact, POM, and checksums
- Updates
maven-metadata.xml
Maven Upload Process
Maven Upload Process
The Maven push workflow:
- Validate inputs: Check file extensions and existence
- Parse POM file: Extract
groupId,artifactId,version - Parse artifact: Read metadata from JAR/WAR
- Compare coordinates: Ensure POM and artifact match
- Check SNAPSHOT: Reject SNAPSHOT versions (not yet supported)
- Generate checksums: Create MD5 and SHA1 for artifact and POM
- Upload artifact: Push JAR/WAR file
- Upload POM: Push POM file
- Upload checksums: Push all checksum files
- Update metadata: Download, update, and re-upload
maven-metadata.xml
NPM Packages
Upload NPM packages from.tgz tarballs:
- Extracts
package.jsonfrom the tarball - Builds the NPM upload payload
- Validates name and version
- Uploads using NPM API format
NPM Upload Process
NPM Upload Process
The NPM push workflow:
- Validate input: Check .tgz file exists
- Extract package.json: Read from tarball
- Parse metadata: Get name, version, dependencies
- Build payload: Create NPM-compatible upload JSON
- Stream upload: Upload with progress tracking
- Verify: Check successful upload
Python Packages
Go Modules
Other Package Types
Pulling Artifacts
Download artifacts from the registry:Listing Artifacts
List all artifacts across registries or filter by registry:Filter by registry identifier
Number of items per page
Page number (zero-indexed)
Managing Metadata
Attach key-value metadata to packages and versions for organization, searching, and tracking.Set Metadata
Add or update metadata:- Without
--version: Sets package-level metadata - With
--version: Sets version-specific metadata
Get Metadata
Retrieve metadata from packages or versions:Delete Metadata
Remove specific metadata keys:Working with Artifacts
Get Artifact Details
Retrieve detailed information about an artifact:Copy Artifacts
Copy artifacts between registries:Delete Artifacts
Remove artifacts from registry:Common Workflows
CI/CD Pipeline Integration
Build and Push in CI
Build and Push in CI
Integrate artifact push into your CI pipeline:
.github/workflows/build.yml
Tag Production Releases
Tag Production Releases
Mark production-ready versions with metadata:
Promote Artifacts Between Environments
Promote Artifacts Between Environments
Copy artifacts from dev to staging to production:
Maven Project Workflow
NPM Package Workflow
Troubleshooting
Upload Failures
Upload Failures
Symptom: Upload fails with network errorsSolutions:
- Check
--pkg-urlis correct - Verify network connectivity:
curl -I $PKG_URL - Ensure authentication is configured
- Check firewall allows outbound HTTPS
- Try uploading smaller file to test
Maven Coordinate Mismatch
Maven Coordinate Mismatch
Error:
groupId mismatch: package="com.example", pom="com.other"Solutions:- Ensure POM file matches the artifact
- Rebuild with correct coordinates
- Verify no manual changes to JAR/WAR
- Check parent POM inheritance
File Not Found
File Not Found
Error:
failed to access package fileSolutions:- Verify file path is correct
- Check file permissions
- Use absolute paths if relative paths fail
- For globs, ensure pattern matches files
Authentication Issues
Authentication Issues
Error:
401 UnauthorizedSolutions:- Verify API key is valid
- Check account/org/project IDs
- Ensure service account has permissions
- Regenerate authentication tokens
Metadata Operations Fail
Metadata Operations Fail
Error:
not found: package or version not foundSolutions:- Verify package and version exist:
hc artifact list - Check registry identifier is correct
- Ensure version string matches exactly
- Wait for upload to complete before setting metadata
Best Practices
Version Consistently
- Use semantic versioning (e.g., 1.2.3)
- Include build metadata for CI builds
- Never reuse version numbers
- Document versioning scheme in README
Use Metadata Liberally
- Tag artifacts with environment (dev/staging/prod)
- Record build/test information
- Link to release notes or tickets
- Track ownership and approvals
Organize Registries
- Separate registries by environment
- Use consistent naming conventions
- Create registries per team or project
- Document registry purposes
Automate in CI/CD
- Push artifacts in every build
- Tag with git commit SHA
- Set metadata with build info
- Fail builds on upload errors
Next Steps
Registry Migration
Migrate artifacts from JFrog or Nexus
Artifact Commands
Complete artifact command reference