webiny-cli-extensions
Fungsinya
Skill ini membantu AI Anda membuat perintah baru untuk alat baris perintah Webiny. Skill ini untuk developer yang ingin skrip mereka berjalan melalui CLI proyek.
Kapan dipakai
- ✓Saat Anda membutuhkan perintah kustom untuk migrasi data atau ekspor konten.
- ✓Saat Anda membutuhkan generator kode atau pembantu deployment di dalam CLI Webiny.
- ✓Saat Anda ingin perintah pemeriksaan kesehatan yang menampilkan output terminal yang jelas.
Link skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/cli-extensions/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Tambahkan perintah CLI Webiny yang mengekspor semua entri blog ke file JSON.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini menjelaskan kelas perintah dengan nama, deskripsi, parameter yang bertipe, dan handler. Handler mencetak pesan melalui pembantu terminal, dan perintah didaftarkan di file konfigurasi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
CLI Extensions
TL;DR
Add custom commands to the Webiny CLI using the CliCommandFactory pattern. Define a class implementing CliCommandFactory.Interface<TParams>, specify command name, description, params, and handler, then export with CliCommandFactory.createImplementation(). Register in webiny.config.tsx via <Cli.Command>.
The CliCommandFactory Pattern
// extensions/MyCustomCommand.ts
import { Ui } from "webiny/cli";
import { CliCommandFactory } from "webiny/cli/command";
export interface IMyCustomCommandParams {
name: string;
}
class MyCustomCommandImpl implements CliCommandFactory.Interface<IMyCustomCommandParams> {
constructor(private ui: Ui.Interface) {}
execute(): CliCommandFactory.CommandDefinition<IMyCustomCommandParams> {
return {
name: "my-custom-command",
description: "This is my custom command",
examples: ["$0 my-custom-command test1", "$0 my-custom-command test2"],
params: [
{
name: "name",
description: "Your name",
type: "string"
}
],
handler: async params => {
this.ui.info("Starting my custom command...");
this.ui.emptyLine();
this.ui.success(`Hello, ${params.name}! This is my custom command.`);
}
};
}
}
export default CliCommandFactory.createImplementation({
implementation: MyCustomCommandImpl,
dependencies: [Ui]
});
Register in webiny.config.tsx (YOU MUST include the .ts file extension in the src prop — omitting it will cause a build failure):
<Cli.Command src={"/extensions/MyCustomCommand.ts"} />
Run it:
yarn webiny my-custom-command "World"
Command Definition Properties
| Property | Type | Description |
|---|---|---|
name |
string |
The command name used on the CLI (e.g., "my-custom-command") |
description |
string |
Help text shown when listing commands |
examples |
string[] |
Usage examples ($0 is replaced with the CLI binary name) |
params |
ParamDefinition[] |
Positional parameters and options |
handler |
(params: TParams) => Promise<void> |
The function that executes the command |
Parameter Definition
Each param in the params array:
| Property | Type | Description |
|---|---|---|
name |
string |
Parameter name (matches the key in your TParams interface) |
description |
string |
Help text for this parameter |
type |
"string" | "number" | "boolean" |
Parameter value type |
The Ui Service
Inject Ui for formatted terminal output:
import { Ui } from "webiny/cli";
| Method | Description |
|---|---|
this.ui.info("message") |
Print an info message (blue) |
this.ui.success("message") |
Print a success message (green) |
this.ui.warning("message") |
Print a warning message (yellow) |
this.ui.error("message") |
Print an error message (red) |
this.ui.emptyLine() |
Print a blank line for spacing |
Use Cases
- Data migrations -- Scripts to migrate or seed CMS data
- Code generators -- Generate boilerplate extension files
- Deployment scripts -- Custom deployment workflows
- Data exports -- Export CMS content to files
- Health checks -- Verify infrastructure or API status
Quick Reference
Import: import { CliCommandFactory } from "webiny/cli/command";
Ui import: import { Ui } from "webiny/cli";
Interface: CliCommandFactory.Interface<TParams>
Definition: CliCommandFactory.CommandDefinition<TParams>
Export: CliCommandFactory.createImplementation({ implementation, dependencies })
Registe
Pertanyaan umum
Bagaimana perintah didaftarkan?
Dengan pengaturan command di file konfigurasi webiny.
Bagaimana parameter didefinisikan?
Setiap parameter memiliki nama, deskripsi, dan tipe.
Bagaimana perintah menampilkan output?
Melalui pembantu terminal yang mencetak info, pesan sukses, dan baris kosong.
Detail
Deskripsi asli dari pembuat
Adding custom commands to the Webiny CLI using CliCommandFactory. Use this skill when the developer wants to create a custom CLI command, add a data migration script, build a code generator, create deployment scripts, export CMS content, or add health check commands. Covers CliCommandFactory.Interface, command definition, typed parameters, the Ui service for terminal output, and registration via <Cli.Command>.
repo: webiny/webiny-js
Popularitas
- Bintang GitHub
- 8.1k
- Peringkat
- #12593
- Lisensi
- —
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
prd-to-plan
8.1kMembantu agent Anda mengubah dokumen kebutuhan produk menjadi rencana bertahap yang terdiri dari irisan kecil dari ujung ke ujung, disimpan sebagai berkas Markdown.
webiny-admin-architect
8.1kMengajari agent Anda cara membangun layar admin untuk platform Webiny, dengan memakai lapisan logika bisnis dan pola presenter.
webiny-admin-permissions
8.1kMengajari agent Anda menambahkan kontrol izin ke layar admin Webiny, termasuk formulir izin yang dibuat otomatis dan pemeriksaan tampilkan atau sembunyikan.
webiny-form-model
8.1kMengajari agent Anda membangun formulir di Webiny dengan pembuat field deklaratif, tata letak, validasi, dan aturan bersyarat.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.