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: 6 months 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 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-31T05:32:56.000Z (about 6 years ago)
- Last Synced: 2025-04-12T17:12:33.284Z (6 months ago)
- Topics: cli, fire, go, golang, google, python
- Language: Go
- Homepage:
- Size: 875 KB
- Stars: 39
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/corona10/fuego)
[](https://godoc.org/github.com/corona10/fuego)
[](https://goreportcard.com/report/github.com/corona10/fuego)
[](https://coveralls.io/github/corona10/fuego?branch=master)
[](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[](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.