From 301ea6b9db3e3d614331b3c92d2a7aef988d2bd4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:25:17 +0000 Subject: [PATCH 1/6] Initial plan From d08cf803b8f603cd57388024d3bf6e7a164da37c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:30:05 +0000 Subject: [PATCH 2/6] feat: add install.sh and install.ps1 download scripts with docs update Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/bfeecfa8-81d9-45da-b1a7-b2dd6804b34f Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- .../.installation | 1 + docs/.vuepress/public/install.ps1 | 48 +++++++++ docs/.vuepress/public/install.sh | 100 ++++++++++++++++++ docs/guide/installation.md | 37 +++++++ 4 files changed, 186 insertions(+) create mode 100644 Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation create mode 100644 docs/.vuepress/public/install.ps1 create mode 100644 docs/.vuepress/public/install.sh diff --git a/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation b/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation new file mode 100644 index 00000000..17b48a06 --- /dev/null +++ b/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation @@ -0,0 +1 @@ +2c16f5a2-7133-410c-80fb-d99a09cc7988 \ No newline at end of file diff --git a/docs/.vuepress/public/install.ps1 b/docs/.vuepress/public/install.ps1 new file mode 100644 index 00000000..4d998b01 --- /dev/null +++ b/docs/.vuepress/public/install.ps1 @@ -0,0 +1,48 @@ +# Minecraft Console Client - Installer for Windows +# Downloads the latest MinecraftClient binary for your Windows architecture. +# Usage (PowerShell): iwr -useb https://mccteam.github.io/install.ps1 | iex + +$ErrorActionPreference = 'Stop' + +$REPO = "MCCTeam/Minecraft-Console-Client" +$OUTPUT = "MinecraftClient.exe" + +# --- Detect CPU architecture --- +$arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture +$archId = switch ($arch) { + 'X64' { 'x64' } + 'X86' { 'x86' } + 'Arm64' { 'arm64' } + default { + Write-Error "Unsupported CPU architecture: $arch" + exit 1 + } +} + +$suffix = "win-$archId" + +# --- Fetch latest release metadata from GitHub API --- +$apiUrl = "https://api.github.com/repos/$REPO/releases/latest" +Write-Host "Fetching latest release information..." +$release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing + +# --- Locate the correct asset --- +$asset = $release.assets | Where-Object { $_.name -like "*-$suffix.exe" } | Select-Object -First 1 + +if (-not $asset) { + Write-Error "Could not find a release asset for '$suffix'." + exit 1 +} + +$downloadUrl = $asset.browser_download_url +$tag = $release.tag_name + +Write-Host "Downloading MinecraftClient $tag ($suffix)..." + +# Suppress the progress bar to avoid cluttering the terminal and speed up the download +$ProgressPreference = 'SilentlyContinue' +Invoke-WebRequest -Uri $downloadUrl -OutFile $OUTPUT -UseBasicParsing + +Write-Host "" +Write-Host "Downloaded: .\$OUTPUT" +Write-Host "Run with: .\$OUTPUT --help" diff --git a/docs/.vuepress/public/install.sh b/docs/.vuepress/public/install.sh new file mode 100644 index 00000000..f1cf57d0 --- /dev/null +++ b/docs/.vuepress/public/install.sh @@ -0,0 +1,100 @@ +#!/bin/sh +# Minecraft Console Client - Installer +# Downloads the latest MinecraftClient binary for your Linux or macOS platform. +# Usage: curl -fsSL https://mccteam.github.io/install.sh | sh +# or: wget -qO- https://mccteam.github.io/install.sh | sh + +set -e + +REPO="MCCTeam/Minecraft-Console-Client" +OUTPUT="MinecraftClient" + +# --- Detect OS --- +OS=$(uname -s) +case "$OS" in + Linux) PLATFORM="linux" ;; + Darwin) PLATFORM="osx" ;; + *) + echo "Error: Unsupported OS '$OS'. This script supports Linux and macOS." >&2 + exit 1 + ;; +esac + +# --- Detect CPU architecture --- +ARCH=$(uname -m) +case "$ARCH" in + x86_64|amd64) ARCH_ID="x64" ;; + aarch64|arm64) ARCH_ID="arm64" ;; + armv7l|armv8l|armhf) ARCH_ID="arm" ;; + arm*) ARCH_ID="arm" ;; + *) + echo "Error: Unsupported CPU architecture '$ARCH'." >&2 + exit 1 + ;; +esac + +# macOS does not have an arm (32-bit) build +if [ "$PLATFORM" = "osx" ] && [ "$ARCH_ID" = "arm" ]; then + echo "Error: 32-bit ARM is not supported on macOS." >&2 + exit 1 +fi + +SUFFIX="${PLATFORM}-${ARCH_ID}" + +# --- Download helpers: prefer curl, fall back to wget --- +_download_stdout() { + if command -v curl >/dev/null 2>&1; then + curl -fsSL "$1" + elif command -v wget >/dev/null 2>&1; then + wget -qO- "$1" + else + echo "Error: Neither 'curl' nor 'wget' is available. Please install one and retry." >&2 + exit 1 + fi +} + +_download_file() { + if command -v curl >/dev/null 2>&1; then + curl -fL --progress-bar -o "$2" "$1" + elif command -v wget >/dev/null 2>&1; then + wget -O "$2" "$1" + else + echo "Error: Neither 'curl' nor 'wget' is available. Please install one and retry." >&2 + exit 1 + fi +} + +# --- Fetch latest release metadata from GitHub API --- +API_URL="https://api.github.com/repos/${REPO}/releases/latest" +echo "Fetching latest release information..." +RELEASE_JSON=$(_download_stdout "$API_URL") + +# --- Parse asset download URL (no external tools required) --- +# The JSON key "browser_download_url" appears once per asset. +# We match the key followed by the URL, anchoring on the platform-arch suffix +# and the closing quote so that e.g. "linux-arm" does not match "linux-arm64". +# The ' *: *' pattern handles optional spaces around the colon (GitHub API adds spaces). +ASSET_URL=$(printf '%s' "$RELEASE_JSON" \ + | grep -o '"browser_download_url" *: *"[^"]*-'"${SUFFIX}"'"' \ + | grep -o 'https://[^"]*' \ + | head -1) + +if [ -z "$ASSET_URL" ]; then + echo "Error: Could not find a release asset for platform '${SUFFIX}'." >&2 + exit 1 +fi + +# --- Extract tag name for display --- +TAG=$(printf '%s' "$RELEASE_JSON" \ + | grep -o '"tag_name" *: *"[^"]*"' \ + | head -1 \ + | grep -o '"[^"]*"$' \ + | tr -d '"') + +echo "Downloading MinecraftClient ${TAG} (${SUFFIX})..." +_download_file "$ASSET_URL" "$OUTPUT" +chmod +x "$OUTPUT" + +echo "" +echo "Downloaded: ./${OUTPUT}" +echo "Run with: ./${OUTPUT} --help" diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 612cf37c..1ba686ed 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -4,6 +4,7 @@ title: Installation # Installation +- [Quick Install (one-liner)](#quick-install) - [YouTube Tutorials](#youtube-tutorials) - [Download a compiled binary](#download-a-compiled-binary) - [Building from the source code](#building-from-the-source-code) @@ -11,6 +12,42 @@ title: Installation - [Run on Android](#run-on-android) - [Run MCC 24/7 on a VPS](#run-on-a-vps) +## Quick Install + +The quickest way to get MCC is to run the installer script for your platform. It auto-detects your OS and CPU architecture, fetches the latest release from GitHub, and saves the binary to your current directory. + +### Linux / macOS + +Open a terminal in the folder where you want MCC and run: + +```bash +curl -fsSL https://mccteam.github.io/install.sh | sh +``` + +If you prefer `wget`: + +```bash +wget -qO- https://mccteam.github.io/install.sh | sh +``` + +The script downloads `MinecraftClient` and marks it executable. Supported architectures: `x64`, `arm64`, `arm` (Linux only). + +### Windows + +Open **PowerShell** in the folder where you want MCC and run: + +```powershell +iwr -useb https://mccteam.github.io/install.ps1 | iex +``` + +The script downloads `MinecraftClient.exe`. Supported architectures: `x64`, `x86`, `arm64`. + +::: tip +You can also download the scripts directly and inspect them before running: +- Linux/macOS: [install.sh](https://mccteam.github.io/install.sh) +- Windows: [install.ps1](https://mccteam.github.io/install.ps1) +::: + ## YouTube Tutorials If you're not the kind of person that likes textual tutorials, our community has made video tutorials available on YouTube. From 8c4acb0ad556bae9285010ef259688067f7f3988 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:30:24 +0000 Subject: [PATCH 3/6] chore: remove Sentry cache dir and add to .gitignore Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/bfeecfa8-81d9-45da-b1a7-b2dd6804b34f Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- .gitignore | 1 + Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation diff --git a/.gitignore b/.gitignore index fe783fa4..91c3a8b6 100644 --- a/.gitignore +++ b/.gitignore @@ -436,3 +436,4 @@ FodyWeavers.xsd # SpecStory files /.specstory/ /.vscode/settings.json +/Sentry/ diff --git a/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation b/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation deleted file mode 100644 index 17b48a06..00000000 --- a/Sentry/E84A17A5B8C1640BCE4BE9BA61BAF7487EDC56C0/.installation +++ /dev/null @@ -1 +0,0 @@ -2c16f5a2-7133-410c-80fb-d99a09cc7988 \ No newline at end of file From 53afc252ea629fa410c25042e07d06c9ea63369a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:31:26 +0000 Subject: [PATCH 4/6] fix: use precise regex in install.ps1 asset matching Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/bfeecfa8-81d9-45da-b1a7-b2dd6804b34f Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- docs/.vuepress/public/install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/public/install.ps1 b/docs/.vuepress/public/install.ps1 index 4d998b01..7255738d 100644 --- a/docs/.vuepress/public/install.ps1 +++ b/docs/.vuepress/public/install.ps1 @@ -27,7 +27,7 @@ Write-Host "Fetching latest release information..." $release = Invoke-RestMethod -Uri $apiUrl -UseBasicParsing # --- Locate the correct asset --- -$asset = $release.assets | Where-Object { $_.name -like "*-$suffix.exe" } | Select-Object -First 1 +$asset = $release.assets | Where-Object { $_.name -match "^MinecraftClient-.*-$([regex]::Escape($suffix))\.exe$" } | Select-Object -First 1 if (-not $asset) { Write-Error "Could not find a release asset for '$suffix'." From 46fdd687c763322f55a6ec5bf51e98d3841a48eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:39:58 +0000 Subject: [PATCH 5/6] feat: add ASCII progress bars to both install scripts Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/00d3b725-2246-40c5-93e4-d9813d95c333 Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- docs/.vuepress/public/install.ps1 | 38 ++++++++++++++++++++++++++++--- docs/.vuepress/public/install.sh | 6 +++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/public/install.ps1 b/docs/.vuepress/public/install.ps1 index 7255738d..8a14a86c 100644 --- a/docs/.vuepress/public/install.ps1 +++ b/docs/.vuepress/public/install.ps1 @@ -39,9 +39,41 @@ $tag = $release.tag_name Write-Host "Downloading MinecraftClient $tag ($suffix)..." -# Suppress the progress bar to avoid cluttering the terminal and speed up the download -$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri $downloadUrl -OutFile $OUTPUT -UseBasicParsing +# Download with a built-in ASCII progress bar (no external tools required). +# HttpWebRequest streams the body on the main thread so we can update the +# progress bar inline without any Runspace or thread-safety concerns. +$outPath = Join-Path (Get-Location).Path $OUTPUT +$request = [System.Net.HttpWebRequest]::Create($downloadUrl) +$response = $request.GetResponse() +$totalBytes = $response.ContentLength + +$responseStream = $response.GetResponseStream() +$fileStream = [System.IO.File]::Create($outPath) +$buffer = New-Object byte[] 32768 +$totalRead = 0 + +try { + while ($true) { + $read = $responseStream.Read($buffer, 0, $buffer.Length) + if ($read -le 0) { break } + $fileStream.Write($buffer, 0, $read) + $totalRead += $read + if ($totalBytes -gt 0) { + $pct = [int]($totalRead * 100 / $totalBytes) + $filled = '=' * [int]($pct / 2) + $bar = $filled.PadRight(50) + $recv = [math]::Round($totalRead / 1MB, 1) + $total = [math]::Round($totalBytes / 1MB, 1) + Write-Host -NoNewline ("`r[{0}] {1,3}% {2,6:N1} / {3,6:N1} MB" -f $bar, $pct, $recv, $total) + } + } +} finally { + $fileStream.Close() + $responseStream.Close() + $response.Close() +} + +Write-Host "" # end the progress line Write-Host "" Write-Host "Downloaded: .\$OUTPUT" diff --git a/docs/.vuepress/public/install.sh b/docs/.vuepress/public/install.sh index f1cf57d0..d3e74d3d 100644 --- a/docs/.vuepress/public/install.sh +++ b/docs/.vuepress/public/install.sh @@ -57,6 +57,12 @@ _download_file() { if command -v curl >/dev/null 2>&1; then curl -fL --progress-bar -o "$2" "$1" elif command -v wget >/dev/null 2>&1; then + # --show-progress forces the progress bar even when stdout is not a TTY. + # Fall back silently to default output if the flag is not supported + # (older wget versions, e.g. BusyBox wget). + if wget --show-progress -O "$2" "$1" 2>/dev/null; then + return 0 + fi wget -O "$2" "$1" else echo "Error: Neither 'curl' nor 'wget' is available. Please install one and retry." >&2 From f10556a162ccbd8098f8725b0fa66e11a1bb03c0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:45:40 +0000 Subject: [PATCH 6/6] fix: use Console::Write for progress bar to avoid duplicate bars when piped via iex Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/2c598307-7028-46d4-ac37-045f5ce125ed Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- docs/.vuepress/public/install.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/public/install.ps1 b/docs/.vuepress/public/install.ps1 index 8a14a86c..31f2e324 100644 --- a/docs/.vuepress/public/install.ps1 +++ b/docs/.vuepress/public/install.ps1 @@ -64,7 +64,12 @@ try { $bar = $filled.PadRight(50) $recv = [math]::Round($totalRead / 1MB, 1) $total = [math]::Round($totalBytes / 1MB, 1) - Write-Host -NoNewline ("`r[{0}] {1,3}% {2,6:N1} / {3,6:N1} MB" -f $bar, $pct, $recv, $total) + # Use [Console]::Write with an explicit \r so the cursor returns to + # column 0 and overwrites the previous bar. Write-Host -NoNewline + # does not reliably reposition the cursor when the script is run + # via iex (pipe mode), producing multiple bars on one line. + $line = "`r[{0}] {1,3}% {2,6:N1} / {3,6:N1} MB" -f $bar, $pct, $recv, $total + [Console]::Write($line) } } } finally { @@ -73,7 +78,7 @@ try { $response.Close() } -Write-Host "" # end the progress line +[Console]::WriteLine() # end the progress line Write-Host "" Write-Host "Downloaded: .\$OUTPUT"