Dev kpkg

kpkg — Universal Package Manager

  • *rea:*Developer Platform
  • *ath:*dev/kpkg
  • *ind:*CLI tool + Go library
  • *ersion:*0.5.3

Role in the stack

kpkg is the toolchain for packaging, distributing, and installing Koder apps across all platforms. It defines the .kpkg format — a bootstrapprepended ZIP that is selfexecutable on Linux/macOS — and provides the installer library consumed by khub (the Koder Hub CLI) and future tooling.

The design follows the aptdpkg model: one library (`dev.koder.kpkginstaller`), multiple consumers, no subprocess duplication.

*ey capabilities:*

  • *kpkg build** — assembles .kpkg from a manifest + platform payload directories; exports .deb, .rpm, .AppImage, .msix` via external toolchains
  • *kpkg build -rombundle`*— packs a prebuilt Flutter bundle without rerunning build_cmd; used by CI (`koderrelease action) to produce .kpkg alongside tar.gz`
  • *kpkg install** — extracts the platform payload, creates symlinks, and registers OS launchers (Linux .desktop, macOS .app stub, Windows Start Menu .lnk`)
  • *kpkg publish** — signs with the developer's Koder ID ed25519 key and uploads to the Koder Hub via POST apiv1publishslug`
  • *ublic library packages*— dev.koder.kpkg/installer and dev.koder.kpkg/manifest can be imported by any Go module; avoids reimplementing install logic in each consumer

Install paths by OS

OS Payload prefix Bin symlink Launcher
Linux /opt/koder/<slug>/ (or ~/.local/opt/koder/<slug>/ unprivileged) /usr/local/bin/<name> dev.koder.<slug>.desktop + hicolor icon
macOS ~/.local/opt/koder/<slug>/ ~/.local/bin/<name> ~/Applications/<Name>.app stub with Info.plist
Windows %APPDATA%koder<slug> Start Menu .lnk via PowerShell WScript.Shell

.kpkg format

<bootstrap shell script>
PK... (ZIP archive)
├── kpkg.toml          — manifest
├── icon.png           — 512×512 app icon
├── screenshots/       — optional
├── assets/            — optional
├── linux-amd64/       — platform payload (entry point = kpkg.toml [platforms] value)
├── macos-arm64/
├── win-x64/
└── kpkg.sig           — ed25519 signature (optional, warns if absent)

The bootstrap executes on chmod +x && ./app.kpkg: detects OS/arch, unzips the matching platform dir to a tempdir, and execs the entry point. If koder-hub is in PATH, it delegates to the Store installer instead.

Primary couplings

Module Relationship
products/dev/store/cli (khub) Imports dev.koder.kpkg/installer for .kpkg installs
products/dev/kterm/app Has kpkg.toml; built and packaged by kpkg CI
products/dev/store/app Has kpkg.toml; kpkg packages the Store itself
.gitea/actions/koder-release Calls kpkg build --from-bundle in Linux build step
meta/docs/stack/specs/kpkg/format.kmd Normative format spec
meta/docs/stack/specs/releases/packaging.kmd Format hierarchy: .kpkg primary > .deb/.rpm > tar.gz

Source: ../home/koder/dev/koder/meta/docs/stack/modules/dev-kpkg.md