Running Playgrounds
Relevant source files
The following files were used as context for generating this wiki page:
The react-grab repository contains several isolated playground applications used for development and testing. These playgrounds allow developers to test changes to the core library, CLI, and agent provider integrations in realistic framework environments before contributing changes. The main playgrounds are for Vite, Next.js, and a specialized environment for testing agent providers.
Sources: CONTRIBUTING.md:32-34, CONTRIBUTING.md:50-53
Playground Locations
All playgrounds are structured as individual packages within the packages/ directory of the monorepo. This organization cleanly separates the core library and tool logic from the testing applications.
Sources: CONTRIBUTING.md:30-46
The following diagram shows the location of the playgrounds within the project's package structure.
Sources: CONTRIBUTING.md:30-46
Development Workflow
Before running a playground, the project dependencies must be installed and all packages must be built. The standard development workflow is designed to ensure the environment is correctly set up.
Sources: CONTRIBUTING.md:13-28
This diagram illustrates the required setup and development process for using the playgrounds.
Sources: CONTRIBUTING.md:13-28, CONTRIBUTING.md:52-68
Available Playgrounds
There are three primary playgrounds for testing different aspects of react-grab.
Vite Playground
This playground provides a development environment using Vite and is intended for general testing of core react-grab functionality.
To run the Vite playground, use the following command:
pnpm --filter vite-playground dev
Sources: CONTRIBUTING.md:53-54, packages/vite-playground/package.json
Next.js Playground
This playground is configured for testing react-grab within a Next.js application, ensuring compatibility with its specific framework patterns.
To run the Next.js playground, use the following command:
pnpm --filter next-playground dev
Sources: CONTRIBUTING.md:56-57, packages/next-playground/package.json
Agent Playground
The Agent Playground is a specialized environment for testing the integration of react-grab with various AI coding agent providers. It runs at http://localhost:5174 and allows developers to test the provider API with multiple backends.
Sources: CONTRIBUTING.md:59-60, CONTRIBUTING.md:69-70
The workflow involves choosing an agent and running a specific command to launch the playground configured for that agent.
Agent Commands
Different commands are used to test each supported agent provider. The package name for this playground is @react-grab/agent-playground.
| Agent Provider | Command |
|---|---|
| Claude Code | pnpm --filter @react-grab/agent-playground dev:claude |
| Cursor | pnpm --filter @react-grab/agent-playground dev:cursor |
| OpenCode | pnpm --filter @react-grab/agent-playground dev:opencode |
| Codex | pnpm --filter @react-grab/agent-playground dev:codex |
| Gemini | pnpm --filter @react-grab/agent-playground dev:gemini |
| Amp | pnpm --filter @react-grab/agent-playground dev:amp |
| Ami | pnpm --filter @react-grab/agent-playground dev:ami |
Sources: CONTRIBUTING.md:61-68, packages/agent-playground/package.json
Summary
The playgrounds are an essential part of the react-grab development workflow. They provide robust, isolated environments for verifying changes and ensuring that the tool functions correctly across different frameworks and with various agent integrations. Using these playgrounds is a critical step for any developer looking to contribute to the project.
Sources: CONTRIBUTING.md:52-53, README.md:112-114