cordierite

Kết nối ứng dụng React Native hỗ trợ Cordierite với máy của bạn và điều khiển từ terminal bằng các công cụ mà ứng dụng đăng ký — hữu ích cho agent, script, và…

npx skills add https://github.com/callstackincubator/cordierite --skill cordierite

Cordierite

Cordierite is a CLI and host workflow for connecting to a Cordierite-enabled React Native app, discovering its registered tools, invoking those tools from the terminal, and ending the session cleanly after use.

Agent workflow

  1. Run cordierite session --json. The response includes data.sessions (each entry has session_id, status, endpoint info, etc.). If sessions is empty, no Cordierite host is registered for this machine (for this registry).
  2. If you need a new session for a device, follow Establish a session below. Record host.session_id from the host JSON—you must pass it to tools and invoke.
  3. After the user opens the deep link on the device and the app connects, confirm with cordierite session --session-id <session_id> --json until data.selected reflects an active connection (or re-check session --json and infer from the listed session).
  4. cordierite tools --session-id <session_id> --json — list tools registered in the app.
  5. cordierite tools --session-id <session_id> <tool-name> --json — inspect one tool’s input/output schema before calling it.
  6. cordierite invoke --session-id <session_id> <tool-name> --input '{"key":"value"}' --json — invoke the tool with JSON args.

Establish a session

Start the host with --json using the same TLS key and app URL scheme as the project (see Setup if you are wiring Cordierite into an app). The CLI generates the host certificate automatically from the resolved local IP. If the project does not already have a trusted host key, create one first with cordierite keygen in an interactive terminal and add the printed fingerprint to the app’s cliPins. If the default listen port is in use, add --port <port>.

cordierite host --tls-key /path/to/key.pem --scheme myapp --json

Run cordierite host in the background. It blocks; keep the foreground shell free for session, tools, and invoke.

From the host JSON output, use at least:

  • host.deep_link — full URL (e.g. myapp:///?cordierite=…) for the app to open.
  • host.session_id — pass this as --session-id to tools / invoke / session --session-id.

Then:

  1. Give the user the deep link (or QR from interactive host UI on a TTY) so they can open it on a device or simulator.
  2. Or open it yourself when you know the target (e.g. iOS Simulator xcrun simctl openurl booted '<url>', Android via adb, or device automation skills).

After the app opens the link and claims the session, poll cordierite session --session-id <session_id> --json (or session --json) until the session is active.

Terminate the connection

When the user wants to disconnect or stop Cordierite for that session: stop the matching background cordierite host process (end the job, SIGTERM, etc.). That tears down the host and the session. If several hosts run (e.g. different --port), stop the one that corresponds to the session_id you were using.

Declaring tools

The app must register tools before cordierite tools / cordierite invoke can do anything useful. Define schemas with Zod and register with registerTool:

import { registerTool } from "@cordierite/react-native";
import { z } from "zod";

const echoInput = z.object({
  value: z.unknown(),
});

const echoOutput = z.object({
  echoed: z.unknown(),
});

registerTool(
  {
    name: "echo",
    description: "Return the input unchanged",
    inputSchema: echoInput,
    outputSchema: echoOutput,
    handler: async (args) => ({ echoed: args.value }),
  },
);

Notes

  • Use --json for structured CLI output in agent flows.
  • cordierite keygen is the normal setup command for new host keys. It is interactive-only in v1: it writes a PEM private key and prints the exact sha256/... fingerprint the app should trust.
  • tools and invoke always require --session-id (the value from host.session_id or sessions[].session_id).
  • Prefer cordierite session --json first rather than assuming a session exists.
  • If sessions is empty or tools / invoke fail with connection or session errors, establish a session (host running, deep link opened on the correct device).
  • If the app registers no tools, cordierite tools returns an empty list.
  • You may run multiple cordierite host processes (e.g. different --port for different devices); use the session_id that belongs to the host you care about.

Setup

For project integration guidance, see setup.md.

Thêm skills từ callstackincubator

agent-device
callstackincubator
Tự động hóa tương tác ứng dụng iOS và Android với khám phá dựa trên ảnh chụp nhanh và phát lại dựa trên bộ chọn. Hỗ trợ trình mô phỏng/thiết bị iOS và trình giả lập/thiết bị Android với tự động hóa theo phiên, chế độ daemon từ xa đa người thuê và cách ly phạm vi thiết bị cho quy trình QA. Các lệnh cốt lõi: snapshot để khám phá UI với tham chiếu, press / fill / scroll để tương tác, open / close cho vòng đời ứng dụng, install / reinstall để triển khai nhị phân. Bao gồm các tiện ích cho ghi nhật ký, kiểm tra mạng,...
official
dogfood
callstackincubator
Khám phá và kiểm tra một ứng dụng di động trên iOS/Android một cách có hệ thống với agent-device để tìm lỗi, vấn đề UX và các vấn đề khác. Sử dụng khi được yêu cầu dogfood, QA,…
official
react-devtools
callstackincubator
Kiểm tra và lập hồ sơ cây thành phần React Native từ agent-device. Sử dụng cho hiệu suất, lập hồ sơ, props, state, hooks, nguyên nhân render, chậm… của React Native.
official
react-devtools
callstackincubator
CLI React DevTools dành cho các tác nhân AI. Sử dụng khi người dùng yêu cầu bạn gỡ lỗi ứng dụng React hoặc React Native trong thời gian chạy, kiểm tra props/state/hooks của component, chẩn đoán…
official
github
callstackincubator
Tự động hóa quy trình làm việc GitHub qua gh CLI cho pull request, stacked PR và quản lý kho lưu trữ. Cung cấp quy trình hợp nhất stacked PR: squash-merge PR đầu tiên, sau đó rebase và cập nhật nhánh cơ sở cho từng PR tiếp theo trong chuỗi. Bao gồm phát hiện xung đột và lời nhắc giải quyết thủ công để ngăn lỗi im lặng trong quá trình hợp nhất nhiều PR. Bao gồm các thao tác gh CLI cốt lõi: tạo PR, kiểm tra trạng thái, hợp nhất squash/rebase và quản lý nhánh. Được tối ưu hóa cho việc sử dụng ít ngữ cảnh bằng cách dựa vào gh CLI...
official
github-actions
callstackincubator
Các mẫu quy trình GitHub Actions cho bản dựng đám mây trên trình giả lập iOS React Native và trình mô phỏng Android với các tạo phẩm có thể tải xuống. Sử dụng khi thiết lập bản dựng CI…
official
react-native-best-practices
callstackincubator
Tài liệu tham khảo tối ưu hóa hiệu suất có cấu trúc cho ứng dụng React Native, bao gồm FPS, kích thước bundle, TTI và bộ nhớ. Được tổ chức thành 9 hướng dẫn JavaScript/React (lập hồ sơ, danh sách, hoạt ảnh, bộ nhớ), 9 hướng dẫn tối ưu hóa gốc (Turbo Modules, luồng, lập hồ sơ) và 9 hướng dẫn đóng gói (tree shaking, code splitting, phân tích kích thước). Mỗi tài liệu tham khảo tuân theo định dạng kết hợp với các mẫu/lệnh nhanh, xếp hạng tác động (CRITICAL/HIGH/MEDIUM) và giải thích chuyên sâu kèm điều kiện tiên
official
react-native-brownfield-migration
callstackincubator
Cung cấp chiến lược áp dụng gia tăng để di chuyển ứng dụng iOS hoặc Android gốc sang React Native hoặc Expo bằng @callstack/react-native-brownfield cho giai đoạn đầu…
official