Skip to main content
Glama
cli.ts1.59 kB
import { execa } from 'execa'; import { ExpoServerConfig } from '../types.js'; import { handleCliError } from './errors.js'; /** * Executes Expo CLI commands with proper environment configuration */ export async function executeExpoCommand( args: string[], config?: ExpoServerConfig, cwd?: string ): Promise<string> { try { const env = { ...process.env }; // Add EXPO_TOKEN if provided in config if (config?.expoToken) { env.EXPO_TOKEN = config.expoToken; } const result = await execa('npx', ['expo', ...args], { env, cwd: cwd || process.cwd(), shell: false }); return result.stdout; } catch (error) { throw handleCliError(error, `npx expo ${args.join(' ')}`); } } /** * Executes EAS CLI commands with proper environment configuration */ export async function executeEasCommand( args: string[], config?: ExpoServerConfig, cwd?: string ): Promise<string> { try { const env = { ...process.env }; // Add EXPO_TOKEN if provided in config if (config?.expoToken) { env.EXPO_TOKEN = config.expoToken; } const result = await execa('npx', ['eas-cli', ...args], { env, cwd: cwd || process.cwd(), shell: false }); return result.stdout; } catch (error) { throw handleCliError(error, `npx eas-cli ${args.join(' ')}`); } } /** * Checks if a command is available in the system */ export async function checkCommandAvailable(command: string): Promise<boolean> { try { await execa('which', [command]); return true; } catch { return false; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CaullenOmdahl/expo-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server