/charmil

The framework for building modular plugin based CLI's using Cobra and Golang

Primary LanguageGoApache License 2.0Apache-2.0

Charmil

Go Reference example workflow Discord Server


Framework for building command line plugins on top of Golang Cobra Library

Introduction

Charmil provides an ecosystem to build production ready command line tools using the Cobra Framework. It is an SDK which allows for the creation of CLIs that all adhere to a similarly structured architecture. It provides a level of elasticity to add and/ or remove a plugin CLI or subset of commands from a plugin CLI to a main 'host' CLI.

Architecture

Charmil provides a way to build a CLI ecosystem where developers can build multiple fragmented CLI's in various repositories and embed them later in the single host CLI. Charmil provides core base functionality that helps to abstract various elements of the CLI ecosystem:

  • Logging
  • Authentication
  • Configuration
  • Commands and Flags standards.

Charmil SDK will typically be introduced into two different CLIs:

  • Host CLI - CLI that is being used by end-user that can embed one or more plugin CLIs
  • Plugin CLIs - Separate CLIs that can be embedded into the host CLI

Components

Charmil Plugin framework starter template

Creating Golang CLI should be easy and fast. Charmil starter template provides fast way to build plugins and host commands that use Charmil SDK and Validator. Starter template contains all tools and solutions required to build a command line tool

Charmil SDK

Framework for building modular, multi repo Golang CLI's with Cobra Number of high level implementations for individual CLI creators for common problems like configuration, authentication and internationalization Provides the ability to embed modular CLI into hosts CLI at compile time.

Charmil Validator

Charmil Validator gives developers the ability to validate a group of their cobra commands against common practices. A Validator can check if commands are providing proper documentation, don't have overridden flags or provide shell completions. A Validator can be used as go unit test and run during CI/CD that simplifies the review of CLI's that contain commands that are hosted in multiple repositories.

Charmil Command Registry

Charmil command registry lets you provide an external index of the command line tools that can be installed dynamically and embedded into your host CLI. Developers can create CLI profiles to install multiple individual CLI's at the same time and keep them updated with various backends like Kubernetes/OpenShift etc.

Under Construction

Contributing

We would love to have you contribute. For contributing guidance please refer to CONTRIBUTING.

Documentation

Visit the Charmil Documentation

License

Licensed under the Apache License 2.0