ok

package module
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 18 Imported by: 0

README

👌 ok

A unified task runner that discovers and executes tasks from multiple build tools.

Currently supports:

Installation

Install Script (Linux/macOS)
curl -sSL https://raw.githubusercontent.com/broothie/ok/main/install.sh | sh

Or download and inspect first:

curl -sSL https://raw.githubusercontent.com/broothie/ok/main/install.sh -o install.sh
sh install.sh
Homebrew
brew install broothie/ok/ok
Go Install
go install github.com/broothie/ok@latest

Usage

List all available tasks
$ ok
TASK        TOOL   FILE
test-just   Just   Justfile
test-make   Make   Makefile
test-npm    NPM    package.json
test-rake   Rake   Rakefile
test-shell  Shell  test-shell.sh
test-task   Task   Taskfile.yml
test-yarn   NPM    package.json
Run a task
ok <task-name> [args...]

ok will automatically find the task and run it with the appropriate tool, passing along any additional arguments. For example:

$ ok test-npm

> test-npm
> echo 'from npm'

from npm
Help
$ ok -h
ok v0.3.2

Usage:
  ok [options] <task> [task args]

Options:
  -V  --version            Print command version.                                                 (default: false)
  -h  --help               Show command help.                                                     (default: false)
  -d  --directory          Directory to run command from.                                         (default: .)
      --timeout            Command timeout.                                                       (default: 5s)
      --filter-tools --ft  Filter tools by case-insensitive name. Use commas for multiple values  (default: )
      --list-tools         List tools.                                                            (default: false)
      --load-dot-env       Pick up local .env files.                                              (default: true)
      --debug              Output debug logs.                                                     (default: false)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Types

type Ok

type Ok struct {
	// contains filtered or unexported fields
}

func New

func New() *Ok

func (*Ok) ListTasks

func (o *Ok) ListTasks(w io.Writer) error

func (*Ok) ListTools

func (o *Ok) ListTools(w io.Writer) error

func (*Ok) RunTask

func (o *Ok) RunTask(ctx context.Context, taskName string, remainingArgs []string) error

func (*Ok) SetUpTasks

func (o *Ok) SetUpTasks(ctx context.Context) error

func (*Ok) SetUpTools

func (o *Ok) SetUpTools(ctx context.Context, tls []Tool) error

type Task

type Task struct {
	Name        string
	Description string
	RunOptions  func(ctx context.Context, args []string, toolCfg ToolConfig) (option.Options[*exec.Cmd], error)
}

type Tool

type Tool struct {
	Name        string
	CommandName string
	FileGlobs   []string
	ProcessFile func(ctx context.Context, filePath string, toolCfg ToolConfig) ([]Task, error)
}

type ToolConfig added in v0.3.6

type ToolConfig struct {
	Executable string
	Rest       map[string]string
}

Directories

Path Synopsis
cmd
ok command
nx

Jump to

Keyboard shortcuts

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