From 2b1b98b994d4ea988825bc2556bacd8029a19c19 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 04:29:41 -0700 Subject: [PATCH 01/10] feat: make compatible with linux --- .github/workflows/ci.yml | 9 ++++- .github/workflows/release.yml | 31 ++++++++++++++- crates/cli/src/paths.rs | 57 ++++++++++++++++++++++++--- crates/cli/src/versionstore.rs | 70 +++++++++++++++++++++++++++++----- crates/launcher/src/main.rs | 66 +++++++++++++++++++++++++++----- 5 files changed, 204 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 298cdfe..93224dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,14 @@ on: jobs: check: - runs-on: windows-latest + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b01dd6c..bffde17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,5 @@ name: release + on: push: tags: ["v*"] @@ -17,10 +18,36 @@ jobs: run: | v="${GITHUB_REF_NAME#v}" grep -q "^version = \"$v\"" Cargo.toml - - run: cargo build --release --locked - - uses: softprops/action-gh-release@v2 + - name: Build + run: cargo build --release --locked + - name: Upload release assets + uses: softprops/action-gh-release@v2 with: generate_release_notes: true files: | target/release/pogly.exe target/release/pogly-cli.exe + + release-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Verify tag matches workspace version + shell: bash + run: | + v="${GITHUB_REF_NAME#v}" + grep -q "^version = \"$v\"" Cargo.toml + - name: Build + run: cargo build --release --locked + - name: Prepare binaries + run: | + chmod +x target/release/pogly + chmod +x target/release/pogly-cli + - name: Upload release assets + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: | + target/release/pogly + target/release/pogly-cli diff --git a/crates/cli/src/paths.rs b/crates/cli/src/paths.rs index 5f232d4..2d8db97 100644 --- a/crates/cli/src/paths.rs +++ b/crates/cli/src/paths.rs @@ -1,17 +1,58 @@ use std::path::PathBuf; -fn env_dir(var: &str) -> PathBuf { - std::env::var_os(var) +#[cfg(windows)] +fn config_base_dir() -> PathBuf { + std::env::var_os("APPDATA") .map(PathBuf::from) - .unwrap_or_else(std::env::temp_dir) + .unwrap_or_else(|| { + std::env::var_os("USERPROFILE") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + }) +} + +#[cfg(not(windows))] +fn config_base_dir() -> PathBuf { + std::env::var_os("XDG_CONFIG_HOME") + .map(PathBuf::from) + .unwrap_or_else(|| { + std::env::var_os("HOME") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + .join(".config") + }) +} + +#[cfg(windows)] +fn local_base_dir() -> PathBuf { + std::env::var_os("LOCALAPPDATA") + .map(PathBuf::from) + .unwrap_or_else(|| { + std::env::var_os("USERPROFILE") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + }) +} + +#[cfg(not(windows))] +fn local_base_dir() -> PathBuf { + std::env::var_os("XDG_DATA_HOME") + .map(PathBuf::from) + .unwrap_or_else(|| { + std::env::var_os("HOME") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + .join(".local") + .join("share") + }) } pub fn config_dir() -> PathBuf { - env_dir("APPDATA").join("Pogly").join("cli") + config_base_dir().join("Pogly").join("cli") } pub fn local_dir() -> PathBuf { - env_dir("LOCALAPPDATA").join("Pogly").join("cli") + local_base_dir().join("Pogly").join("cli") } pub fn config_file() -> PathBuf { @@ -31,5 +72,9 @@ pub fn bin_dir() -> PathBuf { } pub fn launcher_path() -> PathBuf { - local_dir().join("pogly.exe") + local_dir().join(if cfg!(windows) { + "pogly.exe" + } else { + "pogly" + }) } diff --git a/crates/cli/src/versionstore.rs b/crates/cli/src/versionstore.rs index 22e8ad6..9398002 100644 --- a/crates/cli/src/versionstore.rs +++ b/crates/cli/src/versionstore.rs @@ -6,12 +6,29 @@ use ureq::Agent; use crate::paths; +fn cli_binary_name() -> &'static str { + if cfg!(windows) { + "pogly-cli.exe" + } else { + "pogly-cli" + } +} + +fn launcher_binary_name() -> &'static str { + if cfg!(windows) { + "pogly.exe" + } else { + "pogly" + } +} + pub fn installed_versions() -> Vec { + let binary_name = cli_binary_name(); let mut versions: Vec = std::fs::read_dir(paths::bin_dir()) .map(|entries| { entries .flatten() - .filter(|e| e.path().join("pogly-cli.exe").is_file()) + .filter(|e| e.path().join(binary_name).is_file()) .filter_map(|e| e.file_name().into_string().ok()) .collect() }) @@ -34,7 +51,8 @@ pub fn pointer() -> Option { pub fn set_pointer(version: &str) -> Result<()> { std::fs::create_dir_all(paths::local_dir())?; - std::fs::write(paths::version_pointer(), version).context("failed to write version pointer") + std::fs::write(paths::version_pointer(), version) + .context("failed to write version pointer") } fn download_agent() -> Agent { @@ -70,14 +88,24 @@ fn download(url: &str) -> Result> { } pub fn install_version(version: &str, release: &Value) -> Result<()> { - let url = asset_url(release, "pogly-cli.exe").context("release has no pogly-cli.exe asset")?; + let binary_name = cli_binary_name(); + let url = asset_url(release, binary_name) + .with_context(|| format!("release has no {binary_name} asset"))?; let dir = paths::bin_dir().join(version); std::fs::create_dir_all(&dir)?; - let target = dir.join("pogly-cli.exe"); - let tmp = dir.join("pogly-cli.exe.tmp"); + let target = dir.join(binary_name); + let tmp = dir.join(format!("{binary_name}.tmp")); std::fs::write(&tmp, download(url)?)?; std::fs::rename(&tmp, &target) .with_context(|| format!("failed to install {}", target.display()))?; + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + + let mut permissions = std::fs::metadata(&target)?.permissions(); + permissions.set_mode(0o755); + std::fs::set_permissions(&target, permissions)?; + } Ok(()) } @@ -89,16 +117,38 @@ pub fn replace_launcher(release: &Value) -> Result<()> { if !path.is_file() { return Ok(()); } - let Some(url) = asset_url(release, "pogly.exe") else { + let launcher_name = launcher_binary_name(); + let Some(url) = asset_url(release, launcher_name) else { return Ok(()); }; let bytes = download(url)?; - let old = paths::local_dir().join("pogly.exe.old"); + let old = paths::local_dir().join(if cfg!(windows) { + "pogly.exe.old" + } else { + "pogly.old" + }); + let tmp = paths::local_dir().join(if cfg!(windows) { + "pogly.exe.tmp" + } else { + "pogly.tmp" + }); let _ = std::fs::remove_file(&old); - std::fs::rename(&path, &old).context("failed to move the current launcher aside")?; - if let Err(e) = std::fs::write(&path, bytes) { + let _ = std::fs::remove_file(&tmp); + std::fs::write(&tmp, bytes) + .context("failed to write new launcher")?; + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + + let mut permissions = std::fs::metadata(&tmp)?.permissions(); + permissions.set_mode(0o755); + std::fs::set_permissions(&tmp, permissions)?; + } + std::fs::rename(&path, &old) + .context("failed to move the current launcher aside")?; + if let Err(e) = std::fs::rename(&tmp, &path) { let _ = std::fs::rename(&old, &path); - bail!("failed to write new launcher: {e}"); + return Err(e).context("failed to install new launcher"); } Ok(()) } diff --git a/crates/launcher/src/main.rs b/crates/launcher/src/main.rs index 2871c38..e394e06 100644 --- a/crates/launcher/src/main.rs +++ b/crates/launcher/src/main.rs @@ -2,11 +2,45 @@ use std::path::{Path, PathBuf}; use std::process::Command; fn local_dir() -> PathBuf { - std::env::var_os("LOCALAPPDATA") - .map(PathBuf::from) - .unwrap_or_else(std::env::temp_dir) - .join("Pogly") - .join("cli") + #[cfg(windows)] + { + std::env::var_os("LOCALAPPDATA") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + .join("Pogly") + .join("cli") + } + + #[cfg(not(windows))] + { + std::env::var_os("XDG_DATA_HOME") + .map(PathBuf::from) + .unwrap_or_else(|| { + std::env::var_os("HOME") + .map(PathBuf::from) + .unwrap_or_else(std::env::temp_dir) + .join(".local") + .join("share") + }) + .join("Pogly") + .join("cli") + } +} + +fn cli_binary_name() -> &'static str { + if cfg!(windows) { + "pogly-cli.exe" + } else { + "pogly-cli" + } +} + +fn launcher_old_name() -> &'static str { + if cfg!(windows) { + "pogly.exe.old" + } else { + "pogly.old" + } } fn selected_version(dir: &Path) -> Option { @@ -14,14 +48,17 @@ fn selected_version(dir: &Path) -> Option { .ok() .map(|s| s.trim().to_string()) .filter(|s| !s.is_empty()); + if pointer.is_some() { return pointer; } + // No pointer file: fall back to the highest installed version. + let binary_name = cli_binary_name(); let mut versions: Vec = std::fs::read_dir(dir.join("bin")) .ok()? .flatten() - .filter(|e| e.path().join("pogly-cli.exe").is_file()) + .filter(|e| e.path().join(binary_name).is_file()) .filter_map(|e| e.file_name().into_string().ok()) .collect(); versions.sort(); @@ -36,7 +73,7 @@ fn main() { .ok() .and_then(|p| p.parent().map(|p| p.to_path_buf())) { - let _ = std::fs::remove_file(parent.join("pogly.exe.old")); + let _ = std::fs::remove_file(parent.join(launcher_old_name())); } let Some(version) = selected_version(&dir) else { @@ -45,10 +82,19 @@ fn main() { std::process::exit(1); }; - let exe = dir.join("bin").join(&version).join("pogly-cli.exe"); + let exe = dir + .join("bin") + .join(&version) + .join(cli_binary_name()); if !exe.is_file() { - eprintln!("pogly-cli {version} is not installed at {}", exe.display()); - eprintln!("Run `pogly version list` from an installed version, or reinstall from https://github.com/PoglyApp/pogly-cli/releases"); + eprintln!( + "pogly-cli {version} is not installed at {}", + exe.display() + ); + eprintln!( + "Run `pogly version list` from an installed version, \ + or reinstall from https://github.com/PoglyApp/pogly-cli/releases" + ); std::process::exit(1); } From a9705d9abfe0d56f1411201b28b9de3d065281c0 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 04:32:47 -0700 Subject: [PATCH 02/10] feat: install.sh script (i forgot to add it) --- install.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..ba88a8c --- /dev/null +++ b/install.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +set -eu + +REPO="PoglyApp/pogly-cli" +INSTALL_DIR="${POGLY_INSTALL_DIR:-$HOME/.local/bin}" +LAUNCHER="pogly" + +echo "Installing Pogly CLI..." + +OS="$(uname -s)" +ARCH="$(uname -m)" + +if [ "$OS" != "Linux" ]; then + echo "Error: this installer currently only supports Linux." + echo "Detected: $OS" + exit 1 +fi + +case "$ARCH" in + x86_64) + ASSET="pogly" + ;; + *) + echo "Error: unsupported architecture: $ARCH" + echo "Currently supported: x86_64" + exit 1 + ;; +esac + +DOWNLOAD_URL="https://github.com/$REPO/releases/latest/download/$ASSET" + +mkdir -p "$INSTALL_DIR" + +echo "Downloading $ASSET..." + +if command -v curl >/dev/null 2>&1; then + curl -fL "$DOWNLOAD_URL" -o "$INSTALL_DIR/$LAUNCHER" +elif command -v wget >/dev/null 2>&1; then + wget -O "$INSTALL_DIR/$LAUNCHER" "$DOWNLOAD_URL" +else + echo "Error: curl or wget is required." + exit 1 +fi + +chmod +x "$INSTALL_DIR/$LAUNCHER" + +echo "" +echo "Pogly CLI installed successfully!" +echo "" +echo "Location:" +echo " $INSTALL_DIR/$LAUNCHER" +echo "" + +case ":${PATH:-}:" in + *":$INSTALL_DIR:"*) + echo "You can now run:" + echo " pogly --help" + ;; + *) + echo "Add this directory to your PATH:" + echo "" + echo " export PATH=\"$INSTALL_DIR:\$PATH\"" + echo "" + echo "For fish:" + echo "" + echo " fish_add_path $INSTALL_DIR" + ;; +esac From 0f513204f732fd02d044ba5dee31b479175099b7 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 20:29:53 -0700 Subject: [PATCH 03/10] feat: update and add uninstall.sh --- install.sh | 87 ++++++++++++++++++---------------------------------- uninstall.sh | 36 ++++++++++++++++++++++ 2 files changed, 66 insertions(+), 57 deletions(-) create mode 100644 uninstall.sh diff --git a/install.sh b/install.sh index ba88a8c..419c4a0 100644 --- a/install.sh +++ b/install.sh @@ -1,69 +1,42 @@ -#!/bin/sh +#!/usr/bin/env bash -set -eu +set -euo pipefail -REPO="PoglyApp/pogly-cli" -INSTALL_DIR="${POGLY_INSTALL_DIR:-$HOME/.local/bin}" -LAUNCHER="pogly" +repo="PoglyApp/pogly-cli" +root="${XDG_DATA_HOME:-$HOME/.local/share}/Pogly/cli" -echo "Installing Pogly CLI..." +echo "Installing pogly-cli..." -OS="$(uname -s)" -ARCH="$(uname -m)" +release=$(curl -fsSL -H "User-Agent: pogly-cli-installer" "https://api.github.com/repos/$repo/releases/latest") +tag=$(echo "$release" | grep -m1 '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/') +version="${tag#v}" +bin_dir="$root/bin/$version" -if [ "$OS" != "Linux" ]; then - echo "Error: this installer currently only supports Linux." - echo "Detected: $OS" - exit 1 -fi - -case "$ARCH" in - x86_64) - ASSET="pogly" - ;; - *) - echo "Error: unsupported architecture: $ARCH" - echo "Currently supported: x86_64" - exit 1 - ;; -esac +mkdir -p "$bin_dir" -DOWNLOAD_URL="https://github.com/$REPO/releases/latest/download/$ASSET" +echo "Downloading pogly-cli $tag..." +curl -fsSL -o "$bin_dir/pogly-cli" "https://github.com/$repo/releases/download/$tag/pogly-cli" +chmod +x "$bin_dir/pogly-cli" -mkdir -p "$INSTALL_DIR" +launcher="$root/pogly" +echo "Downloading launcher..." +if ! curl -fsSL -o "$launcher" "https://github.com/$repo/releases/download/$tag/pogly"; then + mv -f "$launcher" "$launcher.old" 2>/dev/null || true + curl -fsSL -o "$launcher" "https://github.com/$repo/releases/download/$tag/pogly" +fi +chmod +x "$launcher" -echo "Downloading $ASSET..." +printf '%s' "$version" > "$root/version" -if command -v curl >/dev/null 2>&1; then - curl -fL "$DOWNLOAD_URL" -o "$INSTALL_DIR/$LAUNCHER" -elif command -v wget >/dev/null 2>&1; then - wget -O "$INSTALL_DIR/$LAUNCHER" "$DOWNLOAD_URL" -else - echo "Error: curl or wget is required." - exit 1 +shell_rc="$HOME/.bashrc" +[ -n "${ZSH_VERSION:-}" ] && shell_rc="$HOME/.zshrc" +if ! grep -qs "$root" "$shell_rc" 2>/dev/null; then + echo "export PATH=\"$root:\$PATH\"" >> "$shell_rc" + echo "Added $root to your PATH in $shell_rc (open a new terminal if 'pogly' is not found)." fi -chmod +x "$INSTALL_DIR/$LAUNCHER" - echo "" -echo "Pogly CLI installed successfully!" -echo "" -echo "Location:" -echo " $INSTALL_DIR/$LAUNCHER" -echo "" - -case ":${PATH:-}:" in - *":$INSTALL_DIR:"*) - echo "You can now run:" - echo " pogly --help" - ;; - *) - echo "Add this directory to your PATH:" - echo "" - echo " export PATH=\"$INSTALL_DIR:\$PATH\"" - echo "" - echo "For fish:" - echo "" - echo " fish_add_path $INSTALL_DIR" - ;; -esac +echo "pogly-cli $tag installed." +echo "Get started:" +echo " pogly overlay add --token pgly_..." +echo " pogly help" diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..ad6c281 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -euo pipefail + +purge_config=false +[ "${1:-}" = "--purge-config" ] && purge_config=true + +root="${XDG_DATA_HOME:-$HOME/.local/share}/Pogly/cli" +config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/Pogly/cli" + +if [ -d "$root" ]; then + rm -rf "$root" + echo "Removed $root" +else + echo "Nothing installed at $root" +fi + +for shell_rc in "$HOME/.bashrc" "$HOME/.zshrc"; do + [ -f "$shell_rc" ] || continue + if grep -qs "$root" "$shell_rc"; then + sed -i.bak "\#export PATH=\"$root:\$PATH\"#d" "$shell_rc" + rm -f "$shell_rc.bak" + echo "Removed $root from PATH in $shell_rc" + fi +done + +if $purge_config; then + if [ -d "$config_dir" ]; then + rm -rf "$config_dir" + echo "Removed overlay profiles at $config_dir" + fi +elif [ -d "$config_dir" ]; then + echo "Overlay profiles kept at $config_dir (rerun with --purge-config to remove them)" +fi + +echo "pogly-cli uninstalled." \ No newline at end of file From a68d6454e37655e51c87a7ad9539c12991522c0d Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 20:35:27 -0700 Subject: [PATCH 04/10] fix: make readme.md include linux installation and uninstallation --- README.md | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8edba49..3fd3628 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # pogly-cli -A Windows command-line tool for managing a [Pogly](https://pogly.gg) overlay through its HTTP API — and an open-source reference for building your own API integrations. +A Windows and Linux command-line tool for managing a [Pogly](https://pogly.gg) overlay through its HTTP API — and an open-source reference for building your own API integrations. -``` -pogly elements add text --text "New follower!" --size 64 --color "#82a5ff" --x 200 --y 150 +pogly elements add text --text "New follower!" --size 64 --color " +#82a5ff" --x 200 --y 150 pogly layouts set-active --name "Starting Soon" pogly elements list -``` + Feedback and questions: https://discord.gg/pogly API documentation: https://docs.pogly.gg/#http-api @@ -21,23 +21,49 @@ iwr https://cli.pogly.gg -useb | iex This downloads the [latest release](https://github.com/PoglyApp/pogly-cli/releases), installs it to `%LOCALAPPDATA%\Pogly\cli`, and adds it to your `PATH`. The script it runs is [install.ps1](install.ps1) if you'd rather read it first. +Quick install (Bash): + +```bash +curl -fsSL https://cli.pogly.gg/install.sh | bash +``` + +This downloads the [latest release](https://github.com/PoglyApp/pogly-cli/releases), installs it to `~/.local/share/Pogly/cli` (or `$XDG_DATA_HOME/Pogly/cli`), and adds it to your `PATH` via `~/.bashrc` or `~/.zshrc`. The script it runs is [install.sh](install.sh) if you'd rather read it first. + ### Manual install -1. Download `pogly.exe` and `pogly-cli.exe` from the [latest release](https://github.com/PoglyApp/pogly-cli/releases). +1. Download `pogly` and `pogly-cli` (Linux) or `pogly.exe` and `pogly-cli.exe` (Windows) from the [latest release](https://github.com/PoglyApp/pogly-cli/releases). 2. Place them like this (`` is the release version, e.g. `0.1.0`): + + **Windows:** ``` %LOCALAPPDATA%\Pogly\cli\pogly.exe - %LOCALAPPDATA%\Pogly\cli\bin\\pogly-cli.exe + %LOCALAPPDATA%\Pogly\cli\bin\pogly-cli.exe + ``` + + **Linux:** + ``` + ~/.local/share/Pogly/cli/pogly + ~/.local/share/Pogly/cli/bin//pogly-cli ``` -3. Add `%LOCALAPPDATA%\Pogly\cli` to your `PATH`. + (or under `$XDG_DATA_HOME/Pogly/cli` if that's set) + +3. On Linux, `chmod +x` both binaries. +4. Write the version string (no trailing newline) to `version` next to `pogly`/`pogly.exe`. +5. Add that directory to your `PATH`. ### Uninstall -Run [uninstall.ps1](uninstall.ps1) — it removes the binaries, version store, and PATH entry. Your overlay profiles are kept unless you pass `-PurgeConfig`. +**Windows:** run [uninstall.ps1](uninstall.ps1) — it removes the binaries, version store, and PATH entry. Your overlay profiles are kept unless you pass `-PurgeConfig`. + +**Linux:** +```bash +curl -fsSL https://cli.pogly.gg/uninstall.sh | bash +``` +Or run [uninstall.sh](uninstall.sh) directly if you already have it locally. It removes the binaries, version store, and PATH entry; overlay profiles are kept unless you pass `--purge-config`. ### Version management -`pogly.exe` is a small launcher that runs the selected `pogly-cli.exe`, so multiple versions can live side by side: +`pogly` (`pogly.exe` on Windows) is a small launcher that runs the selected `pogly-cli` (`pogly-cli.exe` on Windows), so multiple versions can live side by side: ``` pogly version # show the current version @@ -70,7 +96,7 @@ pogly elements delete 42 | --- | --- | | `ping` | Check that the overlay API is reachable (no token needed) | | `whoami` | Show the token's label, identity, and permissions | -| `overlay list\|add\|update\|remove\|set-default` | Manage overlay profiles (stored in `%APPDATA%\Pogly\cli\config.toml`) | +| `overlay list\|add\|update\|remove\|set-default` | Manage overlay profiles (stored in `%APPDATA%\Pogly\cli\config.toml` on Windows, `~/.config/Pogly/cli/config.toml` on Linux) | | `elements list\|add \|update\|delete` | Manage elements; `add` has `text`, `image`, `widget`, and `media` subcommands | | `elementdata list\|add\|update\|delete` | Manage element data assets | | `layouts list\|add\|duplicate\|rename\|delete\|set-active` | Manage layouts; `set-active` switches the live scene | @@ -91,7 +117,7 @@ The [examples/](examples/) folder shows how to hook the CLI into your stream: St cargo build --release ``` -Produces `target\release\pogly-cli.exe` (the CLI) and `target\release\pogly.exe` (the launcher). Run the CLI directly during development: `cargo run -p pogly-cli -- `. +On Windows this produces `target\release\pogly-cli.exe` (the CLI) and `target\release\pogly.exe` (the launcher). On Linux it produces `target/release/pogly-cli` and `target/release/pogly`. Run the CLI directly during development: `cargo run -p pogly-cli -- `. To test `version upgrade` against a fork, set `POGLY_RELEASES_REPO=/`. From 678c1fe48828d563a73b11b00f4a26f54d29591c Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 20:36:09 -0700 Subject: [PATCH 05/10] feat: cargo fmt --- crates/cli/src/paths.rs | 6 +----- crates/cli/src/versionstore.rs | 9 +++------ crates/launcher/src/main.rs | 10 ++-------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/crates/cli/src/paths.rs b/crates/cli/src/paths.rs index 2d8db97..3be82a3 100644 --- a/crates/cli/src/paths.rs +++ b/crates/cli/src/paths.rs @@ -72,9 +72,5 @@ pub fn bin_dir() -> PathBuf { } pub fn launcher_path() -> PathBuf { - local_dir().join(if cfg!(windows) { - "pogly.exe" - } else { - "pogly" - }) + local_dir().join(if cfg!(windows) { "pogly.exe" } else { "pogly" }) } diff --git a/crates/cli/src/versionstore.rs b/crates/cli/src/versionstore.rs index 9398002..a0b3153 100644 --- a/crates/cli/src/versionstore.rs +++ b/crates/cli/src/versionstore.rs @@ -51,8 +51,7 @@ pub fn pointer() -> Option { pub fn set_pointer(version: &str) -> Result<()> { std::fs::create_dir_all(paths::local_dir())?; - std::fs::write(paths::version_pointer(), version) - .context("failed to write version pointer") + std::fs::write(paths::version_pointer(), version).context("failed to write version pointer") } fn download_agent() -> Agent { @@ -134,8 +133,7 @@ pub fn replace_launcher(release: &Value) -> Result<()> { }); let _ = std::fs::remove_file(&old); let _ = std::fs::remove_file(&tmp); - std::fs::write(&tmp, bytes) - .context("failed to write new launcher")?; + std::fs::write(&tmp, bytes).context("failed to write new launcher")?; #[cfg(unix)] { use std::os::unix::fs::PermissionsExt; @@ -144,8 +142,7 @@ pub fn replace_launcher(release: &Value) -> Result<()> { permissions.set_mode(0o755); std::fs::set_permissions(&tmp, permissions)?; } - std::fs::rename(&path, &old) - .context("failed to move the current launcher aside")?; + std::fs::rename(&path, &old).context("failed to move the current launcher aside")?; if let Err(e) = std::fs::rename(&tmp, &path) { let _ = std::fs::rename(&old, &path); return Err(e).context("failed to install new launcher"); diff --git a/crates/launcher/src/main.rs b/crates/launcher/src/main.rs index e394e06..20941eb 100644 --- a/crates/launcher/src/main.rs +++ b/crates/launcher/src/main.rs @@ -82,15 +82,9 @@ fn main() { std::process::exit(1); }; - let exe = dir - .join("bin") - .join(&version) - .join(cli_binary_name()); + let exe = dir.join("bin").join(&version).join(cli_binary_name()); if !exe.is_file() { - eprintln!( - "pogly-cli {version} is not installed at {}", - exe.display() - ); + eprintln!("pogly-cli {version} is not installed at {}", exe.display()); eprintln!( "Run `pogly version list` from an installed version, \ or reinstall from https://github.com/PoglyApp/pogly-cli/releases" From 019ef4d99efab2dd6d203e788ddab69038b4ec06 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 20:39:29 -0700 Subject: [PATCH 06/10] fix: resolve unused import `bail` --- crates/cli/src/versionstore.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/versionstore.rs b/crates/cli/src/versionstore.rs index a0b3153..c068ec4 100644 --- a/crates/cli/src/versionstore.rs +++ b/crates/cli/src/versionstore.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result}; use serde_json::Value; use ureq::Agent; From 8ac7ced02ff74f970751fdbc88b77fcd33ae3efe Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Tue, 8 Sep 2026 20:41:40 -0700 Subject: [PATCH 07/10] fix: fixed release.yml --- .github/workflows/release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bffde17..1385e66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,10 +40,6 @@ jobs: grep -q "^version = \"$v\"" Cargo.toml - name: Build run: cargo build --release --locked - - name: Prepare binaries - run: | - chmod +x target/release/pogly - chmod +x target/release/pogly-cli - name: Upload release assets uses: softprops/action-gh-release@v2 with: From fb0a94ee332ab3555cbd9c7ed34e761e1118500a Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Wed, 9 Sep 2026 06:59:24 -0700 Subject: [PATCH 08/10] fix: fix the readme ``` --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3fd3628..cf8b199 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ A Windows and Linux command-line tool for managing a [Pogly](https://pogly.gg) overlay through its HTTP API — and an open-source reference for building your own API integrations. -pogly elements add text --text "New follower!" --size 64 --color " -#82a5ff" --x 200 --y 150 +``` +pogly elements add text --text "New follower!" --size 64 --color "#82a5ff" --x 200 --y 150 pogly layouts set-active --name "Starting Soon" pogly elements list - +``` Feedback and questions: https://discord.gg/pogly API documentation: https://docs.pogly.gg/#http-api From 78b483d378fc47e9d7db37052524aa87b1dd2460 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Wed, 9 Sep 2026 07:01:08 -0700 Subject: [PATCH 09/10] fix: detect default shell instead of in install.sh --- install.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 419c4a0..d8f009c 100644 --- a/install.sh +++ b/install.sh @@ -28,8 +28,18 @@ chmod +x "$launcher" printf '%s' "$version" > "$root/version" -shell_rc="$HOME/.bashrc" -[ -n "${ZSH_VERSION:-}" ] && shell_rc="$HOME/.zshrc" +case "$(basename "${SHELL:-bash}")" in + zsh) + shell_rc="$HOME/.zshrc" + ;; + bash) + shell_rc="$HOME/.bashrc" + ;; + *) + shell_rc="$HOME/.profile" + ;; +esac + if ! grep -qs "$root" "$shell_rc" 2>/dev/null; then echo "export PATH=\"$root:\$PATH\"" >> "$shell_rc" echo "Added $root to your PATH in $shell_rc (open a new terminal if 'pogly' is not found)." @@ -40,3 +50,4 @@ echo "pogly-cli $tag installed." echo "Get started:" echo " pogly overlay add --token pgly_..." echo " pogly help" + From 6b24a035723f2098f1b86d5e4171b8b83002dc91 Mon Sep 17 00:00:00 2001 From: ItsBr0dyy <1500forlifejahh@gmail.com> Date: Wed, 9 Sep 2026 07:02:48 -0700 Subject: [PATCH 10/10] fix: add backslash in windows cli version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf8b199..7b87434 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ This downloads the [latest release](https://github.com/PoglyApp/pogly-cli/releas **Windows:** ``` %LOCALAPPDATA%\Pogly\cli\pogly.exe - %LOCALAPPDATA%\Pogly\cli\bin\pogly-cli.exe + %LOCALAPPDATA%\Pogly\cli\bin\\pogly-cli.exe ``` **Linux:**