https://www.x-cmd.com/apk/— an Alpine (apk) package repository hosting the official x-cmd package.
This repository is published verbatim under https://www.x-cmd.com/apk/. Add
that URL to /etc/apk/repositories and apk can install x-cmd natively on
Alpine Linux.
The package is built and released upstream at
x-cmd/release; this repo only mirrors the
.apk artifact and maintains the APKINDEX.tar.gz indices.
# 1. Enable the repository (unsigned for now → use --allow-untrusted)
echo "https://www.x-cmd.com/apk/" | sudo tee -a /etc/apk/repositories
# 2. Install x-cmd
sudo apk update
sudo apk add --allow-untrusted x-cmdVerify:
x --version--allow-untrusted is needed until the signing key is published to
/etc/apk/keys (see Notes).
apk fetches the index from <repo>/<client-arch>/APKINDEX.tar.gz and the
package from <repo>/<package-arch>/<file>. The x-cmd package is
Architecture: noarch, so:
- the package file lives once under
noarch/(every client downloads it from there), and - the same index is placed under each client architecture so any client can discover it.
.
├── noarch/
│ ├── x-cmd-0.9.9-r0.apk # the package (single copy)
│ └── APKINDEX.tar.gz # canonical index generated from it
├── x86_64/APKINDEX.tar.gz # ┐
├── aarch64/APKINDEX.tar.gz # │
├── armhf/APKINDEX.tar.gz # │ same index, copied per client arch
├── armv7/APKINDEX.tar.gz # │ so x86_64 / aarch64 / ... clients all find it
├── x86/APKINDEX.tar.gz # │
├── ppc64le/APKINDEX.tar.gz # │
├── s390x/APKINDEX.tar.gz # │
└── riscv64/APKINDEX.tar.gz # ┘
Filename matters. apk reconstructs the download name as
<pkgname>-<pkgver>.apk(x-cmd-0.9.9-r0.apk), regardless of the source filename. The file innoarch/must use that name.
-
Drop the new
.apkat the repo root (the upstream artifact is namedx-cmd_<ver>_all.apk). Regenerate the index withapk index. macOS has no apk tooling, so run it through an Alpine container (image already cached locally):docker run --rm -v "$PWD:/repo" alpine:latest sh -c ' set -e; cd /repo apk add --no-cache alpine-sdk >/dev/null 2>&1 || true # upstream artifact name -> apk-convention name (pkgname-pkgver.apk) src=$(ls x-cmd_*_all.apk | head -1) ver=$(tar -xOzf "$src" .PKGINFO | sed -n "s/^pkgver = //p") rm -rf noarch x86_64 x86 armhf armv7 aarch64 ppc64le s390x riscv64 mkdir -p noarch mv "$src" "noarch/x-cmd-${ver}.apk" apk index --allow-untrusted -o noarch/APKINDEX.tar.gz noarch/x-cmd-*.apk for a in x86_64 x86 armhf armv7 aarch64 ppc64le s390x riscv64; do mkdir -p "$a"; cp noarch/APKINDEX.tar.gz "$a"/APKINDEX.tar.gz done'
--allow-untrustedis required while indexing because the apk is signed with a key not present in the indexer's keychain. -
Commit
noarch/and the per-archAPKINDEX.tar.gz, then push. The site refreshes from this branch.
- Unsigned phase. Both the index and the package are signed with x-cmd's
key, which is not yet published; clients therefore need
--allow-untrusted. Once the public key is shipped (drop it in/etc/apk/keys/and signAPKINDEX.tar.gz→APKINDEX.tar.gz.sig), the--allow-untrustedcan be dropped. - Architectures served:
x86_64,x86,armhf,armv7,aarch64,ppc64le,s390x,riscv64(all read the same noarch package). Add a new client arch by copyingAPKINDEX.tar.gzinto a new<arch>/directory. - Build provenance and source live in x-cmd/release.
- Companion repositories: x-cmd/rpm (
/rpm/), x-cmd/deb (/deb/), x-cmd/pacman (/pacman/).