cmdeagle

command module
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

cmdeagle

WARNING: This is very much a work in progress, but we're close to releasing a stable version 1. Check back soon. Feedback is also much appreciated.

A versatile framework that allows users to build cross-platform command-line tools using the language of their choice. It's designed to simplify the process of creating complex CLI applications by referencing external scripts and binaries, using a YAML configuration file to define commands, arguments, flags, build commands and more.

Internally, it heavily leverages existing CLI libraries and tools such as:

Big thanks to @spf13 and @charmbracelet for their work on these libraries. Building cmdeagle was made possible with their contributions to the opensource community.

Prerequisites

You need to have Go installed to install cmdeagle and build CLIs. You can install Go by following the instructions at https://go.dev/doc/install.

Installation

go install github.com/migsc/cmdeagle
Install from source
git clone https://github.com/migsc/cmdeagle.git
cd cmdeagle
make build

Then add the following line to your .zshrc or .bashrc to make it easier to invoke cmdeagle directly. Then run source ~/.zshrc or source ~/.bashrc to apply the changes.

PATH="$PATH:PATH_TO_YOUR_CLONE_DIR/cmdeagle/sdk/bin"

Where PATH_TO_YOUR_CLONE_DIR is the path to the directory you cloned cmdeagle into.

Usage

  1. Initialize a new CLI project by running in a directory of your choice:
mdkir ./mycli && cd mycli
cmdeagle init

This will create a ..cmd.yaml file in your project root to define your CLI structure. The schema is not documented yet, but you can read the comments in the file to understand what each field does.

  1. Build your CLI:
cmdeagle build
  1. Run your CLI.
For Linux and macOS:

If you have ./.local/bin in your PATH you can simply run:

mycli

Otherwise you can run it like so:

cd
./.local/bin/mycli

If you need help setting up your PATH variable, add the following line in your .zshrc or .bashrc. This will make it easier to run your CLI by invoking it directly. Then run source ~/.zshrc or source ~/.bashrc to apply the changes.

PATH="$PATH:~/.local/bin"
For Windows

Docs coming soon.

Distribution

This tool does not help you with releasing or codesigning your resulting binary. It's highly recommendeded for you and your users' security that you do some sort of codesigning before distributing your CLI. You can use something like goreleaser to build and distribute your CLI for multiple platforms and handle codesigning. Worth noiting that cmdeagle itself uses this.

Contributing

This project is under active development. Contributions, ideas, and feedback are welcome! Please open an issue or submit a pull request on the GitHub repository.

License

MIT License

Documentation

Overview

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL