Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/corona10/fuego
fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.
https://github.com/corona10/fuego
cli fire go golang google python
Last synced: 1 day ago
JSON representation
fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.
- Host: GitHub
- URL: https://github.com/corona10/fuego
- Owner: corona10
- License: bsd-3-clause
- Created: 2018-03-31T13:12:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-31T05:32:56.000Z (about 5 years ago)
- Last Synced: 2024-06-20T12:43:01.109Z (4 months ago)
- Topics: cli, fire, go, golang, google, python
- Language: Go
- Homepage:
- Size: 875 KB
- Stars: 39
- Watchers: 5
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/corona10/fuego.svg?branch=master)](https://travis-ci.org/corona10/fuego)
[![GoDoc](https://godoc.org/github.com/corona10/fuego?status.svg)](https://godoc.org/github.com/corona10/fuego)
[![Go Report Card](https://goreportcard.com/badge/github.com/corona10/fuego)](https://goreportcard.com/report/github.com/corona10/fuego)
[![Coverage Status](https://coveralls.io/repos/github/corona10/fuego/badge.svg?branch=master)](https://coveralls.io/github/corona10/fuego?branch=master)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)# fuego
> Inspired by Google [python-fire](https://github.com/google/python-fire)fuego is a library for automatically generating command line interfaces (CLIs) from function and struct.
## Features
* fuego is a simple way to create a CLI in Go.
* fuego helps with exploring existing code or turning other people's code into a CLI. [[1]](_examples/example4.go)
* fuego shows documentation of each method or functions for help.## Installation
```bash
go get github.com/corona10/fuego
```## TODO
- Support flag options
- More error handling
- Support more types[![asciicast](https://asciinema.org/a/nSnLXpwctZtQgpNJ4u8zKTYdR.png)](https://asciinema.org/a/nSnLXpwctZtQgpNJ4u8zKTYdR)
## [Examples](/_examples)
```go
package mainimport (
"fmt""github.com/corona10/fuego"
)func Add(a int, b int) (int, int) {
fmt.Println(a, b)
return a + b, 2*a + b
}func main() {
fuego.Fire(Add)
}
``````go
package mainimport (
"fmt""github.com/corona10/fuego"
)type Sample struct {
Name string
}func (s Sample) Add(a, b int) int {
return a + b
}func (s Sample) Minus(a, b int) int {
return a - b
}func (s Sample) HelloWorld() {
fmt.Println(s.Name)
fmt.Println("Hello world!")
}func main() {
var s Sample
s.Name = "test"
fuego.Fire(s)
}
```## Special thanks to
* [Haeun Kim](https://github.com/haeungun/)
* [Sebastien Binet](https://github.com/sbinet): The contributor who proposed the name fuego.