A comprehensive CLI framework for creating command-line interfaces in Node.js and TypeScript
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Upload packaged CLIs to AWS S3 and manage distribution channels for automatic updates and releases.
Upload compressed tarballs to S3 for distribution and automatic updates.
oclif upload tarballsFlags:
--root, -r (string) - Root directory of the CLI project (default: ".")--targets, -t (string) - Comma-separated targets to upload--xz (boolean) - Also upload xz compressed tarballs--sha (string) - Git SHA to include in upload metadata--dry-run (boolean) - Run without uploading to S3Usage Examples:
# Upload all tarballs to S3
oclif upload tarballs
# Upload specific targets
oclif upload tarballs --targets=linux-x64,darwin-x64
# Upload with xz compression
oclif upload tarballs --xz
# Uploads tarballs from ./dist/tarballs/ to configured S3 bucketRequirements:
oclif pack tarballsUpload .deb packages to S3 for Debian/Ubuntu distribution.
oclif upload debFlags:
--root, -r (string) - Root directory of the CLI project (default: ".")--sha (string) - Git SHA to include in upload metadata--dry-run (boolean) - Run without uploading to S3Usage Examples:
# Upload Debian packages
oclif upload deb
# Upload with dry run
oclif upload deb --dry-run
# Uploads .deb files from ./dist/deb/ to S3Upload macOS installer packages to S3 for distribution.
oclif upload macosFlags:
--root, -r (string) - Root directory of the CLI project (default: ".")--targets, -t (string) - Comma-separated targets to upload--sha (string) - Git SHA to include in upload metadata--dry-run (boolean) - Run without uploading to S3Usage Examples:
# Upload macOS installers
oclif upload macos
# Upload specific targets
oclif upload macos --targets=darwin-x64,darwin-arm64
# Uploads .pkg files from ./dist/macos/ to S3Upload Windows installer packages to S3 for distribution.
oclif upload winFlags:
--root, -r (string) - Root directory of the CLI project (default: ".")--targets (string) - Comma-separated targets to upload--sha (string) - Git SHA to include in upload metadata--dry-run (boolean) - Run without uploading to S3Usage Examples:
# Upload Windows installers
oclif upload win
# Upload specific targets
oclif upload win --targets=win32-x64,win32-x86
# Uploads .exe and .msi files from ./dist/win32/ to S3Promote CLI builds to release channels for controlled distribution and staged rollouts.
oclif promoteFlags:
--channel (string) - Release channel (stable, beta, alpha) (default: "stable")--version (string) - Semantic version to promote (required)--sha (string) - 7-digit short git commit SHA to promote (required)--root, -r (string) - Root directory of the CLI project (default: ".")--targets, -t (string) - Comma-separated list of targets to promote--deb, -d (boolean) - Promote Debian packages--macos, -m (boolean) - Promote macOS packages--win, -w (boolean) - Promote Windows packages--xz (boolean) - Also promote xz compressed tarballs--indexes (boolean) - Append promoted URLs to index files--max-age, -a (string) - Cache control max-age in seconds (default: "86400")--dry-run (boolean) - Preview promotion without making changes--ignore-missing (boolean) - Continue promoting even if some artifacts are missingUsage Examples:
# Promote current version to stable channel
oclif promote --channel=stable
# Promote specific version and SHA
oclif promote --version=1.2.3 --sha=abc123 --channel=beta
# Promote with dry run to preview changes
oclif promote --channel=stable --dry-run
# Promote specific platforms only
oclif promote --targets=linux-x64,darwin-x64 --macos --channel=stableoclif provides comprehensive S3 integration for hosting and distributing CLI packages.
interface AWSS3Operations {
/** Upload file to S3 with progress tracking */
uploadFile(
localPath: string,
options: S3UploadOptions,
config?: S3Config
): Promise<void>;
/** Copy object within S3 */
copyObject(
options: S3CopyOptions,
config?: S3Config
): Promise<void>;
/** Get object metadata */
headObject(options: S3HeadOptions): Promise<S3HeadResult>;
/** Get object content */
getObject(options: S3GetOptions): Promise<S3GetResult>;
/** List objects in bucket */
listObjects(options: S3ListOptions): Promise<S3ListResult>;
/** Delete multiple objects */
deleteObjects(options: S3DeleteOptions): Promise<void>;
}
interface S3UploadOptions {
bucket: string;
key: string;
acl?: string;
contentType?: string;
metadata?: Record<string, string>;
}
interface S3CopyOptions {
sourceBucket: string;
sourceKey: string;
destinationBucket: string;
destinationKey: string;
acl?: string;
}interface CloudFrontOperations {
/** Create CloudFront cache invalidation */
createCloudfrontInvalidation(options: CloudFrontInvalidationOptions): Promise<void>;
}
interface CloudFrontInvalidationOptions {
distributionId: string;
paths: string[];
callerReference?: string;
}oclif supports automatic updates through S3-hosted version manifests and update channels.
interface UpdateConfiguration {
/** Automatic update settings */
autoupdate?: {
/** Rollout percentage (0-100) */
rollout: number;
/** Debounce time in minutes */
debounce: number;
};
/** Node.js runtime version */
node?: {
version: string;
};
/** S3 hosting configuration */
s3?: {
bucket: string;
/** S3 key prefix/folder */
folder?: string;
/** Custom host URL for downloads */
host?: string;
/** S3 ACL permissions */
acl?: string;
/** Maximum versions to keep in index */
indexVersionLimit?: number;
/** Use xz compression */
xz?: boolean;
};
}oclif supports multiple release channels for staged rollouts:
Version indexes track available versions and update metadata:
interface VersionIndex {
/** Channel name */
channel: string;
/** Available versions */
versions: VersionMetadata[];
/** Current/latest version */
current: string;
}
interface VersionMetadata {
version: string;
sha: string;
date: string;
/** Platform-specific download URLs */
downloads: Record<Target, DownloadInfo>;
}
interface DownloadInfo {
url: string;
sha256: string;
size: number;
}Helper functions for upload and deployment operations.
/**
* Check if endpoint is S3-compatible
* @param endpoint - S3 endpoint URL
* @returns True if endpoint supports S3 API
*/
function isS3Compatible(endpoint: string): boolean;
/**
* Get S3 checksum configuration
* @param endpoint - S3 endpoint
* @param envValue - Environment variable value
* @returns S3 checksum settings
*/
function getS3ChecksumConfig(
endpoint: string,
envValue?: string
): S3ChecksumConfig;
interface S3ChecksumConfig {
algorithm: 'SHA256' | 'SHA1' | 'CRC32' | 'CRC32C';
enabled: boolean;
}Typical deployment workflow for oclif CLIs:
oclif pack tarballs --targets=linux-x64,darwin-x64,win32-x64oclif upload tarballsoclif promote --channel=betaoclif promote --channel=stableRequired environment variables for S3 operations:
# AWS credentials
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_REGION=us-east-1
# Optional: Custom S3 endpoint
AWS_S3_ENDPOINT=https://s3.custom-domain.com
# Optional: CloudFront distribution
CLOUDFRONT_DISTRIBUTION_ID=ABCDEFGHIJKLMN{
"oclif": {
"update": {
"s3": {
"bucket": "my-cli-releases",
"folder": "releases/mycli",
"host": "https://releases.mycli.com",
"acl": "public-read",
"indexVersionLimit": 20,
"xz": true
},
"autoupdate": {
"rollout": 100,
"debounce": 60
}
}
}
}Install with Tessl CLI
npx tessl i tessl/npm-oclif