diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06ff111..17f49f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,3 +82,15 @@ jobs: [ -z "${_WARNINGS}" ] || exit 1 - run: echo "🍏 Job status ${{ job.status }}" + + - name: Snap TUI + env: + TERM: xterm-256color + run: | + # Make sure the interactive TUI starts and keeps running (timeout exits 124) # + _RC=0 + script -qec "timeout 30 codex" /dev/null >tui.log 2>&1 || _RC=$? + [ "${_RC}" -eq 124 ] || cat tui.log + [ "${_RC}" -eq 124 ] || exit 1 + + - run: echo "🍏 Job status ${{ job.status }}" diff --git a/snap/local/etc/codex/config.toml b/snap/local/etc/codex/config.toml new file mode 100644 index 0000000..4a2bad0 --- /dev/null +++ b/snap/local/etc/codex/config.toml @@ -0,0 +1,8 @@ +# Snap defaults, loaded from /etc/codex/config.toml. +# This is the lowest precedence layer, so ~/snap/codex/current/config.toml overrides it. + +[features] +# The shared background daemon only runs from an upstream packaged install +# (codex-package.json layout) and self updates outside of snapd. +# Without this the TUI exits with "this CLI has no complete local package". +daemon_auto_start = false diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7650240..8347dbb 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -87,6 +87,15 @@ parts: after: - codex + # Snap wide defaults, read by codex as its lowest precedence system config # + defaults: + plugin: dump + source: snap/local + +layout: + /etc/codex: + bind: $SNAP/etc/codex + apps: codex: command: bin/codex