ok

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 17 Imported by: 0

README

ok

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

Overview

ok automatically discovers tasks from various build tool configuration files in your project (like Makefile and package.json) and provides a single interface to run them all. No more remembering whether to use make build, npm run build, or another tool-specific command.

Features

  • Automatic task discovery - Scans your project for supported build tool files
  • Unified interface - Run tasks from any tool using the same command
  • Multiple tool support - Currently supports:
    • Just (Justfile)
    • Make (Makefile)
    • NPM (package.json scripts)
    • Yarn (yarn.lock + package.json scripts)
    • Rake (Rakefile)
    • Task (Taskfile.yml / Taskfile.yaml)

Installation

Homebrew
brew install broothie/ok/ok
Go Install
go install github.com/broothie/ok@latest

Usage

List all available tasks

Run ok without arguments to see all discovered tasks:

ok

This will show tasks from all supported tools in your project.

Run a task
ok <task-name> [args...]

For example:

ok build
ok test --verbose
ok start

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

Just
  • Discovers recipes from Justfile
  • Runs tasks using just <recipe>
Make
  • Discovers targets from Makefile
  • Runs tasks using make <target>
NPM
  • Discovers scripts from package.json
  • Runs tasks using npm run <script>
Yarn
  • Discovers scripts from package.json when yarn.lock is present
  • Runs tasks using yarn run <script> -- [args...]
Rake
  • Discovers tasks from Rakefile
  • Runs tasks using rake <task>
Task
  • Discovers tasks from Taskfile.yml / Taskfile.yaml
  • Runs tasks using task <task> -- [args...] (extra args become CLI_ARGS)

Development

Requirements
  • Go 1.25.6 or later
Build
go build
Test
go test ./...

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
	RunOptions func(ctx context.Context, args []string) (option.Options[*exec.Cmd], error)
}

type Tool

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

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