pimp

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 3 Imported by: 0

README

pimp

test status github go.dev

pimp is a shell-agnostic command expander and task runner with pattern matching, templating and scripting capabilities that increases your productivity.

Installation

Pre-built binaries

Download the appropriate binary from the latest release and install it where you see fit.

Note: the macOS binaries are not signed yet, you will have to open them through the GUI first.

Via the Go toolchain

If you have the Go toolchain on your machine, you can install the latest pimp release with the following command:

go install github.com/aymericbeaumet/pimp/cmd/pimp@latest

Usage

Pimpfile

Pimpfile are an important part of pimp. These YAML files allow you to configure command expansion and tasks with a simple and expressive syntax.

Read more about Pimpfiles in the documentation.

Command Expander

When pimp is used as a command expander, it's going to try to match the command and args it is being given with the patterns you have defined in your ~/.Pimpfile.

For example in this case, when git is passed (with no extra arguments), it is going to be expanded into git status -sb. If some arguments are passed, then it is going to be expanded to git <args>.

$ cat ~/.Pimpfile
git: git status -sb
git ...: git
$ pimp git # equivalent to `git status -sb`
$ pimp git log # equivalent to `git log`

Read more about command expansion in the documentation.

Task Runner

Following the same concept as command expansion (see above), you can also leverage pimp to behave as a task runner for your project. The Pimpfile in your local directory always has the highest priority.

For example this is how you would do if you wanted to define a

$ cat ./Pimpfile
test: go test ./...
$ pimp test

Read more about running tasks in the documentation.

Template Engine
$ pimp --render template.tmpl

Read more about how to use pimp as a stand-alone template engine in the documentation.

Script Engine (PimpScript)
$ pimp --run script.pimp

Read more about how to use pimp as a script engine in the documentation.

Go Library

Read more about how to import pimp as a Go library in the documentation.

Documentation

The documentation contains information regarding how you can get the most out of pimp.

Examples

The examples are available as references to help you start using pimp.

Development

The Go toolchain is required to work on this project.

Building
go build -o pimp .
Installing
go install .
Testing
go test -v ./...
Releasing

Pimp tasks are defined in the ./Pimpfile to release new versions. The release process is entirely automated and is being taken care of by the CI.

pimp major
pimp minor
pimp patch

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = funcs.FuncMap
View Source
var Render = template.Render
View Source
var Run = script.Run

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
pkg
funcs
Package funcs contains template functions which can be accessed from either Pimp scripts or Pimp template files.
Package funcs contains template functions which can be accessed from either Pimp scripts or Pimp template files.
funcs/git
Package git contains Git helper functions (https://git-scm.com/)
Package git contains Git helper functions (https://git-scm.com/)
funcs/http
Package http wraps part of the Go "net/http" package (https://golang.org/pkg/net/http/)
Package http wraps part of the Go "net/http" package (https://golang.org/pkg/net/http/)
funcs/kubernetes
Package kubernetes contains Kubernetes helper functions (https://kubernetes.io/)
Package kubernetes contains Kubernetes helper functions (https://kubernetes.io/)
funcs/prelude
Package prelude contains the most commonly used utility functions
Package prelude contains the most commonly used utility functions
funcs/semver
Package semver contains Semantic Versioning helper functions (https://semver.org/)
Package semver contains Semantic Versioning helper functions (https://semver.org/)
funcs/url
Package url wraps part of the Go "url" package (https://golang.org/pkg/url/)
Package url wraps part of the Go "url" package (https://golang.org/pkg/url/)

Jump to

Keyboard shortcuts

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