Default tmcodex to unix remote

This commit is contained in:
2026-05-20 14:37:08 -07:00
parent f3a10e0b66
commit aed4d24ae7

View File

@@ -24,6 +24,19 @@ function _tmcodex_resolve_dir {
cd -- "$dir" && pwd -P
}
function _tmcodex_has_remote_arg {
while [ "$#" -gt 0 ]; do
case "$1" in
--remote|--remote=*)
return 0
;;
esac
shift
done
return 1
}
function tmcodex {
launch_dir="$PWD"
@@ -69,7 +82,11 @@ function tmcodex {
(
cd -- "$launch_dir" || exit
trw codex --dangerously-bypass-approvals-and-sandbox --cd "$launch_dir" "$@"
if _tmcodex_has_remote_arg "$@"; then
trw codex --dangerously-bypass-approvals-and-sandbox --cd "$launch_dir" "$@"
else
trw codex --remote "${TMCODEX_REMOTE:-unix://}" --dangerously-bypass-approvals-and-sandbox --cd "$launch_dir" "$@"
fi
)
}