# Uninstall (/docs/v0.4/uninstall)



End every koshi session before removing files. Detaching is not enough: a
detached session is still running.

`koshi list-sessions` also lists the sessions on every saved server that
answers. Only the rows whose `server` column reads `local` run on this machine.

```bash
koshi list-sessions
koshi kill-session <NAME_OR_ID>
```

<Callout type="warn">
  The commands below delete your koshi configuration, saved profiles, and custom
  themes. Copy anything you want to keep out of the config directory first.
</Callout>

<Callout type="warn">
  They also delete the remote data — the saved server secrets, the pinned
  certificates, and the access tokens this machine granted. Revoke the grants
  first if other machines still hold tokens:

  ```bash
  koshi share list
  koshi share revoke <IDENTITY>
  ```
</Callout>

## Linux [#linux]

Remove a script-installed binary:

```bash
sudo rm -f /usr/local/bin/koshi
```

Remove config, logs, crash reports, update state, cached data, runtime files,
and the remote data:

```bash
rm -rf "${XDG_CONFIG_HOME:-$HOME/.config}/koshi"
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/koshi"
rm -rf "${XDG_STATE_HOME:-$HOME/.local/state}/koshi"
rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/koshi"
rm -rf "/tmp/koshi-$(id -u)"
```

## macOS [#macos]

For a script install:

```bash
sudo rm -f /usr/local/bin/koshi
```

For a Homebrew install:

```bash
brew uninstall --force koshi
brew untap gohyuhan/koshi
```

Then remove config, logs, crash reports, update state, cache, runtime files,
and the remote data:

```bash
rm -rf "$HOME/Library/Application Support/koshi"
rm -rf "$HOME/Library/Caches/koshi"
rm -rf "/tmp/koshi-$(id -u)"
```

## Windows [#windows]

For a Scoop install:

```powershell
scoop uninstall koshi
scoop bucket rm koshi
scoop cache rm "koshi*"
```

For a PowerShell-script install, drop the PATH entry and the install directory:

```powershell
$InstallDir = Join-Path $env:LOCALAPPDATA "koshi"
$UserPath = [Environment]::GetEnvironmentVariable(
    "Path",
    [EnvironmentVariableTarget]::User
)
$CleanPath = (($UserPath -split ";") | Where-Object {
    $_ -and $_ -ne $InstallDir
}) -join ";"
[Environment]::SetEnvironmentVariable(
    "Path",
    $CleanPath,
    [EnvironmentVariableTarget]::User
)
Remove-Item $InstallDir -Recurse -Force -ErrorAction SilentlyContinue
```

Then remove what is left, the remote data included:

```powershell
Remove-Item (Join-Path $env:APPDATA "koshi") `
  -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item (Join-Path $env:LOCALAPPDATA "koshi") `
  -Recurse -Force -ErrorAction SilentlyContinue
```
