Skip to content

Instantly share code, notes, and snippets.

View InfinityMod's full-sized avatar
🎯
Focusing

David InfinityMod

🎯
Focusing
View GitHub Profile
@InfinityMod
InfinityMod / codex-chat-ipc.mjs
Last active May 10, 2026 07:31
Codex IPC Tool
#!/usr/bin/env node
/*
* Codex chat IPC helper for listing, reading, and sending turns to Codex
* desktop conversations from external continuation tools.
*
* Creator: David Ziegler
* Copyright (c) 2026 David Ziegler
* SPDX-License-Identifier: MIT
*/
import fs from 'node:fs';
#!/usr/bin/sh
file="$1"
lang_filter="s/.*--aid=\([0-9]*\) --alang=\([^ ]* .*\)/\1: \2/p"
languages=$(mpv "$file" --end=0.0 | sed -n "$lang_filter")
language_cnt=$(echo $languages | wc -l)+1
echo "Languages:"
echo "$languages"
[[ -z "$2" ]] && read -p "Enter left ear language number: " stream1 || stream1="$2"