CLI to create Vertesia plugins: UI plugins or tool servers
npm install @vertesia/create-pluginCLI tool to create Vertesia plugins:
- UI Plugins
- Tool Server Plugins.
``bashUsing pnpm create (recommended)
pnpm create @vertesia/plugin my-project
Note: When using
pnpm create or npm create, drop the create- prefix from the package name.Features
- ๐ฆ Downloads template from GitHub - Always get the latest template
- โ๏ธ Template-driven configuration - Template defines its own prompts via
template.config.json
- ๐จ Interactive prompts - User-friendly CLI with validation
- ๐ Variable replacement - Automatically replaces {{VARIABLES}} in files
- ๐งน Smart cleanup - Removes meta files after installation
- ๐ Package manager agnostic - Works with npm, pnpm, or yarnHow It Works
1. Downloads the template repository from GitHub using
degit
2. Reads template.config.json from the template to determine configuration
3. Prompts the user for values (project name, description, etc.)
4. Replaces variables in specified files (e.g., {{PROJECT_NAME}} โ my-project)
5. Cleans up meta files (.git, template.config.json, etc.)
6. Installs dependencies using the configured package managerConfiguration
All configuration is centralized in
src/configuration.ts:`typescript
export const config = {
templateRepo: 'vertesiahq/plugin-template',
templateConfigFile: 'template.config.json',
packageManager: 'pnpm',
// ... more options
}
`$3
-
templateRepo - GitHub repository for the template (format: owner/repo)
- templateConfigFile - Name of the config file in the template
- packageManager - Which package manager to use (npm, pnpm, or yarn)
- useCache - Whether to cache downloaded templatesTemplate Structure
The template repository should include a
template.config.json file:`json
{
"version": "1.0",
"prompts": [
{
"type": "text",
"name": "PROJECT_NAME",
"message": "Project name",
"initial": "my-tool-server"
},
{
"type": "text",
"name": "DESCRIPTION",
"message": "Project description",
"initial": "A tool server for LLM integrations"
}
],
"files": [
"package.json",
"README.md",
"src/server.ts"
],
"removeAfterInstall": [
".git",
"template.config.json"
]
}
`$3
-
prompts - Array of prompts using the prompts library format
- files - List of files where variable replacement should occur
- removeAfterInstall - Files/directories to remove after installation
- conditionalRemove - Conditional file removal based on user answersDevelopment
`bash
Install dependencies
pnpm installBuild
pnpm buildTest locally
pnpm testWatch mode
pnpm dev
`Publishing
`bash
Build and publish
npm publish
`After publishing, users can create projects with:
`bash
pnpm create @vertesia/plugin my-project
`Template Development
To develop a template:
1. Create a GitHub repository with your template files
2. Add a
template.config.json file with prompts and configuration
3. Use {{VARIABLES}} in files where you want replacements
4. Update src/configuration.ts to point to your template repo
5. Test with pnpm test or run the built CLI directlyExamples
$3
`bash
pnpm create @vertesia/plugin my-project
`$3
`bash
pnpm dlx @vertesia/plugin --help
``MIT