Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Add friendly uninstall flow (#33)

Teethat Kamsai4d722fe5ed8f
diff --git a/README.md b/README.md
index 7b21d0a..d3a6f75 100644
--- a/README.md
+++ b/README.md
@@ -179,6 +179,14 @@ podcli process episode.mp4 # transcribe + export clips
Supported platforms: macOS (Apple Silicon), Linux (x64 / arm64), Windows (x64).
Intel Macs are coming in a follow-up release.
+To uninstall the app files while keeping your config, knowledge, presets, assets, history, and cache:
+
+```bash
+podcli uninstall
+```
+
+Add `--purge` if you want to remove the entire managed podcli folder, including user data.
+
**Optional**, for AI clip suggestion and the PodStack slash commands: install
[Claude Code](https://docs.anthropic.com/en/docs/claude-code) or
[Codex](https://openai.com/index/introducing-codex/) (auto-detected).
diff --git a/cli/internal/paths/paths.go b/cli/internal/paths/paths.go
index d510e3d..00a3d3c 100644
--- a/cli/internal/paths/paths.go
+++ b/cli/internal/paths/paths.go
@@ -43,3 +43,10 @@ func RuntimeDir() string { return filepath.Join(Home(), "runtime") }
func ModelsDir() string { return filepath.Join(Home(), "models") }
func BinDir() string { return filepath.Join(Home(), "bin") }
func ConfigPath() string { return filepath.Join(Home(), "config.json") }
+
+func ExeSuffix() string {
+ if runtime.GOOS == "windows" {
+ return ".exe"
+ }
+ return ""
+}
diff --git a/cli/internal/provision/provision.go b/cli/internal/provision/provision.go
index 766c14c..8cc3fb8 100644
--- a/cli/internal/provision/provision.go
+++ b/cli/internal/provision/provision.go
@@ -281,17 +281,10 @@ var ffmpegSpecs = map[string][]ffArchive{
},
}
-func exeSuffix() string {
- if runtime.GOOS == "windows" {
- return ".exe"
- }
- return ""
-}
-
const podcliRepo = "nmbrthirteen/podcli"
func WhisperCLIBin() string {
- return filepath.Join(paths.RuntimeDir(), "whisper", "whisper-cli"+exeSuffix())
+ return filepath.Join(paths.RuntimeDir(), "whisper", "whisper-cli"+paths.ExeSuffix())
}
func latestReleaseAssets() (map[string]string, error) {
@@ -444,7 +437,7 @@ func EnsureWhisperCpp() (string, error) {
if have(bin) {
return bin, nil
}
- name := fmt.Sprintf("whisper-cli-%s-%s%s", runtime.GOOS, runtime.GOARCH, exeSuffix())
+ name := fmt.Sprintf("whisper-cli-%s-%s%s", runtime.GOOS, runtime.GOARCH, paths.ExeSuffix())
assets, err := latestReleaseAssets()
if err != nil {
return "", err
@@ -469,7 +462,7 @@ func EnsureWhisperCpp() (string, error) {
}
func FFmpegBin() string {
- return filepath.Join(paths.RuntimeDir(), "ffmpeg", "ffmpeg"+exeSuffix())
+ return filepath.Join(paths.RuntimeDir(), "ffmpeg", "ffmpeg"+paths.ExeSuffix())
}
func EnsureFFmpeg() (string, error) {
diff --git a/cli/main.go b/cli/main.go
index d3afbd5..96bd90b 100644
--- a/cli/main.go
+++ b/cli/main.go
@@ -34,6 +34,8 @@ func main() {
doctor()
case "update":
os.Exit(update.Run(Version))
+ case "uninstall":
+ os.Exit(uninstall(args[1:]))
case "setup":
os.Exit(setup(args[1:]))
case "mcp":
@@ -312,6 +314,150 @@ func mcpInstall() int {
return 0
}
+func uninstall(args []string) int {
+ yes, dryRun, purge := false, false, false
+ for _, a := range args {
+ switch a {
+ case "--yes", "-y":
+ yes = true
+ case "--dry-run":
+ dryRun = true
+ case "--purge":
+ purge = true
+ case "--help", "-h":
+ printUninstallHelp()
+ return 0
+ default:
+ fmt.Fprintf(os.Stderr, "podcli: unknown uninstall option %q\n", a)
+ printUninstallHelp()
+ return 2
+ }
+ }
+
+ home := paths.Home()
+ self, _ := os.Executable()
+ managed := filepath.Join(paths.BinDir(), "podcli"+paths.ExeSuffix())
+ if !pathContains(paths.BinDir(), self) {
+ self = ""
+ }
+ targets := uninstallTargets(home, purge)
+ links := podcliLinks(managed, self)
+
+ fmt.Println("podcli uninstall")
+ if purge {
+ fmt.Printf(" This will remove podcli and all managed data under: %s\n", home)
+ } else {
+ fmt.Printf(" This will remove podcli's app files under: %s\n", home)
+ fmt.Println(" Your config, knowledge, presets, assets, history, and cache are kept.")
+ fmt.Println(" Use `podcli uninstall --purge` to remove everything in that folder.")
+ }
+ for _, p := range targets {
+ fmt.Printf(" remove: %s\n", p)
+ }
+ for _, p := range links {
+ fmt.Printf(" unlink: %s\n", p)
+ }
+ if dryRun {
+ fmt.Println("Dry run only — nothing removed.")
+ return 0
+ }
+ if !yes && !confirm("Continue? [y/N] ") {
+ fmt.Println("Cancelled.")
+ return 0
+ }
+
+ for _, p := range links {
+ if err := os.Remove(p); err != nil && !os.IsNotExist(err) {
+ fmt.Fprintf(os.Stderr, " warning: could not remove %s: %v\n", p, err)
+ }
+ }
+ runningInUse := false
+ for _, p := range targets {
+ if err := os.RemoveAll(p); err != nil {
+ if pathContains(p, self) {
+ runningInUse = true
+ }
+ fmt.Fprintf(os.Stderr, " warning: could not remove %s: %v\n", p, err)
+ }
+ }
+ if runningInUse {
+ fmt.Fprintf(os.Stderr, " note: the running binary is still in use and was left in place: %s\n", self)
+ fmt.Fprintln(os.Stderr, " Delete it after this command exits, or run the installer script with --uninstall.")
+ }
+ fmt.Println("Done — podcli app files were removed.")
+ if !purge {
+ fmt.Printf("Kept user data in: %s\n", home)
+ }
+ return 0
+}
+
+func uninstallTargets(home string, purge bool) []string {
+ if purge {
+ return []string{home}
+ }
+ return []string{paths.BinDir(), paths.RuntimeDir(), paths.ModelsDir(), filepath.Join(home, "tools")}
+}
+
+func podcliLinks(managed, self string) []string {
+ // A binary running from outside the managed bin dir is user-installed;
+ // links pointing at it must survive the uninstall.
+ if !pathContains(paths.BinDir(), self) {
+ self = ""
+ }
+ var out []string
+ for _, d := range []string{"/usr/local/bin", filepath.Join(os.Getenv("HOME"), ".local", "bin")} {
+ if d == "/usr/local/bin" && paths.ExeSuffix() == ".exe" {
+ continue
+ }
+ p := filepath.Join(d, "podcli"+paths.ExeSuffix())
+ if linkPointsTo(p, managed) || (self != "" && linkPointsTo(p, self)) {
+ out = append(out, p)
+ }
+ }
+ return out
+}
+
+func pathContains(dir, file string) bool {
+ if file == "" {
+ return false
+ }
+ rel, err := filepath.Rel(filepath.Clean(dir), filepath.Clean(file))
+ return err == nil && rel != ".." && !strings.HasPrefix(rel, ".."+string(filepath.Separator))
+}
+
+func linkPointsTo(link, target string) bool {
+ dest, err := os.Readlink(link)
+ if err != nil {
+ return false
+ }
+ if !filepath.IsAbs(dest) {
+ dest = filepath.Join(filepath.Dir(link), dest)
+ }
+ return filepath.Clean(dest) == filepath.Clean(target)
+}
+
+func confirm(prompt string) bool {
+ fmt.Print(prompt)
+ var s string
+ if _, err := fmt.Scanln(&s); err != nil {
+ return false
+ }
+ s = strings.ToLower(strings.TrimSpace(s))
+ return s == "y" || s == "yes"
+}
+
+func printUninstallHelp() {
+ fmt.Println(`Usage: podcli uninstall [--yes] [--dry-run] [--purge]
+
+Removes podcli's managed binary, runtimes, models, and installer-created links.
+By default, user data (config, knowledge, presets, assets, history, cache) is kept.
+
+Options:
+ -y, --yes Do not prompt for confirmation
+ --dry-run Show what would be removed without deleting anything
+ --purge Remove the entire podcli managed folder, including user data`)
+}
+
func doctor() {
fmt.Printf("podcli %s\n\n", Version)
fmt.Println("Paths")
@@ -414,6 +560,7 @@ Launcher commands:
doctor Show resolved paths, interpreter, backend, ffmpeg, models
version Print version
update Check for and apply a newer release
+ uninstall Remove podcli app files (keeps user data unless --purge)
setup [--model base] [--vad] [--speakers]
Provision runtimes + models (--speakers adds pyannote+torch, ~2GB)
mcp Run the MCP server (stdio) for Claude/Codex
diff --git a/cli/uninstall_test.go b/cli/uninstall_test.go
new file mode 100644
index 0000000..cf887d0
--- /dev/null
+++ b/cli/uninstall_test.go
@@ -0,0 +1,94 @@
+package main
+
+import (
+ "os"
+ "path/filepath"
+ "testing"
+
+ "podcli/internal/paths"
+)
+
+func TestLinkPointsToAbsoluteAndRelativeSymlinks(t *testing.T) {
+ dir := t.TempDir()
+ target := filepath.Join(dir, "target")
+ if err := os.WriteFile(target, []byte("x"), 0o644); err != nil {
+ t.Fatal(err)
+ }
+ absLink := filepath.Join(dir, "abs")
+ if err := os.Symlink(target, absLink); err != nil {
+ t.Skipf("symlink unavailable: %v", err)
+ }
+ if !linkPointsTo(absLink, target) {
+ t.Fatalf("absolute symlink should point to target")
+ }
+ relLink := filepath.Join(dir, "rel")
+ if err := os.Symlink("target", relLink); err != nil {
+ t.Fatal(err)
+ }
+ if !linkPointsTo(relLink, target) {
+ t.Fatalf("relative symlink should point to target")
+ }
+}
+
+func TestUninstallTargetsPreserveUserDataUnlessPurged(t *testing.T) {
+ home := filepath.Join(t.TempDir(), "podcli")
+ got := uninstallTargets(home, false)
+ for _, p := range got {
+ if p == home {
+ t.Fatalf("non-purge uninstall should not remove the whole home: %v", got)
+ }
+ }
+ purged := uninstallTargets(home, true)
+ if len(purged) != 1 || purged[0] != home {
+ t.Fatalf("purge targets = %v, want only %s", purged, home)
+ }
+}
+
+func TestPathContainsDetectsRunningBinaryUnderTarget(t *testing.T) {
+ dir := t.TempDir()
+ bin := filepath.Join(dir, "bin")
+ self := filepath.Join(bin, "podcli")
+ if err := os.MkdirAll(bin, 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(self, []byte("x"), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if !pathContains(bin, self) {
+ t.Fatalf("bin target should contain running binary")
+ }
+ if !pathContains(dir, self) {
+ t.Fatalf("home target should contain running binary")
+ }
+ if pathContains(filepath.Join(dir, "models"), self) {
+ t.Fatalf("sibling target should not contain running binary")
+ }
+}
+
+func TestPodcliLinksPreservesSelfOutsideManagedBin(t *testing.T) {
+ home := t.TempDir()
+ managedHome := filepath.Join(t.TempDir(), "managed")
+ t.Setenv("HOME", home)
+ t.Setenv("USERPROFILE", home)
+ t.Setenv("PODCLI_HOME", managedHome)
+
+ linkDir := filepath.Join(home, ".local", "bin")
+ if err := os.MkdirAll(linkDir, 0o755); err != nil {
+ t.Fatal(err)
+ }
+ self := filepath.Join(t.TempDir(), "custom", "podcli"+paths.ExeSuffix())
+ if err := os.MkdirAll(filepath.Dir(self), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(self, []byte("x"), 0o755); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Symlink(self, filepath.Join(linkDir, "podcli"+paths.ExeSuffix())); err != nil {
+ t.Skipf("symlink unavailable: %v", err)
+ }
+
+ managed := filepath.Join(paths.BinDir(), "podcli"+paths.ExeSuffix())
+ if got := podcliLinks(managed, self); len(got) != 0 {
+ t.Fatalf("podcliLinks should preserve self outside managed bin: %v", got)
+ }
+}
diff --git a/install.ps1 b/install.ps1
index d89591e..a9453ff 100644
--- a/install.ps1
+++ b/install.ps1
@@ -1,12 +1,38 @@
# podcli installer for Windows — downloads the prebuilt native binary (no Go,
# Node, Python, or ffmpeg needed; the binary provisions those on first run).
# Usage: irm https://raw.githubusercontent.com/nmbrthirteen/podcli/main/install.ps1 | iex
+# Uninstall: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/nmbrthirteen/podcli/main/install.ps1))) -Uninstall
+param([switch]$Uninstall)
$ErrorActionPreference = 'Stop'
$repo = 'nmbrthirteen/podcli'
$target = 'windows-amd64'
$homeDir = Join-Path $env:LOCALAPPDATA 'podcli'
$binDir = Join-Path $homeDir 'bin'
+
+if ($Uninstall) {
+ Write-Host "Uninstalling podcli..."
+ foreach ($p in @($binDir, (Join-Path $homeDir 'runtime'), (Join-Path $homeDir 'models'), (Join-Path $homeDir 'tools'))) {
+ if (Test-Path $p) {
+ try {
+ Remove-Item $p -Recurse -Force -ErrorAction Stop
+ Write-Host " removed: $p"
+ } catch {
+ Write-Warning "could not remove $p`: $($_.Exception.Message)"
+ }
+ }
+ }
+ $userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
+ if ($userPath -like "*$binDir*") {
+ $parts = $userPath -split ';' | Where-Object { $_ -and ($_ -ne $binDir) }
+ [Environment]::SetEnvironmentVariable('Path', ($parts -join ';'), 'User')
+ Write-Host " removed from user PATH (restart your terminal)"
+ }
+ Write-Host " kept user data (config, knowledge, presets, assets, history, cache)."
+ Write-Host " To remove everything: Remove-Item '$homeDir' -Recurse -Force"
+ exit 0
+}
+
New-Item -ItemType Directory -Force -Path $binDir | Out-Null
$version = $env:PODCLI_VERSION
diff --git a/install.sh b/install.sh
index 64c2dfc..81c78ff 100755
--- a/install.sh
+++ b/install.sh
@@ -2,6 +2,7 @@
# podcli installer — downloads the prebuilt native binary (no Go, Node, Python,
# or ffmpeg needed; the binary provisions those itself on first run).
# Usage: curl -fsSL https://raw.githubusercontent.com/nmbrthirteen/podcli/main/install.sh | sh
+# Uninstall: curl -fsSL https://raw.githubusercontent.com/nmbrthirteen/podcli/main/install.sh | sh -s -- --uninstall
set -eu
REPO="nmbrthirteen/podcli"
@@ -15,6 +16,35 @@ case "$os" in
Linux) goos=linux; home_dir="${XDG_DATA_HOME:-$HOME/.local/share}/podcli" ;;
*) err "unsupported OS: $os (on Windows use install.ps1)" ;;
esac
+bin_dir="$home_dir/bin"
+
+if [ "${1:-}" = "--uninstall" ]; then
+ echo "Uninstalling podcli…"
+ for d in /usr/local/bin "$HOME/.local/bin"; do
+ link="$d/podcli"
+ if [ -L "$link" ] && [ "$(readlink "$link")" = "$bin_dir/podcli" ]; then
+ if rm -f "$link"; then
+ echo " removed link: $link"
+ else
+ echo " warning: could not remove link: $link" >&2
+ fi
+ fi
+ done
+ for p in "$bin_dir" "$home_dir/runtime" "$home_dir/models" "$home_dir/tools"; do
+ if [ -e "$p" ]; then
+ if rm -rf "$p"; then
+ echo " removed: $p"
+ else
+ echo " warning: could not remove: $p" >&2
+ fi
+ fi
+ done
+ echo " removed app files from: $home_dir"
+ echo " kept user data (config, knowledge, presets, assets, history, cache)."
+ echo " To remove everything: rm -rf '$home_dir'"
+ exit 0
+fi
+
case "$arch" in
x86_64|amd64) goarch=amd64 ;;
arm64|aarch64) goarch=arm64 ;;
@@ -24,7 +54,6 @@ target="${goos}-${goarch}"
if [ "$target" = "darwin-amd64" ]; then
err "Intel Macs aren't supported yet (coming in v2.0.1). Apple Silicon, Linux, and Windows are available."
fi
-bin_dir="$home_dir/bin"
mkdir -p "$bin_dir"
version="${PODCLI_VERSION:-}"
diff --git a/npm/README.md b/npm/README.md
index 5cfa5c1..f03f78d 100644
--- a/npm/README.md
+++ b/npm/README.md
@@ -16,3 +16,6 @@ whisper.cpp, and models, so there is nothing else to install.
Updates: `podcli update` checks for a newer release. Disable auto-update checks
with `podcli config set update.auto off` (or `PODCLI_NO_UPDATE=1`).
+
+Uninstall app files with `podcli uninstall`; it keeps your config, knowledge,
+presets, assets, history, and cache unless you add `--purge`.
diff --git a/public/podcli-icon-transparent.png b/public/podcli-icon-transparent.png
index 8420b9b..b1c990f 100644
Binary files a/public/podcli-icon-transparent.png and b/public/podcli-icon-transparent.png differ
diff --git a/public/podcli-icon.png b/public/podcli-icon.png
index 609d086..bf45f90 100644
Binary files a/public/podcli-icon.png and b/public/podcli-icon.png differ
diff --git a/public/podcli-logo-full.png b/public/podcli-logo-full.png
index dabe271..8b9ee7e 100644
Binary files a/public/podcli-logo-full.png and b/public/podcli-logo-full.png differ
diff --git a/public/podcli-logo-transparent.png b/public/podcli-logo-transparent.png
index e5ad86a..e830a63 100644
Binary files a/public/podcli-logo-transparent.png and b/public/podcli-logo-transparent.png differ
diff --git a/public/promo.gif b/public/promo.gif
index 65d1472..9564bce 100644
Binary files a/public/promo.gif and b/public/promo.gif differ
diff --git a/src/ui/public/podcli-icon-transparent.png b/src/ui/public/podcli-icon-transparent.png
index 8420b9b..b1c990f 100644
Binary files a/src/ui/public/podcli-icon-transparent.png and b/src/ui/public/podcli-icon-transparent.png differ
diff --git a/src/ui/public/podcli-icon.png b/src/ui/public/podcli-icon.png
index 609d086..bf45f90 100644
Binary files a/src/ui/public/podcli-icon.png and b/src/ui/public/podcli-icon.png differ
diff --git a/src/ui/public/podcli-logo-transparent.png b/src/ui/public/podcli-logo-transparent.png
index e5ad86a..e830a63 100644
Binary files a/src/ui/public/podcli-logo-transparent.png and b/src/ui/public/podcli-logo-transparent.png differ