cmdeagle
v0.2.0
Published
A powerful and precise CLI framework for any lanaugage.
Downloads
5
Maintainers
Readme
cmdeagle
A versatile CLI framework that allows users to build command-line tools using JavaScript, TypeScript, and potentially other languages. It's designed to simplify the process of creating complex CLI applications by using a YAML configuration file to define commands, arguments, options, and actions.
Current Features
- YAML Configuration: Define your CLI structure using a simple YAML file.
- Import Support: Use
!import
statements in your YAML to modularize your CLI configuration. - Action Path Resolution: Automatically resolves paths to action scripts specified in the YAML configuration.
- Basic Bundling: Uses
esbuild
to bundle JavaScript/TypeScript code for the CLI runner. - Executable Creation: Utilizes
pkg
to create standalone executables that include the CLI runner and configuration.
npm install cmdeagle
Usage
- Create a
.cmd.yaml
file in your project root to define your CLI structure:
name: my-cli
version: 1.0.0
description: My awesome CLI tool
commands:
- name: hello
description: Say hello
action: ./actions/hello.js
- Create your action scripts (e.g.,
./actions/hello.js
):
export default function (args, cmd) {
console.log('Hello, world!');
}
- Build your CLI:
cmdeagle build
- Run your CLI:
./bin/my-cli hello
Current Limitations
- No support for non-JavaScript scripts.
- The build process currently focuses on bundling the CLI runner.
- TypeScript support is basic and may require manual compilation steps.
- Currently only support Linux.
Roadmap
- Enhance TypeScript support with automatic compilation.
- Improve handling of various file types (JavaScript, TypeScript, Python, Go etc.) in compiling schema-defined actions.
- Refine the YAML parser to handle more complex scenarios.
- Implement cross-platform compatibility.
- Expand documentation and add more examples.
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 (no yet public).