CLI Reference
Shard includes a full-featured CLI for scripting and automation.
Installation
The CLI is a separate binary from the desktop app. Both share the same data directory (~/.shard/), so profiles, accounts, and mods are shared between them.
Build from source
cd launcher
cargo build --release
# Binary: target/release/shard
# Or install to ~/.cargo/bin/
cargo install --path .Homebrew (coming soon)
brew install shard-launcherGlobal Options
shard <COMMAND>
Options:
-h, --help Print help
-V, --version Print versionCommands
Profile Management
# List all profiles
shard list
shard profile list
# Create a new profile
shard profile create "Profile Name" --mc 1.21.4
shard profile create "Modded" --mc 1.21.4 --loader fabric
# Rename a profile
shard profile rename "Old Name" "New Name"
# Delete a profile
shard profile delete "Profile Name"
# Show profile details
shard profile show "Profile Name"
# Clone a profile
shard profile clone "Source" "Destination"
# Compare two profiles
shard profile diff "Profile A" "Profile B"Content Management
# Add mods to a profile
shard mod add "Profile" sodium
shard mod add "Profile" /path/to/mod.jar
# Remove mods
shard mod remove "Profile" sodium
# List mods in a profile
shard mod list "Profile"
# Resource packs and shader packs
shard resourcepack add "Profile" /path/to/pack.zip
shard shaderpack add "Profile" /path/to/shader.zipAccount Management
# Add a Microsoft account (device code flow)
shard account add
# List accounts
shard account list
# Set active account
shard account use <username>
# Remove an account
shard account remove <username>
# Show account info
shard account info
# Skin management
shard account skin upload /path/to/skin.png
shard account skin set-model slim
# Cape management
shard account cape list
shard account cape select <cape-id>Store Operations
# Search for content
shard store search sodium
shard store search sodium --platform modrinth
shard store search jei --platform curseforge
# Get project info
shard store info <platform> <project-id>
# List project versions
shard store versions <platform> <project-id>
# Install content to a profile
shard store install "Profile" <platform> <project-id>Library Management
# List library items
shard library list
shard library list --type mods
# Show item details
shard library show <hash>
# Import content
shard library import /path/to/file.jar
# Remove from library
shard library remove <hash>
# Update metadata
shard library update <hash>
# Show statistics
shard library stats
# Sync with content store
shard library sync
# Tag management
shard library tag add <hash> <tag>
shard library tag remove <hash> <tag>Launch
# Launch a profile
shard launch "Profile Name"
# Launch with specific account
shard launch "Profile Name" --account <username>
# Prepare without launching
shard launch "Profile Name" --prepare-onlyConfiguration
# Show current config
shard config show
# Set Microsoft OAuth credentials
shard config set-client-id <client-id>
shard config set-client-secret <client-secret>
# Set CurseForge API key
shard config set-curseforge-key <api-key>App Updates
# Check the desktop app update manifest
shard app-update check
# Compare against a specific version (useful for testing updates)
shard app-update check --current 0.1.5
# Override the manifest endpoint or platform
shard app-update check --endpoint https://github.com/th0rgal/shard/releases/latest/download/latest.json
shard app-update check --platform darwin-aarch64Logs
# View logs
shard logsTemplates
# Template management
shard template list
shard template create <name>
shard template apply <profile> <template>Modpacks
# Modpack management
shard modpack import /path/to/modpack.mrpack
shard modpack export "Profile" /path/to/output.mrpackEnvironment Variables
| Variable | Description |
|---|---|
SHARD_MS_CLIENT_ID | Microsoft OAuth client ID |
SHARD_MS_CLIENT_SECRET | Microsoft OAuth client secret (if required) |
SHARD_CURSEFORGE_API_KEY | CurseForge API key |
RUST_LOG | Logging level (error, warn, info, debug, trace) |
Examples
Create a modded profile
# Create profile
shard profile create "Modded 1.21" --mc 1.21.4 --loader fabric
# Add performance mods
shard mod add "Modded 1.21" sodium
# Launch
shard launch "Modded 1.21"Batch operations
# Add mods to multiple profiles
for profile in "Profile A" "Profile B" "Profile C"; do
shard mod add "$profile" sodium
doneScripted backup
#!/bin/bash
# Backup all profiles
mkdir -p ~/shard-backup
cp -r ~/.shard/profiles ~/shard-backup/
cp ~/.shard/accounts.json ~/shard-backup/
echo "Backup complete!"Last updated on