expo-devtools-cli
БесплатноБез исполняемых скриптовНе проверенBuilding Expo DevTools Plugins with CLI Interfaces for interacting with running Expo apps using agents.
от EvanBacon★ 43 звезды на GitHubОб этом скилле
Building Expo DevTools Plugins with CLI Interfaces
Build CLI tools that communicate with running Expo apps via the DevTools plugin system.
Architecture Overview
┌─────────────────┐ WebSocket ┌─────────────────┐
│ CLI Client │◄──────────────────►│ Expo Dev Server │
│ (Bun + Stricli)│ │ (Metro) │
└─────────────────┘ └────────┬────────┘
│
┌────────▼────────┐
│ React Native │
│ App + Hook │
└─────────────────┘
Preferred Tech Stack
| Component | Technology | Why |
|---|---|---|
| Runtime | Bun | Fast startup, native TypeScript, built-in WebSocket |
| CLI Framework | @stricli/core | Type-safe, lazy loading, tree-shakeable |
| App Hook | expo/devtools | useDevToolsPluginClient for app-side connection |
| Protocol | JSON over WebSocket | Simple, debuggable with standard tools |
Project Structure
cli/
├── index.ts # Entry point with shebang
├── app.ts # Stricli app definition with routes
├── client.ts # WebSocket client for devtools
├── types.ts # Shared TypeScript types
├── formatters.ts # Output formatting (table, JSON)
└── commands/
├── query.ts # Read commands
├── write.ts # Write commands
└── status.ts # Status/health commands
src/devtools/
└── useMyPluginDevTools.ts # App-side message handler hook
Step 1: Configure the Module
Add devtools config to expo-module.config.json:
{
"name": "MyModule",
"platforms": ["ios", "android"],
"devtools": {
"name": "My Plugin",
"id": "my-plugin"
}
}
Step 2: Create the App-Side Hook
// src/devtools/useMyPluginDevTools.ts
import { useEffect } from "react";
import { useDevToolsPluginClient } from "expo/devtools";
interface PluginMessage {
id: string;
type: string;
payload: Record<string, unknown>;
}
export function useMyPluginDevTools() {
const client = useDevToolsPluginClient("my-plugin"); // Must match devtools.id
useEffect(() => {
if (!client) return;
const handleMessage = (data: PluginMessage) => {
const { id, type, payload } = data;
const sendResult = (result: unknown) => {
client.sendMessage("result", { id, type: "result", data: result });
};
const sendError = (error: Error) => {
client.sendMessage("error", {
id,
type: "error",
error: error.message,
});
};
(async () => {
try {
switch (type) {
case "getData":
const data = await fetchData(payload.query as string);
sendResult(data);
break;
default:
sendError(new Error(`Unknown message type: ${type}`));
}
} catch (error) {
sendError(error as Error);
}
})();
};
const subscription = client.addMessageListener(
"message",
(msg: unknown) => {
handleMessage(msg as PluginMessage);
}
);
return () => {
subscription?.remove?.();
};
}, [client]);
}
Step 3: Create the CLI Client
// cli/client.ts
const DEFAULT_PORT = 8081;
const REQUEST_TIMEOUT = 30000;
const PROTOCOL_VERSION = 1;
export class PluginClient {
private ws: WebSocket | null = null;
private pending = new Map<string, { resolve: Function; reject: Function }>();
private connected = false;
private browserClientId = Date.now().toString();
private pluginName = "my-plugin"; // Must match devtools.id
async connect(port = DEFAULT_PORT): Promise<void> {
if (this.connected) return;
return new Promise((resolve, reject) => {
// IMPORTANT: Use the broadcast endpoint
const url = `ws://localhost:${port}/expo-dev-plugins/broadcast`;
this.ws = new WebSocket(url);
const timeout = setTimeout(() => {
reject(new Error(`Connection timeout to ${url}`));
}, 10000);
this.ws.addEventListener("open", () => {
clearTimeout(timeout);
this.connected = true;
this.sendHandshake();
resolve();
});
this.ws.addEventListener("error", () => {
clearTimeout(timeout);
reject(new Error(`Failed to connect to Expo devtools at ${url}`));
});
this.ws.addEventListener("close", () => {
this.connected = false;
});
this.ws.addEventListener("message", (event) => {
this.handleMessage(event.data);
});
});
}
private sendHandshake():
Установить expo-devtools-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл expo-devtools-cli?
Building Expo DevTools Plugins with CLI Interfaces for interacting with running Expo apps using agents.
Как установить скилл expo-devtools-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл expo-devtools-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic