Skip to content

Repository files navigation

KKCode Community

A mobile remote client for OpenCode (iOS + Android / iPad / Android tablets). Community-maintained.

English 中文 License: AGPL-3.0 Platform Expo SDK 56 React Native 0.85 TypeScript PRs Welcome

Built on Expo SDK 56 + React Native 0.85 + React 19.2 + TypeScript. Turn your Mac's opencode serve into a backend, your phone into a client, and chat with your AI coding sessions from anywhere on the same network. No OpenCode core changes required — this project is just an extra HTTP + SSE client.

LAN-only: phone and Mac must be on the same Wi-Fi network.

📖 New contributors, start here: CLAUDE.md — environment variables, common commands, subdirectory conventions. 🤝 Want to contribute?: CONTRIBUTING.md · CODE_OF_CONDUCT.md 🔒 Security: SECURITY.md

Quick start (5 minutes)

npm install --legacy-peer-deps    # peer warnings between SDK and RN
npx expo start                    # launch Metro

Then:

  • Scan the QR code — opens in Expo Go (recommended)
  • i — iOS simulator
  • a — Android emulator

Start the OpenCode server on your Mac:

OPENCODE_SERVER_PASSWORD='<32-char-random>' \
  opencode serve --hostname 0.0.0.0 --port 4096

Phone and Mac must be on the same LAN.

Architecture and project map

New contributors, please read CLAUDE.md first — that's the project's single entry-point document (environment variables, common commands, subdirectory conventions).

This README is the "5-minute tour" and intentionally avoids the details.

Rules of the road

Topic Source
Keyboard avoidance (KAV) AGENTS.md § Android KeyboardAvoidingView — the only authoritative source
Chat scroll rules AGENTS.md
Common commands + environment variables CLAUDE.md
Code structure tour app/CLAUDE.md + per-subdirectory CLAUDE.md files

Implemented features (v1 overview)

  • Multi-server connection config (baseUrl / username / password), credentials encrypted via expo-secure-store (schema v3)
  • Project directory list and switching (GET /project)
  • Session list / create / delete / long-press delete / iPad two-pane master-detail
  • Chat page: streaming render of text / reasoning / tool / file / agent parts
  • Global SSE subscription to /global/event, automatic exponential-backoff reconnect, rAF-throttled delta
  • Permission approval sheet: intercepts permission.asked / question.asked events
  • Model / Agent selection, remembered per session
  • iPad landscape + split view, width-limited centering
  • 21-language i18n with RTL translations (only Arabic awaits UI flip)
  • Per-session offline draft auto-save
  • System / light / dark theme switch

Tech stack

Layer Choice
Runtime Expo SDK 56 + React Native 0.85 + React 19.2
Routing expo-router (file-based routing)
State Zustand (18 stores, see src/store/CLAUDE.md)
Secure storage expo-secure-store (Keychain / EncryptedSharedPrefs)
HTTP Hand-rolled lightweight client (src/api/client.ts), types mirrored from @opencode-ai/sdk/v2
SSE react-native-sse (XHR-based, supports custom headers)
Types Directly imported from @opencode-ai/sdk/v2
Theming Hand-built token system (src/theme/colors/spacing/typography/breakpoints)

Repo layout

app/         Expo Router route shells (every .tsx is a route; see app/CLAUDE.md)
src/         Business core (decoupled from routes, reusable across them; see app/CLAUDE.md, src/CLAUDE.md and per-subdirectory CLAUDE.md files)
ios/ android/  Generated by prebuild, gitignored
test/        Custom test harness (not Jest)

Documentation map

  • Entry: README.md (5 minutes) → CLAUDE.md (environment variables / common commands) → app/CLAUDE.md / src/CLAUDE.md (code structure tour)

Acknowledgements

This project builds on the following open-source projects (alphabetical):

Thanks to everyone who has filed issues, sent PRs, reviewed, or discussed this project.

License

LICENSE — AGPL-3.0. See LICENSE and the NOTICE section.

In short:

  • ✅ You may freely use, modify, study, and self-host this application
  • ✅ Modified code must also be released under AGPL-3.0
  • ✅ Modified versions offered over a network (SaaS / public service) must expose the complete source code to all users
  • ❌ May not be sold as a closed-source commercial product
  • ❌ May not be operated as a closed-source SaaS / competing service
  • ❌ May not be used as the source for a KKCode competitor

If you need to bypass these restrictions (closed-source commercial use), please contact the author to negotiate a separate commercial license.

Notice

  • This project is released under the GNU Affero General Public License v3, copyright © junbaor.
  • Built on Expo SDK 56 (MIT, 650 Industries, Inc.). AGPL-3.0 only governs this repository's source — it does not propagate into the upstream MIT dependencies.
  • This project does not include any server-side code from OpenCode (that portion remains commercial closed-source).

About

Mobile remote client for OpenCode (iOS / Android / iPad). Streams chat, handles permission prompts, manages multi-server configs over LAN. Built on Expo SDK 56 + React Native 0.85. AGPL-3.0.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages