|
2 | 2 |
|
3 | 3 | [English](./README.md) | [简体中文](./README.zh-CN.md) |
4 | 4 |
|
5 | | -FlyCode is a Flutter-based mobile client for `opencode`, built to connect to `opencode server` and bring project navigation, session management, and AI coding workflows to Android and iOS. |
| 5 | +## Description and Screenshots |
6 | 6 |
|
7 | | -> Prerequisite: FlyCode requires a running `opencode server` before the app can be used. |
8 | | -> Official docs: https://opencode.ai/docs/server/ |
| 7 | +FlyCode is a mobile client for `opencode`, built for Android and iOS. It lets you connect to your `opencode server`, browse projects, continue coding sessions, and work with the agent from a phone-first interface. |
9 | 8 |
|
10 | | -## Tech Stack |
| 9 | +> FlyCode requires a running `opencode server`. |
| 10 | +> Docs: https://opencode.ai/docs/server/ |
11 | 11 |
|
12 | | -- Flutter / Dart `^3.11.0` |
13 | | -- Riverpod + `riverpod_annotation` |
14 | | -- `go_router` |
15 | | -- `http` |
16 | | -- `shared_preferences` |
17 | | -- `sqflite` |
18 | | -- `json_serializable` |
19 | | - |
20 | | -## Supported Platforms |
21 | | - |
22 | | -This project is primarily focused on mobile: |
23 | | - |
24 | | -- Android |
25 | | -- iOS |
| 12 | +<p align="center"> |
| 13 | + <img src="./screenshots/screenshot-1.jpg" alt="FlyCode screenshot 1" width="22%" /> |
| 14 | + <img src="./screenshots/screenshot-2.jpg" alt="FlyCode screenshot 2" width="22%" /> |
| 15 | + <img src="./screenshots/screenshot-3.jpg" alt="FlyCode screenshot 3" width="22%" /> |
| 16 | + <img src="./screenshots/screenshot-4.jpg" alt="FlyCode screenshot 4" width="22%" /> |
| 17 | +</p> |
26 | 18 |
|
27 | 19 | ## Features |
28 | 20 |
|
29 | | -- Connect to `opencode server` with a configurable server address and optional authentication |
30 | | -- Browse projects and jump into new or existing coding sessions quickly |
31 | | -- Chat with the coding agent through a mobile-oriented message and input experience |
32 | | -- Review permission requests, questions, todos, diffs, and session context in-app |
33 | | -- Customize model settings, theme mode, language, and completion notifications |
34 | | -- Persist local app state with built-in storage and mobile notification support |
35 | | - |
36 | | -## Project Structure |
37 | | - |
38 | | -```text |
39 | | -lib/ |
40 | | - app.dart # App entry: routing, theme, localization, global events |
41 | | - main.dart # Flutter bootstrap |
42 | | - router.dart # go_router route definitions |
43 | | - theme/ # ThemeData and AppThemeTokens |
44 | | - l10n/ # Localization resources and generated code |
45 | | - pages/ # Page layer |
46 | | - widgets/ # Shared and feature widgets |
47 | | - providers/ # Riverpod providers and state logic |
48 | | - service/api/ # API client, endpoints, and API models |
49 | | - database/ # Local database and DAOs |
50 | | - models/ # App-local models |
51 | | -test/ # Unit and widget tests |
52 | | -assets/ # Fonts, app icon, and static assets |
53 | | -``` |
54 | | - |
55 | | -## Local Development |
56 | | - |
57 | | -### Requirements |
58 | | - |
59 | | -- Flutter SDK |
60 | | -- Dart SDK `^3.11.0` |
61 | | -- Platform-specific build environment for your target device |
62 | | -- A running `opencode server` |
| 21 | +- Connect to `opencode server` with a custom server address and optional authentication |
| 22 | +- Browse projects and jump into new or existing coding sessions |
| 23 | +- Chat with the coding agent through a mobile-optimized interface |
| 24 | +- Review permission requests, todos, diffs, and session context in the app |
| 25 | +- Adjust model, language, theme mode, and notification preferences |
63 | 26 |
|
64 | | -### Quick Start |
| 27 | +## Use |
65 | 28 |
|
66 | | -1. Start `opencode server` first: |
| 29 | +1. Start your `opencode server`. |
67 | 30 |
|
68 | 31 | ```bash |
69 | 32 | opencode serve |
70 | 33 | ``` |
71 | 34 |
|
72 | | -By default, the server listens on `http://127.0.0.1:4096`. |
| 35 | +2. By default, the server runs at `http://127.0.0.1:4096`. |
| 36 | +3. Install and open FlyCode on your device. |
| 37 | +4. Enter the server address in the app and connect. |
| 38 | +5. Pick a project, open a session, and start working with the agent. |
73 | 39 |
|
74 | | -Server docs: |
| 40 | +Server references: |
75 | 41 |
|
76 | | -- https://opencode.ai/docs/server/ |
77 | | -- OpenAPI spec after startup: `http://127.0.0.1:4096/doc` |
| 42 | +- Docs: https://opencode.ai/docs/server/ |
| 43 | +- OpenAPI doc after startup: `http://127.0.0.1:4096/doc` |
| 44 | + |
| 45 | +## Build |
| 46 | + |
| 47 | +If you want to build FlyCode yourself, make sure you have: |
| 48 | + |
| 49 | +- Flutter SDK |
| 50 | +- Dart SDK `^3.11.0` |
| 51 | +- Android or iOS build environment |
| 52 | +- A running `opencode server` for local testing |
78 | 53 |
|
79 | | -### Install Dependencies |
| 54 | +Install dependencies: |
80 | 55 |
|
81 | 56 | ```bash |
82 | 57 | flutter pub get |
83 | 58 | ``` |
84 | 59 |
|
85 | | -### Run the App |
| 60 | +Run the app: |
86 | 61 |
|
87 | 62 | ```bash |
88 | 63 | flutter run |
89 | 64 | ``` |
90 | 65 |
|
91 | | -To run on a specific device: |
| 66 | +Run on a specific device: |
92 | 67 |
|
93 | 68 | ```bash |
94 | 69 | flutter devices |
95 | 70 | flutter run -d <device-id> |
96 | 71 | ``` |
97 | 72 |
|
98 | | -## Development Commands |
99 | | - |
100 | | -### Format Code |
101 | | - |
102 | | -```bash |
103 | | -dart format . |
104 | | -``` |
105 | | - |
106 | | -### Static Analysis |
107 | | - |
108 | | -```bash |
109 | | -flutter analyze |
110 | | -``` |
111 | | - |
112 | | -### Run Tests |
113 | | - |
114 | | -```bash |
115 | | -flutter test |
116 | | -``` |
117 | | - |
118 | | -Run a single test file: |
119 | | - |
120 | | -```bash |
121 | | -flutter test test/session_status_provider_test.dart |
122 | | -``` |
123 | | - |
124 | | -Run a named test: |
125 | | - |
126 | | -```bash |
127 | | -flutter test test/session_status_provider_test.dart --name="returns loading state" |
128 | | -``` |
129 | | - |
130 | | -### Generate Code |
131 | | - |
132 | | -Run code generation after updating: |
133 | | - |
134 | | -- `@riverpod` providers |
135 | | -- `json_serializable` models |
| 73 | +If you change generated models or providers, run: |
136 | 74 |
|
137 | 75 | ```bash |
138 | 76 | dart run build_runner build --delete-conflicting-outputs |
139 | 77 | ``` |
140 | | - |
141 | | -## Recommended Workflow |
142 | | - |
143 | | -Before committing, run: |
144 | | - |
145 | | -```bash |
146 | | -dart format . |
147 | | -flutter analyze |
148 | | -flutter test |
149 | | -``` |
150 | | - |
151 | | -Repository conventions: |
152 | | - |
153 | | -- Do not edit `*.g.dart` files manually |
154 | | -- Prefer `@riverpod` for new providers |
155 | | -- Keep pages focused on composition and UI assembly |
156 | | -- Move business logic into providers where possible |
157 | | -- Avoid hardcoded colors, typography, and spacing; prefer theme tokens |
158 | | - |
159 | | -## Theme and Design |
160 | | - |
161 | | -The project uses `ThemeData` with `ThemeExtension(AppThemeTokens)` for design tokens. |
162 | | - |
163 | | -Key files: |
164 | | - |
165 | | -- `lib/app.dart` |
166 | | -- `lib/theme/app_theme.dart` |
167 | | -- `lib/theme/app_tokens.dart` |
168 | | -- `lib/theme/theme_mode_provider.dart` |
169 | | - |
170 | | -Design guidance: |
171 | | - |
172 | | -- Prioritize information hierarchy over decoration |
173 | | -- Reuse components instead of introducing one-off styles |
174 | | -- Keep colors, typography, radius, and spacing token-driven |
175 | | -- Consider both light and dark mode |
176 | | - |
177 | | -Current visual baseline: |
178 | | - |
179 | | -- Body font: Inter |
180 | | -- Display font: PlusJakartaSans |
181 | | -- Primary color: `#8B5CF6` |
182 | | - |
183 | | -## Configuration |
184 | | - |
185 | | -### Server Configuration |
186 | | - |
187 | | -The app depends on a reachable `opencode server`, and the server must be started before FlyCode can connect. The connection test currently calls: |
188 | | - |
189 | | -```text |
190 | | -/global/health |
191 | | -``` |
192 | | - |
193 | | -Quick reference: |
194 | | - |
195 | | -- Docs: https://opencode.ai/docs/server/ |
196 | | -- Start command: `opencode serve` |
197 | | -- Default address: `http://127.0.0.1:4096` |
198 | | -- OpenAPI spec: `http://127.0.0.1:4096/doc` |
199 | | - |
200 | | -Configurable fields: |
201 | | - |
202 | | -- `baseUrl` |
203 | | -- `username` (optional) |
204 | | -- `password` (optional) |
205 | | - |
206 | | -### Local Persistence |
207 | | - |
208 | | -The project currently uses: |
209 | | - |
210 | | -- `shared_preferences` for lightweight local settings and onboarding state |
211 | | -- `sqflite` for local structured storage |
212 | | - |
213 | | -## License and Assets |
214 | | - |
215 | | -- Font assets are stored in `assets/fonts/` |
216 | | -- The font license file is stored at `assets/fonts/OFL.txt` |
0 commit comments