### EAS CLI Test Setup with Mocking Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/CLAUDE.md Provides an example of setting up tests for EAS CLI commands using mocking libraries like memfs for the file system and nock for HTTP requests. ```typescript import { vol } from 'memfs'; import nock from 'nock'; describe('MyCommand', () => { beforeEach(() => { vol.reset(); nock.cleanAll(); }); it('should do something', async () => { // Test implementation }); }); ``` -------------------------------- ### eas init:onboarding Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Continues the onboarding process for a project that was initiated on the https://expo.new website. This command is useful for completing the setup after starting the process online. ```APIDOC ## eas init:onboarding [TARGET_PROJECT_DIRECTORY] ### Description Continue onboarding process started on the https://expo.new website. ### Usage `eas init:onboarding [TARGET_PROJECT_DIRECTORY]` ### Arguments - `TARGET_PROJECT_DIRECTORY` (string) - The directory of the project to continue onboarding for. ``` -------------------------------- ### Install EAS CLI Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Install the EAS CLI globally using npm or yarn. ```sh npm install -g eas-cli # or yarn global add eas-cli ``` -------------------------------- ### Start EAS Build Source: https://github.com/expo/eas-cli/blob/main/README.md Initiates a build process for your project. Supports specifying the platform, build profile, and various options for local builds, caching, and submission. ```bash eas build [-p android|ios|all] [-e PROFILE_NAME] [--local] [--output ] [--wait] [--clear-cache] [-s | --auto-submit-with-profile PROFILE_NAME] [--what-to-test ] [-m ] [--build-logger-level trace|debug|info|warn|error|fatal] [--freeze-credentials] [--refresh-ad-hoc-provisioning-profile] [--verbose-logs] [--json] [--non-interactive] ``` -------------------------------- ### Essential Expo CLI Commands Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/commandUtils/new/templates/AGENTS.md Commonly used Expo CLI commands for managing packages, starting the development server, linting, typechecking, and diagnosing issues. Always use `expo install` for package management to ensure SDK compatibility. ```bash npx expo install ``` ```bash npx expo start ``` ```bash npx expo lint ``` ```bash npx tsc --noEmit ``` ```bash npx expo-doctor ``` ```bash npx expo install --fix ``` -------------------------------- ### Make GraphQL Requests Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/CLAUDE.md Example of how to make a GraphQL query using the authenticated graphqlClient obtained from the LoggedIn context. Includes basic error handling. ```typescript // In a command with LoggedIn context: const { graphqlClient } = await this.getContextAsync(LoggedIn, { nonInteractive: false, }); const result = await graphqlClient.query(MyQuery, { variables: { id: projectId } }).toPromise(); if (result.error) { throw new Error(result.error.message); } const data = result.data; ``` -------------------------------- ### Install Dependencies and Build Monorepo Source: https://github.com/expo/eas-cli/blob/main/CLAUDE.md Installs all project dependencies and builds all packages within the monorepo. This is a foundational step for setting up the development environment. ```bash yarn install yarn build ``` -------------------------------- ### Continue EAS Project Onboarding Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Resumes the project onboarding process that was started on the expo.new website. ```bash USAGE $ eas project:onboarding [TARGET_PROJECT_DIRECTORY] DESCRIPTION continue onboarding process started on the https://expo.new website. ALIASES $ eas init:onboarding $ eas onboarding ``` -------------------------------- ### Continue EAS Onboarding Source: https://github.com/expo/eas-cli/blob/main/README.md Use `eas init:onboarding` to continue an onboarding process that was started on the expo.new website. This command can take a target project directory as an argument. ```bash USAGE $ eas init:onboarding [TARGET_PROJECT_DIRECTORY] DESCRIPTION continue onboarding process started on the https://expo.new website. ALIASES $ eas init:onboarding $ eas onboarding ``` -------------------------------- ### Install EAS Autocomplete Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Provides instructions for installing shell autocompletion for EAS CLI. Supports zsh, bash, and powershell. Can also refresh the cache. ```bash eas autocomplete [SHELL] [-r] ``` ```bash eas autocomplete ``` ```bash eas autocomplete bash ``` ```bash eas autocomplete zsh ``` ```bash eas autocomplete powershell ``` ```bash eas autocomplete --refresh-cache ``` -------------------------------- ### EasCommand Structure with Context Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/CLAUDE.md Example of a command extending EasCommand and utilizing the context system to acquire necessary resources like GraphQL clients and project configurations. ```typescript import EasCommand from '../../commandUtils/EasCommand'; export default class Build extends EasCommand { static override description = 'start a build'; static override ContextOptions = { ...EasCommand.ContextOptions.LoggedIn, // Requires auth ...EasCommand.ContextOptions.ProjectConfig, // Requires project }; async runAsync(): Promise { // Context is automatically initialized const { graphqlClient } = await this.getContextAsync(LoggedIn, { nonInteractive: false, }); const { projectId, exp } = await this.getContextAsync(ProjectConfig, { nonInteractive: false, }); // Your command logic here } } ``` -------------------------------- ### Compare Fingerprint Against Local Project Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Compare a provided fingerprint hash against the current project's fingerprint. This is useful for verifying a known hash against your local setup. ```bash eas fingerprint:compare # Compare fingerprint against local directory ``` -------------------------------- ### EAS CLI Onboarding Command Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Continues the onboarding process for an Expo project. Use this command to link your local project to an EAS project started on expo.new. ```bash USAGE $ eas onboarding [TARGET_PROJECT_DIRECTORY] DESCRIPTION continue onboarding process started on the https://expo.new website. ALIASES $ eas init:onboarding $ eas onboarding ``` -------------------------------- ### EAS CLI Usage Examples Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Basic usage patterns for the EAS CLI, including running commands, checking the version, and accessing help. ```sh eas COMMAND # runs the command eas (-v|--version|version) # prints the version eas --help COMMAND # outputs help for specific command ``` -------------------------------- ### Setup and Build Commands for Turtle Worker Source: https://github.com/expo/eas-cli/blob/main/packages/worker/CLAUDE.md These bash commands are used to set up the development environment for the Turtle Worker. This includes copying environment configuration, installing dependencies, and building the project from the repository root. ```bash # Copy environment configuration cp ./.direnv/local/.envrc.example ./.direnv/local/.envrc # Fill out the .envrc file with your secrets # Then load it with direnv or source it manually # Install dependencies (from repo root) yarn install # Build yarn build ``` -------------------------------- ### eas build Source: https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md Starts a new build for your Expo application. This command can be used to initiate builds for Android, iOS, or both platforms, with various configuration options. ```APIDOC ## eas build ### Description Start a build. ### Usage ```bash eas build [-p android|ios|all] [-e PROFILE_NAME] [--local] [--output ] [--wait] [--clear-cache] [-s | --auto-submit-with-profile PROFILE_NAME] [--what-to-test ] [-m ] [--build-logger-level trace|debug|info|warn|error|fatal] [--freeze-credentials] [--refresh-ad-hoc-provisioning-profile] [--verbose-logs] [--json] [--non-interactive] ``` ### Flags - `-p, --platform