Skip to content
bearbakerPublic

About

Candy for iPhone: unofficial iOS controller for OpenCode (SwiftUI)

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

40 Commits

Folders and files

Repository files navigation

Candy for iPhone

Code in Hindi, Hinglish or English, from your iPhone, on your own laptop.

Candy is an unofficial remote for OpenCode, the coding agent that runs on your PC. You speak or type what you want, and the agent on your laptop writes the code, runs the tests and reports back. Your code stays on your PC.

Candy is an unofficial app. It isn't made by or affiliated with the OpenCode team.

Download on the App Store · iOS 17 or later


Why another remote?

I built this for a hackathon because I wanted local-language support, which the official OpenCode mobile app and Hex don't have. Along the way it picked up a few other things I wanted:

  • Hinglish and Hindi voice, not just English.
  • Fast screenshots. Candy runs a small capture script on your PC through OpenCode, so it doesn't wait for the model to take the picture. The screenshot lands straight in the chat. (If the script can't run, it falls back to asking the agent.)
  • Call Candy, a hands-free voice mode that works with AirPods and Bluetooth calling watches.

What's in it

  • Pairing by QR code, link, code or password
  • Sessions: list, search, create, delete, move to another project
  • Streaming chat with tool calls, reasoning and interrupt
  • Pick the model and effort right in the chat
  • Permission prompts: Allow once / Always / Reject
  • Screenshots of your PC screen or your running app, pinch to zoom
  • Drafts saved per chat, kept if sending fails
  • Call Candy: talk, pause, and Candy sends what you said, waits for the agent and reads back a one-line summary
  • Light and dark themes that follow the phone

Voice input

Mode Live Where audio goes
Hinglish · Sarvam ✅ Sarvam, through Candy's voice service (free daily minutes) or your own Sarvam key (unlimited)
English (India) · Apple ✅ Apple
Hindi · Apple ✅ Apple
English · on this iPhone ✅ stays on the phone

Only the resulting text is sent to OpenCode. If you add your own Sarvam key, it's stored in the iPhone Keychain and never built into the app. Apple's server modes stop a single take at about one minute.

The free Hinglish voice goes through a small Cloudflare Worker (worker/) that holds the Sarvam key, checks the request comes from a real iPhone running Candy (Apple DeviceCheck) and enforces daily limits.


Connecting to your PC

  • Same Wi-Fi: opencode service set hostname 0.0.0.0, opencode service start, then opencode pair and scan the QR code. iOS asks to allow Local Network the first time; say yes.
  • Anywhere: opencode pair --remote and scan the QR code.
  • Your own tunnel: Tailscale (recommended), Cloudflare Tunnel or ngrok; enter the address and the password from opencode service get password.

Plain http:// addresses are allowed so LAN and Tailscale IPs work. Off your home network, prefer HTTPS or Tailscale.


Building it yourself

Without a Mac (Windows)

iOS apps can only be compiled by Apple's tools on macOS, but GitHub Actions builds the app on GitHub's Macs for free.

  1. Fork this repo.
  2. Open your fork → Actions → enable workflows. The iOS workflow runs on every push:
    • Core unit tests runs the logic tests (swift test).
    • Build unsigned IPA compiles the app and attaches Candy-unsigned-ipa to the run (scroll down to Artifacts).
  3. Download and unzip the artifact to get Candy-unsigned.ipa.

The Upload to TestFlight job needs App Store Connect keys, so it will fail on a fork. That's expected; the unsigned IPA still builds.

Installing from Windows with Sideloadly (free):

  1. Install iTunes (from Apple's website, not the Microsoft Store version) and Sideloadly.
  2. Plug in the iPhone and trust the computer.
  3. Drag Candy-unsigned.ipa into Sideloadly, enter your Apple ID, click Start.
  4. On the iPhone: Settings → General → VPN & Device Management → trust your Apple ID.
  5. Turn on Settings → Privacy & Security → Developer Mode and restart.

With a free Apple ID the app works for 7 days, then reinstall it the same way.

On a Mac

brew install xcodegen
xcodegen generate          # creates Candy.xcodeproj from project.yml
open Candy.xcodeproj       # pick your team under Signing & Capabilities, then Run

Logic tests (also run on Linux and Windows with Swift installed):

swift test --package-path CandyCore

Project layout

candy-ios/
├─ project.yml                 XcodeGen spec (Info.plist, permissions, fonts)
├─ .github/workflows/          CI: tests, unsigned IPA, TestFlight upload
├─ CandyCore/                  Platform-free Swift package (compiled into the app too)
│  ├─ Sources/CandyCore/       Models, JSON mapping, SSE parser, pairing,
│  │                           screenshots, voice logic, error messages
│  └─ Tests/CandyCoreTests/
├─ Candy/                      The iOS app
│  ├─ App/                     Entry point, navigation, dependency container
│  ├─ Data/                    Settings + Keychain, URLSession client, SSE stream, repository
│  ├─ Voice/                   Apple speech, Sarvam WebSocket, call audio + text-to-speech
│  ├─ UI/                      Theme, components, Setup, Sessions, Chat, Settings
│  └─ Resources/               Assets, fonts (Plus Jakarta Sans, JetBrains Mono; OFL)
└─ worker/                     Cloudflare Worker for the free Hinglish voice

There's also an Android version (Kotlin + Compose) that talks to the same OpenCode API, so the same pairing links and QR codes work. It isn't public yet.

License

GPL-3.0. See LICENSE.

About

Candy for iPhone: unofficial iOS controller for OpenCode (SwiftUI)

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages