cordierite

Connectez une application React Native compatible Cordierite à votre machine et pilotez-la depuis le terminal à l'aide des outils enregistrés par l'application — utile pour les agents, les scripts, et…

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.

Plus de skills de callstackincubator

agent-device
callstackincubator
Automatisez les interactions avec les applications iOS et Android grâce à la découverte basée sur des instantanés et la relecture pilotée par sélecteurs. Prend en charge les simulateurs/appareils iOS et les émulateurs/appareils Android avec automatisation liée à la session, mode démon distant multi-locataire et isolation de la portée des appareils pour les workflows QA. Commandes principales : snapshot pour la découverte de l'interface utilisateur avec références, press / fill / scroll pour les interactions, open / close pour le cycle de vie des applications, install / reinstall pour le déploiement binaire. Inclut des utilitaires pour la journalisation, l'inspection réseau,...
official
dogfood
callstackincubator
Explorer et tester systématiquement une application mobile sur iOS/Android avec agent-device pour trouver des bugs, des problèmes d’UX et autres anomalies. Utiliser lorsqu’on demande de dogfood, QA,…
official
react-devtools
callstackincubator
Inspectez et profilez les arbres de composants React Native depuis l'agent-appareil. Utilisez pour les performances React Native, le profilage, les props, l'état, les hooks, les causes de rendu, les ralentissements…
official
react-devtools
callstackincubator
CLI React DevTools pour agents IA. À utiliser lorsque l'utilisateur vous demande de déboguer une application React ou React Native en cours d'exécution, d'inspecter les props/state/hooks des composants, de diagnostiquer…
official
github
callstackincubator
Automatisation des workflows GitHub via l'interface gh pour les pull requests, les PR empilées et la gestion de dépôt. Fournit un workflow de fusion de PR empilées : fusion squash de la première PR, puis rebase et mise à jour de la branche de base pour chaque PR suivante dans la chaîne. Inclut la détection de conflits et des invites de résolution manuelle pour éviter les échecs silencieux lors des fusions multi-PR. Couvre les opérations principales de l'interface gh : création de PR, vérifications d'état, fusion squash/rebase et gestion des branches. Optimisé pour une utilisation à faible contexte en s'appuyant sur l'interface gh...
official
github-actions
callstackincubator
Modèles de workflows GitHub Actions pour les builds cloud du simulateur iOS React Native et de l'émulateur Android avec artefacts téléchargeables. À utiliser lors de la configuration de builds CI…
official
react-native-best-practices
callstackincubator
Référence structurée d'optimisation des performances pour les applications React Native couvrant les FPS, la taille du bundle, le TTI et la mémoire. Organisée en 9 guides JavaScript/React (profilage, listes, animations, mémoire), 9 guides d'optimisation natifs (Turbo Modules, threading, profilage) et 9 guides de bundling (tree shaking, code splitting, analyse de taille). Chaque référence suit un format hybride avec des motifs/commandes rapides, des évaluations d'impact (CRITIQUE/HAUT/MOYEN) et des explications approfondies avec prérequis et éléments communs...
official
react-native-brownfield-migration
callstackincubator
Propose une stratégie d'adoption incrémentale pour migrer des applications natives iOS ou Android vers React Native ou Expo en utilisant @callstack/react-native-brownfield pour une…
official