confetti-framework / commands

Command line interface for your CLI project. This repository contains configuration files and is intended as a template for your codebase. Download these configuration files and include them in your git repository.

Home Page:https://confetti-framework.github.io/docs/digging-deeper/commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confetti Commands

Use this template for your CLI project. Particularly suitable for a CI project.

This code contains a few files to get started on your CLI project. If you want more functionalities, it is better to use Confetti Framework.

Documentation

Confetti Commands has extensive and thorough documentation, making it a breeze to get started.

Example

package commands

import (
	"src/app/mail_driver"
	"github.com/confetti-framework/framework/inter"
	"io"
)

type SendEmails struct {
	Email string `flag:"email" required:"true"`
}

func (s SendEmails) Name() string {
	return "mail:send"
}

func (s SendEmails) Description() string {
	return "Send a marketing email to a user."
}

func (s SendEmails) Handle(c inter.Cli) inter.ExitCode {
	mailer := mail_driver.DripEmailer{}
	mailer.Send(s.Email)

	c.Info("Email send to: %s", s.Email)

	return inter.Success
}

License

Confetti is open-sourced software licensed under the MIT license.

About

Command line interface for your CLI project. This repository contains configuration files and is intended as a template for your codebase. Download these configuration files and include them in your git repository.

https://confetti-framework.github.io/docs/digging-deeper/commands

License:MIT License


Languages

Language:Go 100.0%