Draft
Conversation
This plugin generates a full TypeScript client, React component library, and frontend app from an OpenAPI specification. Features: - Phase 1: Generate TypeScript client (types, API class, auth handlers) - Phase 2: Generate React components (Form, Detail, List per schema) - Phase 3: Generate React frontend app (routing, context, pages) - Phase 4: Generate comprehensive tests (unit, integration, e2e) - Phase 5: Generate GitHub Actions CI/CD workflows Additional capabilities: - Incremental updates when spec changes (surgical edits, not regeneration) - Support for API Key, Bearer Token, and OAuth2 authentication - E2E backend strategy detection (Docker, mock server, external URL) - Verification scripts for coverage and component completeness Co-authored-by: openhands <openhands@all-hands.dev>
- Uses OpenHands CLI in headless mode via Docker - Snapshots OpenAPI spec to track changes between runs - Initial run: generates full codebase - Subsequent runs: applies incremental updates - Creates PR with generated/updated code Co-authored-by: openhands <openhands@all-hands.dev>
- Install via uv tool install openhands - Run with openhands --headless -t for automation - Configure via ~/.openhands/settings.json Co-authored-by: openhands <openhands@all-hands.dev>
- Clones OpenHands/extensions repo to get the plugin - Installs plugin to ~/.openhands/plugins/ - OPENHANDS_EXTENSIONS_BRANCH variable defaults to 'main' - Task prompts now reference the installed plugin paths Co-authored-by: openhands <openhands@all-hands.dev>
- Rename command from generate-all.md to openapi-to-frontend.md - Single command handles both initial generation and incremental updates - Usage: /openapi-to-frontend new-spec.json [old-spec.json] - GitHub Action prompts now just reference the command file - All detailed instructions moved into the command itself Co-authored-by: openhands <openhands@all-hands.dev>
- Use correct settings.json format with LLM_MODEL, LLM_API_KEY, etc. - Default to ANTHROPIC_API_KEY secret and claude-opus-4-20250514 model - Add LLM_BASE_URL for custom API endpoints - Document how to use different LLM providers - Settings now properly created before running headless mode Co-authored-by: openhands <openhands@all-hands.dev>
- Remove settings.json file generation (not needed) - Use --override-with-envs flag with LLM_API_KEY and LLM_MODEL env vars - This is the correct way to configure OpenHands CLI in headless mode - Update configuration docs to explain env vars approach Co-authored-by: openhands <openhands@all-hands.dev>
Author
|
@OpenHands change the github action example in README.md to revert any changes to the .github/ directory before trying to push and open a PR |
|
I'm on it! rbren can track my progress at all-hands.dev |
The generated CI workflows could overwrite the sync-openapi workflow itself. This step ensures the .github/ directory is restored before pushing changes. Co-authored-by: openhands <openhands@all-hands.dev>
Author
|
Fixed in commit 6a0b87d. Added a step to revert any changes to the |
SummaryI've successfully addressed the PR comment requesting that the GitHub Action example in README.md revert changes to the Checklist
Changes Made+ - name: Revert changes to .github directory
+ if: steps.check-mode.outputs.mode == 'initial' || steps.check-changes.outputs.changed == 'true'
+ run: |
+ git checkout HEAD -- .github/ 2>/dev/null || true
+ echo "🔄 Reverted any changes to .github/ directory"Commit: PR: #109 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new plugin that generates a full TypeScript client, React component library, and frontend app from an OpenAPI specification.
Features
Five Generation Phases
skills/generate-client/) — Creates TypeScript types, API class with typed methods, and auth handlersskills/generate-components/) — Creates React Form, Detail, and List components for each schemaskills/generate-frontend/) — Creates a complete React app with routing, context providers, and pagesskills/generate-tests/) — Creates unit, integration, and e2e tests with mock factoriesskills/generate-ci/) — Creates GitHub Actions workflows for build, test, deploy, and publishIncremental Updates
The
update-from-specskill makes surgical edits when the OpenAPI spec changes, rather than regenerating everything. It uses thespec-differagent to classify changes and apply targeted modifications.Authentication Support
Supports three auth patterns:
E2E Backend Strategy
The test generation intelligently detects how to start the backend for e2e tests:
Plugin Structure
Marketplace Entry
Added to
marketplaces/default.jsonwith keywords: openapi, swagger, typescript, react, codegen, frontend, api, clientChecklist