Skip to content

feat(plugin): add 'plugin create <name>' scaffold command#494

Merged
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:feat/plugin-create-scaffold
Mar 27, 2026
Merged

feat(plugin): add 'plugin create <name>' scaffold command#494
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:feat/plugin-create-scaffold

Conversation

@ByteYue
Copy link
Copy Markdown
Collaborator

@ByteYue ByteYue commented Mar 27, 2026

Feature

Generate a ready-to-develop plugin directory with all required files:

opencli plugin create my-plugin
opencli plugin create my-plugin --dir /path/to/dir
opencli plugin create my-plugin --description 'My awesome plugin'

Generated files

File Purpose
opencli-plugin.json Manifest with name, version, opencli compatibility
package.json ESM package with @jackwener/opencli peer dependency
hello.yaml Sample YAML command using httpbin
greet.ts Sample TS command using cli() registration API
README.md Install, usage, and development instructions

Changes

  • New plugin-scaffold.ts module with createPluginScaffold()
  • plugin create subcommand registered in cli.ts
  • 5 test cases in plugin-scaffold.test.ts

Testing

All 342 unit tests pass (5 new tests).

ByteYue and others added 2 commits March 27, 2026 11:51
Generate a ready-to-develop plugin directory with all required files:
- opencli-plugin.json (manifest with name, version, compatibility)
- package.json (ESM, peer dependency on @jackwener/opencli)
- hello.yaml (sample YAML command using httpbin)
- greet.ts (sample TS command using cli() API)
- README.md (install, usage, and development instructions)

Usage:
  opencli plugin create my-plugin
  opencli plugin create my-plugin --dir /path/to/dir
  opencli plugin create my-plugin --description 'My awesome plugin'

Includes 5 test cases for scaffold generation and error handling.
@jackwener jackwener merged commit fa4c44a into jackwener:main Mar 27, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants