Package Details: opencode-git 1.14.48.r38.gcddab63-1

Git Clone URL: https://aur.archlinux.org/opencode-git.git (read-only, click to copy)
Package Base: opencode-git
Description: The open source coding agent
Upstream URL: https://github.com/anomalyco/opencode
Licenses: MIT
Conflicts: opencode
Provides: opencode
Submitter: robertfoster
Maintainer: pngdeity
Last Packager: pngdeity
Votes: 0
Popularity: 0.000000
First Submitted: 2025-09-07 13:46 (UTC)
Last Updated: 2026-05-11 17:42 (UTC)

Dependencies (10)

Required by (27)

Sources (2)

Latest Comments

thotypous commented on 2026-04-25 15:26 (UTC)

pkgname='opencode-git'
pkgver=1.14.25.r7.g62651c7
options=('!debug' '!strip')
pkgrel=1
pkgdesc='The AI coding agent built for the terminal.'
url='https://github.com/sst/opencode'
arch=('aarch64' 'x86_64')
license=('MIT')
provides=('opencode')
conflicts=('opencode' 'opencode-bin')
depends=('fzf' 'git' 'ripgrep')
makedepends=('bun>=1.3.13' 'git')

source=(
  "${pkgname%%-git}::git+${url}.git"
  'models.dev-api.json::https://models.dev/api.json'
)
sha256sums=('SKIP' 'SKIP')

_target_arch() {
  case "${CARCH}" in
    x86_64)
      printf 'x64\n'
      ;;
    aarch64)
      printf 'arm64\n'
      ;;
    *)
      printf 'Unsupported architecture: %s\n' "${CARCH}" >&2
      return 1
      ;;
  esac
}

pkgver() {
  cd "${pkgname%%-git}"
  local version tag base rev hash

  version=$(sed -n 's/^[[:space:]]*"version": "\([^"]*\)",$/\1/p' packages/opencode/package.json | head -n1)
  tag="v${version}"
  base=$(git merge-base HEAD "${tag}")
  rev=$(git rev-list --count "${base}..HEAD")
  hash=$(git rev-parse --short=7 HEAD)

  printf '%s.r%s.g%s\n' "${version}" "${rev}" "${hash}"
}

prepare() {
  cd "${pkgname%%-git}"
  bun install --frozen-lockfile
}

build() {
  cd "${pkgname%%-git}"
  MODELS_DEV_API_JSON="${srcdir}/models.dev-api.json" \
    bun run --cwd packages/opencode build --single --skip-install
}

package() {
  local target

  cd "${pkgname%%-git}"
  target="$(_target_arch)"

  install -Dm755 \
    "packages/opencode/dist/opencode-linux-${target}/bin/opencode" \
    "${pkgdir}/usr/bin/opencode"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

daweiy commented on 2026-04-15 06:28 (UTC)

The upstream project has transitioned to using a pre-compiled TUI core provided via the @opentui/core Bun package, and the build process is now managed by a TypeScript script (packages/opencode/script/build.ts) using Bun.build.