We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspired from #98 (comment) by @jgoux
With plugins, we can allow them to intercept to different hooks but also preserve their context. We can extend to more hooks if needed.
Example:
const telemetryPlugin = defineCittyPlugin(() => { const telemetry = new TelemetryClient(); return { name: 'telemetry', async setup() { telemetry.init(); await telemetry.captureEvent(`$command:${ctx.cmd.meta.name}:start`); }, async cleanup() { await telemetry.captureEvent(`$command:${ctx.cmd.meta.name}:end`); telemetry.flush(); } } }) defineCommand({ meta: { name: "hello", version: "1.0.0", description: "My Awesome CLI App", }, plugins: [telemetryPlugin], run({ args }) { console.log(`${args.friendly ? "Hi" : "Greetings"} ${args.name}!`); }, })
The text was updated successfully, but these errors were encountered:
Sounds good to me! 👍
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
inspired from #98 (comment) by @jgoux
With plugins, we can allow them to intercept to different hooks but also preserve their context. We can extend to more hooks if needed.
Example:
The text was updated successfully, but these errors were encountered: