# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           npm 1.0

name                opencode
version             2.2.0
revision            0

categories          llm
platforms           {darwin any >= 22}
maintainers         @oakimov \
                    {breun @breun} \
                    openmaintainer
license             MIT
supported_archs     x86_64 arm64

description         OpenCode, an open source AI coding agent
long_description    OpenCode is an open source AI coding agent. This port \
                    tracks the OpenCode 2.x line.\
                    \n\
                    \n- Terminal-based interface for AI-assisted coding\
                    \n- Built-in support for many LLM providers via /connect\
                    \n- Configurable agents, models, skills, tools, and themes\
                    \n- Extensible with plugins, MCP servers, and custom commands\
                    \n\
                    \nMigration from 1.x: https://opencode.ai/v2/docs/migrate-v1/

homepage            https://opencode.ai/v2/docs

npm.rootname        @opencode/cli
distname            cli-${version}

checksums           rmd160  730ba38b9ed376c17900a055d2c53d66f7e73b22 \
                    sha256  aa342466d0df60d61b87d09b1ed5138a53506bad0c6e5f6134d8237b4d40ded5 \
                    size    2946

conflicts           opencode1

# @opencode/cli also ships an opencode2 binary; keep only the unversioned name.
post-destroot {
    delete ${destroot}${prefix}/bin/opencode2
}
