- 使用安装脚本
mkdir -p ~/.local/bin \
&& curl -L "https://github.com/hjy666-mc/Swift-Craft-Launcher-CLI/releases/latest/download/scl" -o ~/.local/bin/scl \
&& chmod +x ~/.local/bin/scl
scl <命令组> <子命令> [参数] [选项]
全局选项:
--json以 JSON 形式输出(适合脚本/AI调用)。
命令组:
set设置配置项get读取配置项game游戏实例管理account账号管理resources资源搜索/安装/管理completion生成并安装 shell 补全man查看/安装 man 手册open打开主程序uninstall卸载组件shell进入交互式sclshell
设置 CLI 配置项(包含主程序 AppStorage)。
scl set <key> <value>
常用:
scl set gameDir "/path/to/Swift Craft Launcher"
scl set javaPath "/path/to/java"
scl set memory 6G
重置:
scl set --reset
scl set --reset <key>
读取配置项:
scl get <key>
scl get --all
示例:
scl get memory
scl get --all
实例管理与启动。
scl game list [--version <keyword>] [--sort <name|length>] [--order <asc|desc>]
scl game status [instance]
兼容别名:stutue。
scl game search <keyword> [--sort <name|length>] [--order <asc|desc>]
scl game config <instance>
scl game create [--modloader <vanilla|fabric|forge|neoforge|quilt>] \
[--gameversion <version>] [--name <instance>]
未指定时走交互式选择。
scl game launch [instance] [--memory <value>] [--java <path>] [--account <name>]
scl game stop <instance>
scl game stop --all
scl game delete <name>
账号管理(离线/微软)。
微软登录需要指定client id
export SCL_CLIENT_ID="<your_client_id>"
scl account list
离线:
scl account create <username> -offline
微软设备码登录:
scl account create -microsoft
scl account delete <name>
scl account set-default <name>
切换当前账号(同时更新 defaultAccount)。
scl account use <name>
scl account show <name>
资源搜索、安装、列表与删除。
scl resources search <keyword> [options]
常用选项:
--mods | --datapacks | --resourcepacks | --shaders | --modpacks--type <mod|datapack|resourcepack|shader|modpack>--limit <1..100>--page <1..N>--sort <downloads|follows|title|author>--order <asc|desc>--game <instance>
scl resources install <id> [options]
常用选项:
--type <mod|datapack|resourcepack|shader|modpack>--version <version>--game <instance>--name <instance>
scl resources list --game <instance> [--type <type>] [--sort <name|length>] [--order <asc|desc>]
scl resources remove <id|filename> --game <instance> [--type <type>]
生成并安装 shell 补全脚本。
scl completion zsh
scl completion bash
scl completion fish
仅输出到 stdout:
scl completion --print zsh
scl man
scl man --install
scl man --install --user
打开主程序(Swift Craft Launcher.app)。
scl open
卸载 CLI 或主程序。
scl uninstall cli
scl uninstall app
scl uninstall scl
进入交互式 shell:
scl shell
交互模式内可执行子命令,输入 help 查看列表,exit/quit 退出。