{"id":51846081,"url":"https://github.com/wr/apple-ii-terminal-for-codex","last_synced_at":"2026-07-23T12:30:28.114Z","repository":{"id":371614223,"uuid":"1300971483","full_name":"wr/apple-ii-terminal-for-codex","owner":"wr","description":"A terminal app for Codex that runs natively on Apple IIe, IIe+, IIc, and IIgs.","archived":false,"fork":false,"pushed_at":"2026-07-15T21:30:16.000Z","size":5404,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-15T23:22:19.056Z","etag":null,"topics":["6502","65816","ai","apple-ii","apple-iigs","apple2","apple2gs","codex","retrocomputing","terminal","vintage-computers"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.md","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-07-14T21:51:16.000Z","updated_at":"2026-07-15T21:30:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wr/apple-ii-terminal-for-codex","commit_stats":null,"previous_names":["wr/apple-ii-terminal-for-codex"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wr/apple-ii-terminal-for-codex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wr%2Fapple-ii-terminal-for-codex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wr%2Fapple-ii-terminal-for-codex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wr%2Fapple-ii-terminal-for-codex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wr%2Fapple-ii-terminal-for-codex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wr","download_url":"https://codeload.github.com/wr/apple-ii-terminal-for-codex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wr%2Fapple-ii-terminal-for-codex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35802930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-23T02:00:06.683Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6502","65816","ai","apple-ii","apple-iigs","apple2","apple2gs","codex","retrocomputing","terminal","vintage-computers"],"created_at":"2026-07-23T12:30:27.435Z","updated_at":"2026-07-23T12:30:28.090Z","avatar_url":"https://github.com/wr.png","language":"Python","funding_links":["https://www.buymeacoffee.com/wellsworkshop","https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=%E2%98%95\u0026slug=wellsworkshop\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Arial\u0026outline_colour=000000\u0026coffee_colour=ffffff"],"categories":[],"sub_categories":[],"readme":"# Apple II Terminal for Codex\n\n[▶️ Build video](https://www.youtube.com/watch?v=6VsCheEJMIk)\n\nA real Apple II, as a terminal for Codex.\n\nBoot a 140K floppy, dial a WiFi modem, and your Apple II becomes a terminal for the real `codex` CLI, bridged from a modern machine. The disk image boots every model from the IIgs down to the II+ (or an emulator).\n\nThe backend is the actual agentic Codex CLI. The clients are bare-metal 65816 and 6502 programs that draw the whole interface themselves from a tiny 7-bit ASCII protocol. A IIgs gets a monochrome Super Hi-Res client with an animated `\u003e_` splash, scrolling transcript, Codex-style header, and Working shimmer; a IIe, IIc, IIc Plus, or II+ gets a text-mode client from the same disk.\n\nPress **Connect** and it plays the 1986 dial-up soundscape: dial tone, touch-tones that spell `C-O-D-E-X` on the keypad, ring, answer tone, and carrier buzz.\n\n\u003ca href=\"https://www.buymeacoffee.com/wellsworkshop\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=%E2%98%95\u0026slug=wellsworkshop\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Arial\u0026outline_colour=000000\u0026coffee_colour=ffffff\" /\u003e\u003c/a\u003e\n\n## Apple II instructions\n\n### Prerequisites:\n\n1. An Apple II (IIgs down to the II+ -- see [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md) for the tested-model matrix)\n2. A Hayes-compatible modem such as the [WiModem 232 Pro](https://www.cbmstuff.com/index.php?route=product/product\u0026path=59_66\u0026product_id=113), or a serial connection to your modern computer\n3. [FloppyEmu](https://www.bigmessowires.com/floppy-emu/) or another way to write a `.dsk` image to a floppy\n4. [Codex CLI](https://github.com/openai/codex) 0.144.1 or newer, installed and logged in on your modern computer\n5. **CODEX.dsk**, from [Releases](https://github.com/wr/apple-ii-terminal-for-codex/releases) (or built from source below)\n\n### Setup:\n\n1. **Bridge**, on the computer with the `codex` CLI:\n\n   ```sh\n   git clone https://github.com/wr/apple-ii-terminal-for-codex\n   cd apple-ii-terminal-for-codex\n   python3 -m pip install -r bridge/requirements.txt\n   python3 bridge/bridge.py --telnet --app --workdir /absolute/path/to/your-project\n   ```\n\n   `--workdir` is the existing Git repository Codex works in. The default sandbox is `workspace-write`; use `--sandbox read-only` when the Apple II should inspect the repository without changing it. Codex runs with `approval_policy=never` because the Apple II cannot answer an invisible host approval dialog. Work outside the selected sandbox fails closed.\n\n   The bridge listens on TCP port 6401. When an unpaired source IP first connects, the bridge creates a six-character code and prints it only on its own console. The native client exchanges that code for a bearer token. The 8-bit client stores the token on its boot disk; the IIgs keeps it in RAM for the current boot. The host stores only the token's SHA-256 hash, first-seen IP, and pairing time. Run with `--clear-paired` to revoke every issued token.\n\n   \u003e **Trusted LAN only.** `--telnet` exposes a shell-capable Codex session to your network. Telnet is plaintext: pairing codes, tokens, prompts, and replies can be captured. Run it only on a home LAN you trust, and never port-forward it or expose it to the public internet. Read [SECURITY.md](SECURITY.md) before enabling `workspace-write`.\n\n   \u003e **What the bridge records.** Every prompt you type from the Apple II prints to the bridge console. Codex owns authentication and may retain its normal local session data. The bridge never receives an API key or your Codex credentials.\n\n2. **Modem**: store the bridge address as phonebook entry 1, then save:\n\n   ```text\n   AT\u0026Z1=192.168.1.50:6401      (your host's LAN IP)\n   AT\u0026W\n   ```\n\n   Connect sends `ATDS=1`. Firmware differs, so another modem may use different store or dial syntax. The boot menu also has a live Hayes AT console for manual setup. A fresh WiModem ships at 300 baud and needs `AT*B9600` once; cables, per-device commands, and the dead-modem checklist are in [docs/MODEM-SETUP.md](docs/MODEM-SETUP.md).\n\n3. **Disk**: copy `CODEX.dsk` to a FloppyEmu SD card in 5.25-inch mode (it boots from slot 6). On macOS, `tools/install-sd.sh` updates an existing image safely; FloppyEmu is sensitive to FAT32 fragmentation. Create a backup before using it.\n\n4. Power on and choose **Connect** from the menu. Enter the pairing code shown on the bridge console when asked, then type.\n\nTo update later, download the new release image and run `tools/install-sd.sh` again. If you want Codex on the reverse of an existing physical disk, follow [docs/PHYSICAL-DISK.md](docs/PHYSICAL-DISK.md).\n\n## Emulator instructions\n\n[KEGS](https://kegs.sourceforge.net/) works well, but any Apple II emulator with serial emulation should work. KEGS needs an Apple IIgs ROM file that you supply.\n\n1. Download **CODEX.dsk** from [Releases](https://github.com/wr/apple-ii-terminal-for-codex/releases).\n2. In KEGS, press **F4**: set **s6d1** to `CODEX.dsk`, then set Serial Port **Slot 2** to **Incoming**. KEGS listens on TCP 6502.\n3. Start the bridge, then reboot the emulator with Ctrl-Command-Reset:\n\n   ```sh\n   git clone https://github.com/wr/apple-ii-terminal-for-codex\n   cd apple-ii-terminal-for-codex\n   python3 -m pip install -r bridge/requirements.txt\n   python3 bridge/bridge.py --connect 127.0.0.1:6502 --app \\\n     --workdir /absolute/path/to/your-project\n   ```\n\n4. Choose **1. Connect** on the boot menu, then type.\n\nFor an emulator that connects to a local listener instead, keep it off the LAN:\n\n```sh\npython3 bridge/bridge.py --telnet --host 127.0.0.1 --app \\\n  --workdir /absolute/path/to/your-project\n```\n\n## Advanced bridge options\n\nThe bridge is one Python script. Pick a transport and, for the native clients, add `--app`. Two commands cover almost everything:\n\n```sh\n# Emulator (KEGS in Incoming mode):\npython3 bridge/bridge.py --connect 127.0.0.1:6502 --app \\\n  --workdir /absolute/path/to/your-project\n\n# Real hardware (WiFi modem listening):\npython3 bridge/bridge.py --telnet --app \\\n  --workdir /absolute/path/to/your-project\n```\n\n**Transport** (choose one):\n\n| Flag | Use |\n|---|---|\n| `--connect HOST:PORT` | Dial out to a listening emulator (KEGS Incoming uses port 6502) |\n| `--telnet` | Listen for a WiFi modem (port 6401) |\n| `--serial PORT` | Use a direct serial cable, such as `/dev/tty.usbserial-1420` |\n\n**Codex:**\n\n| Flag | Use |\n|---|---|\n| `--workdir DIR` | Existing Git repository Codex may work in; required |\n| `--sandbox workspace-write\\|read-only` | Set Codex's filesystem boundary |\n| `--model ID` | Override the Codex model |\n| `--codex-bin PATH` | Use a specific Codex executable |\n\n**Native client:**\n\n| Flag | Use |\n|---|---|\n| `--app` | Native-client protocol; required for the clients on `CODEX.dsk` |\n| `--cols 40\\|80` | Screen width (default 80) |\n\n**Pairing** (`--telnet` only):\n\n| Flag | Use |\n|---|---|\n| `--pair-code CODE` | Fix one shared case-insensitive code for every caller |\n| `--clear-paired` | Revoke every stored device token at startup |\n| `--no-pair` | Remove the gate entirely; isolated networks only |\n| `--host ADDR` | Bind address; use `127.0.0.1` to keep it local |\n\nRun `python3 bridge/bridge.py --help` for flow control, pacing, telnet negotiation, and the remaining options.\n\n## Generic terminal app instructions\n\nRun the bridge without `--app` and it speaks ordinary 40/80-column text. Any Apple II with a terminal program, or a stock IIc using its firmware terminal over serial, can talk to Codex without installing a native client. Wiring, pinouts, and per-machine settings are in [apple2/TERMINAL-SETUP.md](apple2/TERMINAL-SETUP.md).\n\n## Codex slash commands\n\nThe bridge handles `/help`, `/new` or `/clear`, `/model NAME`, and `/quit` or `/exit`. Esc or Ctrl-C during **Working** cancels the Codex subprocess and returns any partial reply. Ctrl-C at an idle prompt returns to the menu.\n\n## Building from source\n\nYou do not need this to run it; the release disk is prebuilt. To hack on it you need [cc65](https://cc65.github.io/) (`brew install cc65`), [dos33fsprogs](https://github.com/deater/dos33fsprogs), and Python 3. Point `DOS33FSPROGS` at the disk-tool checkout:\n\n```sh\nDOS33FSPROGS=/path/to/dos33fsprogs ./apple2gs/build.sh\nDOS33FSPROGS=/path/to/dos33fsprogs ./tools/check-release-disk.sh\n```\n\n`build.sh` starts from a pristine Apple DOS 3.3 System Master and injects both clients plus a machine-detecting `HELLO`. The result is a reproducible 143,360-byte `apple2gs/CODEX.dsk` containing `CODEX` for the IIgs and `CODEX8` for 8-bit machines. The master is vendored at `apple2gs/dos33-master-jan83.dsk`; it is Apple's OS, not ours. See [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).\n\nGenerated assets use the Python standard library. The optional screen preview needs Pillow:\n\n```sh\npython3 -m pip install Pillow\ncd apple2gs\npython3 preview.py assets.inc preview.png\n```\n\nThe 8-bit client has its own MAME harness: an emulated Super Serial Card maps to a TCP socket and Lua drives the boot, dial, session, and reply loop unattended.\n\n## Credits\n\nThis project is derived from [Apple II Terminal for Claude Code](https://github.com/wr/apple-ii-terminal-for-claude-code). It is not affiliated with or endorsed by OpenAI.\n\n- **Font:** [UNSCII](http://viznut.fi/unscii/) by Viljami Salminen (CC0)\n- **Disk tooling:** [dos33fsprogs](https://github.com/deater/dos33fsprogs) by Vince Weaver\n- **Emulators:** [KEGS](https://kegs.sourceforge.net/) and MAME\n- The Apple II community... Apple II forever!\n\nMIT license, covering this project's own code only. The build and release disk also include third-party material. Provenance and status for each are in [NOTICE.md](NOTICE.md) and [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwr%2Fapple-ii-terminal-for-codex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwr%2Fapple-ii-terminal-for-codex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwr%2Fapple-ii-terminal-for-codex/lists"}