Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
name: Publish AUR package

# See packaging/aur/README.md.

on:
workflow_call:
inputs:
release_tag:
required: true
type: string
pkgrel:
required: false
default: "1"
type: string
secrets:
AUR_SSH_PRIVATE_KEY:
required: true
workflow_dispatch:
inputs:
release_tag:
description: "Release tag to publish"
required: true
type: string
pkgrel:
description: "Arch package release override"
required: false
default: "1"
type: string

permissions:
contents: read

concurrency:
group: publish-aur
cancel-in-progress: false

jobs:
publish:
name: Validate and publish
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
container:
image: archlinux:base-devel

steps:
- name: Install Arch packaging tools
run: pacman -Syu --noconfirm --needed git github-cli jq namcap openssh sudo

- name: Checkout packaging sources
uses: actions/checkout@v6

- name: Create unprivileged build user
run: |
useradd --create-home builder
install -Dm0440 /dev/stdin /etc/sudoers.d/builder <<'EOF'
builder ALL=(root) NOPASSWD: /usr/bin/pacman
EOF

- name: Validate and publish package sources
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
PKGREL: ${{ inputs.pkgrel || '1' }}
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
run: packaging/aur/scripts/release.sh
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -856,6 +856,16 @@ jobs:
fail_on_unmatched_files: true
token: ${{ github.token }}

publish_aur:
name: Publish AUR package
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
uses: ./.github/workflows/publish-aur.yml
with:
release_tag: ${{ needs.preflight.outputs.tag }}
secrets:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}

deploy_web:
name: Deploy hosted web app
needs: [preflight, relay_public_config, release]
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,10 +51,20 @@ brew install --cask t3-code

#### Arch Linux (AUR)

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).

## Some notes

We are very very early in this project. Expect bugs.
Expand Down
8 changes: 8 additions & 0 deletions docs/user/install.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,10 +37,18 @@ brew install --cask t3-code

Arch Linux:

Stable:

```bash
yay -S t3code-bin
```

Nightly:

```bash
yay -S t3code-nightly-bin
```

## Providers

T3 Code drives provider CLIs; it does not ship them. Install the CLI for each provider you want
Expand Down
9 changes: 9 additions & 0 deletions packaging/aur/.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
src/
pkg/
*.AppImage
*.pkg.tar.zst
.SRCINFO
t3code-bin-*.png
t3code-bin-*-LICENSE
t3code-nightly-bin-*.png
t3code-nightly-bin-*-LICENSE
20 changes: 20 additions & 0 deletions packaging/aur/README.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
# AUR packaging

This directory maintains the [`t3code-bin`](https://aur.archlinux.org/packages/t3code-bin) and
[`t3code-nightly-bin`](https://aur.archlinux.org/packages/t3code-nightly-bin) packages. Both
repackage the official x86_64 AppImage from GitHub Releases.

## Publishing

The release workflow calls `.github/workflows/publish-aur.yml` after publishing a GitHub release;
the workflow can also be run manually for a specific tag. It selects the stable or nightly
package, then updates its version and checksums, builds it, regenerates `.SRCINFO`, and pushes it
to the AUR.

To validate a release on Arch Linux:

```bash
sudo pacman -Syu --needed base-devel github-cli jq namcap
GH_TOKEN=$(gh auth token) RELEASE_TAG=v0.0.33 \
packaging/aur/scripts/release.sh
```
97 changes: 97 additions & 0 deletions packaging/aur/scripts/release.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
repo='pingdotgg/t3code'
tag="${RELEASE_TAG:?RELEASE_TAG is required}"
pkgrel="${PKGREL:-1}"

if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pkgname='t3code-bin'
icon_path='assets/prod/black-universal-1024.png'
elif [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9]+$ ]]; then
pkgname='t3code-nightly-bin'
icon_path='assets/nightly/nightly-universal-1024.png'
else
echo "Release $tag does not publish an AUR package."
exit 0
fi

version="${tag#v}"
pkgver="${version//-/_}"
asset_name="T3-Code-${version}-x86_64.AppImage"
release_json="$(gh api "repos/$repo/releases/tags/$tag")"
asset_digest="$(jq -r --arg name "$asset_name" \
'.assets[] | select(.name == $name) | .digest' <<<"$release_json")"
appimage_sha256="${asset_digest#sha256:}"

if [[ ! "$appimage_sha256" =~ ^[0-9a-f]{64}$ ]]; then
echo "Release $tag is missing $asset_name or its SHA-256 digest." >&2
exit 1
fi

work_dir="$(mktemp -d)"
trap 'rm -rf -- "$work_dir"' EXIT
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/$icon_path?ref=$tag" > "$work_dir/icon.png"
gh api -H 'Accept: application/vnd.github.raw' \
"repos/$repo/contents/LICENSE?ref=$tag" > "$work_dir/LICENSE"
icon_sha256="$(sha256sum "$work_dir/icon.png" | awk '{print $1}')"
license_sha256="$(sha256sum "$work_dir/LICENSE" | awk '{print $1}')"

package_dir="$repo_root/packaging/aur/$pkgname"
cd "$package_dir"
sed -Ei \
-e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=$pkgrel/" \
-e "/# AppImage$/s/'[0-9a-f]{64}'/'$appimage_sha256'/" \
-e "/# icon$/s/'[0-9a-f]{64}'/'$icon_sha256'/" \
-e "/# upstream license$/s/'[0-9a-f]{64}'/'$license_sha256'/" \
PKGBUILD

run_as_builder() {
if [[ "$(id -u)" == 0 ]]; then
runuser -u builder -- "$@"
else
"$@"
fi
}

if [[ "$(id -u)" == 0 ]]; then
chown -R builder:builder "$package_dir"
fi
run_as_builder namcap PKGBUILD
run_as_builder makepkg --printsrcinfo > .SRCINFO
run_as_builder makepkg --syncdeps --cleanbuild --clean --noconfirm
run_as_builder namcap "$(run_as_builder makepkg --packagelist)"

if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
echo 'AUR_SSH_PRIVATE_KEY is not set; build complete, skipping publish.'
exit 0
fi

key_file="$work_dir/id_ed25519"
known_hosts_file="$work_dir/known_hosts"
aur_dir="$work_dir/$pkgname"
printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' \
'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' \
> "$known_hosts_file"
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$known_hosts_file -o StrictHostKeyChecking=yes"

git clone "ssh://aur@aur.archlinux.org/$pkgname.git" "$aur_dir"
cp PKGBUILD .SRCINFO "$aur_dir/"
cd "$aur_dir"
git rm --ignore-unmatch LICENSE .upstream-commit t3code-icon.png
git config user.name 't3code-ci'
git config user.email 't3code-ci@users.noreply.github.com'
git add -A

if git diff --cached --quiet; then
echo 'AUR package is already up to date.'
exit 0
fi

git commit -m "$pkgname: update to $pkgver-$pkgrel"
git push origin HEAD:master
101 changes: 101 additions & 0 deletions packaging/aur/t3code-bin/PKGBUILD
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
# Maintainer: maria-rcks <maria at kuuro dot net>

pkgname=t3code-bin
pkgver=0.0.33
pkgrel=1
pkgdesc='Desktop control surface for local coding agents'
arch=('x86_64')
url='https://github.com/pingdotgg/t3code'
license=('MIT')
depends=(
'alsa-lib'
'at-spi2-core'
'cairo'
'dbus'
'expat'
'gdk-pixbuf2'
'glib2'
'glibc'
'gtk3'
'hicolor-icon-theme'
'libcups'
'libdrm'
'libgcc'
'libstdc++'
'libx11'
'libxcb'
'libxcomposite'
'libxdamage'
'libxext'
'libxfixes'
'libxkbcommon'
'libxrandr'
'mesa'
'nspr'
'nss'
'pango'
'systemd-libs'
'xdg-utils'
'zlib'
)
optdepends=('openai-codex: use the system-installed Codex CLI')
provides=("t3code=$pkgver")
conflicts=('t3code')
options=('!debug' '!strip')

_appimage="T3-Code-${pkgver}-x86_64.AppImage"
source=(
"$_appimage::https://github.com/pingdotgg/t3code/releases/download/v${pkgver}/$_appimage"
"${pkgname}-${pkgver}.png::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/assets/prod/black-universal-1024.png"
"${pkgname}-${pkgver}-LICENSE::https://raw.githubusercontent.com/pingdotgg/t3code/v${pkgver}/LICENSE"
)
sha256sums=(
'415c8648f43c3d22d572f27f2c50fdc8c310ea7fcde9537b903e1e2f1c8775a1' # AppImage
'403e874556ffbecee8d1b2b5d612a874303fac791212a261bb3bd1b71d83e78d' # icon
'935d8f2af0c703f9c39517ee57cc4930b19d02d533be930b63f0e82f93614b43' # upstream license
)

prepare() {
chmod +x "$srcdir/$_appimage"
rm -rf "$srcdir/squashfs-root"
"$srcdir/$_appimage" --appimage-extract >/dev/null

if [[ ! -x "$srcdir/squashfs-root/AppRun" ||
! -f "$srcdir/squashfs-root/chrome-sandbox" ]]; then
echo 'The AppImage payload is missing its launcher or Chromium sandbox.' >&2
return 1
fi
}

package() {
install -d "$pkgdir/opt/$pkgname"
cp -a --no-preserve=ownership "$srcdir/squashfs-root/." "$pkgdir/opt/$pkgname/"
chmod -R u=rwX,go=rX "$pkgdir/opt/$pkgname"
chmod 4755 "$pkgdir/opt/$pkgname/chrome-sandbox"

install -Dm755 /dev/stdin "$pkgdir/usr/bin/t3code" <<'EOF'
#!/bin/sh
exec /opt/t3code-bin/AppRun "$@"
EOF
ln -s t3code "$pkgdir/usr/bin/t3-code-desktop"

install -Dm644 "$srcdir/${pkgname}-${pkgver}.png" \
"$pkgdir/usr/share/icons/hicolor/1024x1024/apps/t3code.png"

install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/t3code.desktop" <<'EOF'
[Desktop Entry]
Name=T3 Code
Comment=Desktop control surface for local coding agents
Exec=t3code %U
TryExec=t3code
Terminal=false
Type=Application
Icon=t3code
StartupWMClass=t3code
Categories=Development;
MimeType=x-scheme-handler/t3code;
EOF

install -Dm644 "$srcdir/${pkgname}-${pkgver}-LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
Loading
Loading