Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode iOS

A native iOS client for opencode, the open-source AI coding agent. Run opencode serve on your Mac (or any machine), connect from your iPhone or iPad, and drive coding sessions from anywhere on your network.

Built with SwiftUI. No third-party dependencies.

Features

  • Sessions — browse, create, rename, archive, and delete opencode sessions; live busy and needs-attention indicators; per-session model memory
  • Steering — type and send follow-ups while the agent is still working, just like desktop
  • Chat — full streaming chat over the opencode SSE event stream, with markdown and code-block rendering
  • Tool calls — collapsible cards for every tool invocation (bash, edit, read, grep, …) with inputs, output, status, and errors
  • Reasoning — collapsed "Thinking" sections for models that emit reasoning
  • Permissions — approve or reject the agent's permission requests (allow once / always / reject) right from your phone
  • Questions — answer the agent's clarifying questions, including multi-select and custom answers
  • Models & agents — pick any provider/model configured on your server, switch agents (build, plan, …)
  • Diffs — browse every file the session changed, with unified diffs and +/− counts
  • Image attachments — send photos from your library straight into the prompt
  • Todos — watch the agent's task list update in real time
  • Abort — stop a running generation with one tap
  • Auth — optional HTTP Basic auth support (OPENCODE_SERVER_PASSWORD)

Requirements

  • Xcode 16 or newer
  • iOS 17.0+ device or simulator
  • A machine running a recent release of opencode

Getting started

1. Start an opencode server

On the machine where you use opencode:

opencode serve --hostname 0.0.0.0 --port 4096

--hostname 0.0.0.0 makes the server reachable from other devices on your network (by default it binds to 127.0.0.1, which your phone can't reach).

Optional password protection:

OPENCODE_SERVER_PASSWORD=yourpassword opencode serve --hostname 0.0.0.0 --port 4096

2. Build the app

  1. Clone this repo and open OpenCode.xcodeproj in Xcode.
  2. Select the OpenCode target → Signing & Capabilities → pick your development team (change the bundle identifier if needed).
  3. Build & run on your device or simulator.

3. Connect

Enter your server's address (e.g. 192.168.1.10:4096) on the welcome screen. Find your Mac's IP under System Settings → Wi-Fi → Details, or use a Tailscale/VPN address to connect from anywhere. If you set a password on the server, enter it too (username is opencode unless you changed OPENCODE_SERVER_USERNAME).

Architecture

OpenCode/
├── App/            App entry point and root routing
├── Models/         Codable models mirroring the opencode OpenAPI schema,
│                   plus the typed SSE event enum
├── Networking/     REST client, SSE event-stream client (auto-reconnect),
│                   server config + Keychain storage
├── State/          @Observable stores: AppModel (connection, sessions,
│                   providers, agents, event routing) and ChatModel
│                   (per-session messages/parts reducer)
├── Views/          SwiftUI views: session list, chat, tool cards,
│                   permission/question sheets, model picker, settings
└── Utilities/      Formatting helpers

The app talks to opencode's HTTP API (/session, /config/providers, /agent, /permission, /question) and subscribes to /event (server-sent events) for realtime updates: message/part streaming deltas, session status, permission and question prompts, and todo updates.

Notes

  • App Transport Security is configured to allow plain-HTTP connections because opencode serve speaks HTTP on your LAN. Put the server behind HTTPS or use a VPN (Tailscale) if you expose it beyond your local network — and prefer setting OPENCODE_SERVER_PASSWORD either way.
  • The server password is stored in the iOS Keychain.

License

MIT — see LICENSE. Not affiliated with Anomaly; opencode is a trademark of its respective owners.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages