Metadata-Version: 2.4
Name: seika-oc
Version: 0.3.0
Summary: One-command OpenCode installer for Termux (pkg update/upgrade + install script + verification)
Author: bd-loser
License-Expression: MIT
Project-URL: Homepage, https://github.com/bd-loser/opencode-bionic
Keywords: opencode,termux,installer,cli
Classifier: Environment :: Console
Classifier: Operating System :: Android
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# oc — OpenCode installer for Termux

`oc` is a small CLI that keeps Termux packages updated and installs/updates
OpenCode from [bd-loser/opencode-bionic](https://github.com/bd-loser/opencode-bionic)
in a single command.

Nothing runs at `pip install` time — the steps execute only when **you** run `oc`.

## What it does

```bash
pkg update && pkg upgrade -y
curl -fsSL https://raw.githubusercontent.com/bd-loser/opencode-bionic/main/install.sh | bash
opencode --version
```

## Install

```bash
pip install ./seika-oc   # local
pip install seika-oc     # from PyPI (after publishing)
```

## Usage

```bash
oc              # smart: installs if missing, updates if outdated, else says "up to date"
oc -y           # same, without the confirmation prompt
oc --check      # show installed vs latest version (no changes)
oc --force      # reinstall even if already up to date
oc --skip-upgrade  # skip the pkg update/upgrade step (faster)
```

Version check: `oc` compares the installed `opencode --version` against the
latest stable release tag from the GitHub API and only re-runs the installer
when an update is actually available.

## Session safety

Before any update/reinstall, `oc` snapshots your opencode data
(`~/.local/share/opencode/*.db` via the SQLite backup API — WAL included —
plus the legacy `storage/` folder) to
`~/.local/share/oc-backups/sessions-<timestamp>/`.

- The update runs only after a successful backup.
- If the installer fails, the exit code, last output lines and full log path
  are printed, and the backup is kept.
- After a successful update, any session files missing from the new install
  are merged back from the backup (newer files are never overwritten).
- The last 5 session backups are kept; older ones are pruned.
