fn

command module
v0.0.0-...-6932d60 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README ΒΆ


github.com/go-fn/fn
Fn

Introduction β€’ Getting Started β€’ Contributing β€’ Roadmap

Introduction

Fn is a "function-oriented" general purpose automation tool that aims to be simpler and more flexible than similar tools such as Make, Task, and Rake.

Fn aims to have a human-centered design, with emphasis on usability and aesthetics.

Even the smartest among us can feel inept as we fail to figure out which light switch or oven burner to turn on, or whether to push, pull, or slide a door. The fault lies not in ourselves, but in product design that ignores the needs of users and the principles of cognitive psychology.

The problems range from ambiguous and hidden controls to arbitrary relationships between controls and functions, coupled with a lack of feedback or other assistance and unreasonable demands on memorization.

The rules are simple: make things visible, exploit natural relationships that couple function and control, and make intelligent use of constraints.

The goal: guide the user effortlessly to the right action on the right control at the right time.

-- The Design of Everyday Things

An example to get you started:

fnfile.yml

version: '1'
fns:
  hello:
    do: echo "Hello, World!"
❯ fn hello
Hello, World

Getting Started

go install github.com/go-fn/fn

Features

✨ Functionality

Feature Explanation
ui An interactive UI that makes running fn easy, fun, and informative
cli POSIX compliant cli for use with automation
templating Leverage Go Templates as an alternative to shell commands
include Include content from local or remote fnfile.yml files.
outputs Tired of reading walls of log output? Fn supports a wide range of options for how output is presented, so you can find what you need, and move on.
watch Integration with viddy to watch a fn
fwatch Integration with fsnotify to provide "rerun" functionality when files change
src/gen Fingerprint files between runs, useful to skip expensive steps

πŸ”‘ Keywords

Keyword Description
fn A series of steps (aka function)
step An abstract behavior
sh A step that runs a shell command
do A step that runs other steps in sequence
parallel A step that runs other steps in parallel
defer A step that is run when the surround fn completes (success or failure)
matrix Dynamically defined steps
return A step that triggers the parent step to end early (such as when part of a do)
var A lazily evaluated (then optionally memoized/cached) value
ctx A collection of values that are available at different points in an fnfile
ns A namespace for fn's
serialgroup Control concurrency of step's or fn's through labelling

Contributing

TBD

Roadmap

Status Goal Labels
βœ… Create RoadMap
🚧 Implement Basic Step Types alpha
βœ… - Sh (shell out) alpha
βœ… - Do (serial steps) alpha
βœ… - Parallel (parallel steps) alpha
βœ… - Defer (end of parent) alpha
🚧 - Fn (call another function) alpha
🚧 Vars Support alpha
🚧 Env Support alpha
🚧 Ctx Support alpha
🚧 Templating Support alpha
- CLI Args Support alpha
- Linear Output (log-like) alpha
- Progress/Spinner Output alpha
- Robust Documentation (follows the code) alpha
- BubbleTea based UI beta
- Viddy/Watch Integration beta
- FSNotify Integration beta
- Implement Advanced Step Types beta
- - Matrix (dynamic steps based on combination matrix) beta
- - Return (end early) beta
- Other Advanced Features beta
- - Ns (namespaces/includes) beta
- - SerialGroups (for use with parallel) beta
- - Inputs/Outputs (for functions) beta

Attribution

Function icons created by Freepik - Flaticon

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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