### Start OpenCode server with opencode serve Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/README.md Run this command on the machine that hosts your OpenCode server to start it on port 4096. This is the first step in the typical setup flow. ```bash opencode serve --port 4096 ``` -------------------------------- ### Start development server Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Starts the Expo development server. ```bash npm run start ``` -------------------------------- ### Clone and install dependencies Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Clones the repository and installs npm dependencies. Requires Node.js 20+ and npm. ```bash git clone https://github.com/alvarolorentedev/opencode-mobile.git cd opencode-mobile npm install ``` -------------------------------- ### Start development client build Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Starts the development client build. Native Cloud Link is available in every build; purchase/restore requires a native build, not Expo Go. Use EXPO_APP_VARIANT=development for the separate dev app. ```bash npm run start:dev-client ``` -------------------------------- ### Start dev client with development variant Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Starts the dev client with the development app variant. Cloud Link routes real purchases to https://api.opencodecloud.link and test purchases to https://apistaging.opencodecloud.link automatically. ```bash EXPO_APP_VARIANT=development npm run start:dev-client ``` -------------------------------- ### Install expo-widgets dependencies Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/ios-widget-parity.md Install the required expo-widgets and @expo/ui packages using the Expo CLI. ```bash npx expo install expo-widgets @expo/ui ``` -------------------------------- ### Run fake backend debug server Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/TESTING.md Starts the fake backend directly for debugging. Useful when you need to interact with the fake server outside the normal CI flow. ```bash npm run test:fake-server ``` -------------------------------- ### Build Android development client Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Builds a development client for Android. ```bash npm run build:development:android ``` -------------------------------- ### Common commands Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Lists common npm commands for linting, type checking, end-to-end tests, and building Android/iOS apps. ```bash npm run lint # Run linter npm run typecheck # Type checking npm run test:e2e:web # End-to-end tests npm run android # Build Android app npm run ios # Build iOS app npm run prebuild:ios # Generate iOS native project npm run build:ios:local # Build iOS release archive locally ``` -------------------------------- ### Build local iOS release Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Builds a local iOS release archive. ```bash npm run build:ios:local ``` -------------------------------- ### Build production Android release Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/development.md Builds a production Android release. ```bash npm run build:android ``` -------------------------------- ### Run CI test and build commands Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/TESTING.md Run the four primary local commands: static checks, fake-server self-tests, E2E web tests, and Android development build. These are the same gates used in CI. ```bash npm run test:ci:static npm run test:fake-server:self npm run test:e2e:web npm run build:development:android ``` -------------------------------- ### Build FOSS variant for Android Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/fdroid.md Execute the npm script to trigger the FOSS build process for Android, which sets the build flavor to foss. ```bash npm run build:foss:android ``` -------------------------------- ### iOS Simulator Compilation After Development Prebuild Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/connect.md Run these commands to compile the iOS app for the simulator after a development prebuild. The first command runs the prebuild with the development variant, and the second builds the workspace with xcodebuild for the simulator, disabling code signing. ```bash EXPO_APP_VARIANT=development CI=1 npx expo prebuild --platform ios EXPO_APP_VARIANT=development xcodebuild -workspace ios/OpenCodeMobileDev.xcworkspace \ -scheme OpenCodeMobileDev -configuration Debug -sdk iphonesimulator \ -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO build ``` -------------------------------- ### Run Local Validation Commands Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/testing-and-validation.md A collection of npm scripts used for linting, type checking, and running various test suites including the fake server and end-to-end web tests. ```bash npm run lint npm run typecheck npm run test:workspace-patch npm run test:fake-server:self npm run test:e2e:web npm run build:development:android ``` -------------------------------- ### Validate F-Droid recipe with checkupdates, lint, and build Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/fdroid/README.md Runs the F-Droid validation commands to check for updates, lint the recipe, and build the app. These commands should be run after preparing the metadata and before submitting the MR. ```bash fdroid checkupdates --allow-dirty app.getopencode.fdroid fdroid lint app.getopencode.fdroid fdroid build app.getopencode.fdroid ``` -------------------------------- ### Pre-push CI validation commands Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/AGENTS.md Run these commands locally before pushing to ensure the CI 'validate' job passes. A red e2e run is blocking; rerun failing tests to confirm intermittent failures before pushing. ```bash npm run test:ci:static npm run test:fake-server:self npm run test:e2e:web ``` -------------------------------- ### Baseline validation commands Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/AGENTS.md Run these commands as the baseline validation for any change. They check linting and type checking. ```bash npm run lint npm run typecheck ``` -------------------------------- ### Expose OpenCode server with cloudflared tunnel Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/README.md Use this command to create a secure HTTPS tunnel to your local OpenCode server, making it accessible from the OpenCode Mobile app. The server should be protected with authentication. ```bash cloudflared tunnel --url localhost:4096 ``` -------------------------------- ### Download and extract signatures from F-Droid APK Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/fdroid/README.md Downloads the F-Droid APK from GitHub releases and extracts its signatures using the fdroid signatures command. The extracted files should be placed under metadata/app.getopencode.fdroid/signatures//. ```bash curl -L -o opencode-mobile-fdroid.apk \ https://github.com/alvarolorentedev/opencode-mobile/releases/download/v1.0.55/opencode-mobile-fdroid.apk fdroid signatures opencode-mobile-fdroid.apk ``` -------------------------------- ### Pairing QR deep link format Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/connect.md The version-1 pairing link format used to initiate pairing. It contains the trusted control plane, pairing ID, pairing token, and machine name. ```text opencodemobile://pair?v=1&cp=&id=&t=&n= ``` -------------------------------- ### Configure expo-widgets in app.config.ts Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/ios-widget-parity.md Add the expo-widgets configuration plugin to your app.config.ts, specifying the bundle identifier, group identifier, and supported widget families. ```ts ['expo-widgets', { bundleIdentifier: 'app.getopencode.mobile.ExpoWidgetsTarget', groupIdentifier: 'group.app.getopencode.mobile', widgets: [{ name: 'SessionWidget', displayName: 'OpenCode tasks', description: 'Recent OpenCode tasks and their status.', ios: { supportedFamilies: ['systemSmall', 'systemMedium', 'accessoryRectangular', 'accessoryCircular'] } }], }] ``` -------------------------------- ### Configure expo-sharing in app.config.ts Source: https://github.com/alvarolorentedev/opencode-mobile/blob/main/docs/ios-share-parity.md Add the ios configuration block to the expo-sharing entry in app.config.ts. Ensure values match your Apple Developer team identifiers, noting that development variants require unique bundle IDs and App Groups. ```ts ios: { enabled: true, extensionBundleIdentifier: 'app.getopencode.mobile.ShareExtension', appGroupId: 'group.app.getopencode.mobile', activationRule: { supportsText: true, supportsWebUrlWithMaxCount: 1, supportsWebPageWithMaxCount: 1, supportsImageWithMaxCount: 5, supportsMovieWithMaxCount: 1, supportsFileWithMaxCount: 5, }, } ```