0.50.0-alpha.23 • Published 5 months ago

gobot-fzf v0.50.0-alpha.23

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Gobot

npm.io npm.io npm.io npm.io

fzf via npm

This package allows you to use fzf as an npm dependency.

Part of the Gobot project.

Usage

Quick run

npx gobot fzf --version

Quick use

npm i gobot
import { gobot } from 'gobot'
const bot = await gobot(`fzf`)
const exitCode = await bot.run([`--version`])

Basic version locking

npm i gobot-fzf

With gobot-fzf present, Gobot will default to the fzf version corresponding to the gobot-fzf version you installed. Now you can use fzf as a real dependency.

import { gobot } from 'gobot'
const bot = await gobot(`fzf`)
const exitCode = await bot.run([`--version`])

Locking to a specific version

The gobot-fzf package version always mirrors the underlying fzf version:

npm i gobot-fzf@0.50.0

Override the default version imposed by this package

In rare cases, you may want to intentionally run a different version of fzf even though gobot-fzf is installed.

// Run a specific version (override)
const bot = await gobot(`fzf`, { version: `0.50.0` })
const exitCode = await bot.run([`--version`])

// Or the latest version (override)
const bot = await gobot(`fzf`, { version: `*` })
const exitCode = await bot.run([`--version`])

Pass environment variables

import { gobot } from 'gobot'
const bot = await gobot(`fzf`, {
  env: process.env, // This is not always necessary, but some apps do need it
})
const exitCode = await bot.run([`--version`])

Access the child process

import { gobot } from 'gobot'
const bot = await gobot(`fzf`, {
  env: process.env,
})
const exitCode = await bot.run(
  [`--help`],
  { cwd: `./foo` }, // SpawnOptions
  (proc) => {
    // ChildProcess
    proc.stdout.on('exit', (code) => {
      console.log(`process has exited`)
    })
  },
)

Install globally for CLI access

Exactly one gobot-fzf can be installed globally. It will receive a bin alias:

npm i -g gobot-fzf
fzf --help

# Upgrade to  @latest or any version
npm i -g gobot-fzf@latest

CLI

gobot-fzf comes with a bin shortcut for CLI usage.

fzf [options]

fzf (https://github.com/junegunn/fzf) runner for Gobot (https://github.com/benallfree/gobot)

Options

NameDefaultDiscussion
--g-vtrueShow informational output
--g-vvfalseShow even more output
--g-vvvfalseShow even more output
--g-cache-pathhost specificThe cache path to use
--g-use-version*Run a specific binary version (format: x.y.z semver or x.y.* semver range)
--g-oshost specificSpecify OS/Platform
--g-archhost specificSpecify OS/Platform

API

Full API docs

Sample project

View the fzf sample project on github.

Try Gobot's other apps

Gobot has a growing list (currently 53) of official apps. Have you tried them all?

Getting Help

Join our Discord community.

Why?

If you are writing a nodejs application that depends upon binaries being present (like PocketHost does), you can add this package as a dependency and execute the binary via CLI or programmatically. This package will make sure your desired external binaries are always available.

If you just want to grab a binary quickly for your own use, npx gobot@latest <app> is quite a bit easier than manually downloading zips and installing binaries in shell paths. Gobot handles it all for you effortlessly.

Adding your app to the Gobot registry

We want to add native support for lots of binary apps!

If you use publish statically linked binary releases on github, you are already 98% compatible with Gobot. In fact, Gobot may already know how to work with it.

To see what initial support looks like:

npx gobot inspect <user>/<repo>

This will index all the releases from your repo and show you exactly what Gobot sees.

If you see everything you expect, you're golden. If things are missing, it may mean some custom programming. Either way, jump on Discord and let us know your results.

If you have the flexibility or are starting a new project, make sure your release names follows these rules:

  • Ends in .zip, .tgz, .tar.gz, .bz2
  • Include the version (semver recommended)
  • Include the platform (freebsd, darwin, linux, win32)
  • Include the architecture (arm64, x64, ia32, arm)

Note: GoReleaser is a great option if you're publish a Go-based project.

Contributing

We could use help testing and making sure this works across lots of platforms.

To test a build locally:

pnpm test

All known releases

gobot-fzf versions mirror fzf versions. Gobot knows about 41 releases of fzf:

Versionfreebsddarwinlinuxwin32
0.50.0x64arm64/x64arm64/x64/armx64/arm64
0.49.0x64arm64/x64arm64/x64/armx64/arm64
0.48.1x64arm64/x64arm64/x64/armx64/arm64
0.48.0x64arm64/x64arm64/x64/armx64/arm64
0.47.0x64arm64/x64arm64/x64/armx64/arm64
0.46.1x64arm64/x64arm64/x64/armx64/arm64
0.46.0x64arm64/x64arm64/x64/armx64/arm64
0.45.0x64arm64/x64arm64/x64/armx64/arm64
0.44.1x64arm64/x64arm64/x64/armx64/arm64
0.44.0x64arm64/x64arm64/x64/armx64/arm64
0.43.0x64arm64/x64arm64/x64/armx64/arm64
0.42.0x64arm64/x64arm64/x64/armx64/arm64
0.41.1x64arm64/x64arm64/x64/armx64/arm64
0.41.0x64arm64/x64arm64/x64/armx64/arm64
0.40.0x64arm64/x64arm64/x64/armx64/arm64
0.39.0x64arm64/x64arm64/x64/armx64/arm64
0.38.0x64arm64/x64arm64/x64/armx64/arm64
0.37.0x64arm64/x64arm64/x64/armx64/arm64
0.36.0x64arm64/x64arm64/x64/armx64/arm64
0.35.1x64arm64/x64arm64/x64/armx64/arm64
0.35.0x64arm64/x64arm64/x64/armx64/arm64
0.34.0x64arm64/x64arm64/x64/armx64/arm64
0.33.0x64arm64/x64arm64/x64/armx64/arm64
0.32.1x64arm64/x64arm64/x64/armx64/arm64
0.32.0x64arm64/x64arm64/x64/armx64/arm64
0.31.0x64arm64/x64arm64/x64/armx64/arm64
0.30.0x64arm64/x64arm64/x64/armx64/arm64
0.29.0x64arm64/x64arm64/x64/armx64/arm64
0.28.0x64arm64/x64arm64/x64/armx64/arm64
0.27.3x64arm64/x64arm64/x64/armx64
0.27.2x64arm64/x64arm64/x64/armx64
0.27.1x64arm64/x64arm64/x64/armx64
0.27.0x64arm64/x64arm64/x64/armx64
0.26.0x64arm64/x64arm64/x64/armx64
0.25.1x64x64arm64/x64/armx64
0.25.0x64x64arm64/x64/armx64
0.24.4x64x64arm64/x64/armx64
0.24.3x64x64arm64/x64/armx64
0.24.2x64x64arm64/x64/armx64
0.24.1x64x64arm64/x64/armx64
0.24.0x64x64arm64/x64/armx64
0.50.0-alpha.23

5 months ago

0.50.0-alpha.22

7 months ago

0.49.0-alpha.21

9 months ago

0.48.1-alpha.20

9 months ago

0.48.1-alpha.19

9 months ago

0.48.1-alpha.18

9 months ago

0.48.1-alpha.12

9 months ago

0.48.1-alpha.11

9 months ago

0.48.1-alpha.14

9 months ago

0.48.1-alpha.13

9 months ago

0.48.1-alpha.16

9 months ago

0.48.1-alpha.15

9 months ago

0.48.1-alpha.17

9 months ago

0.48.1-alpha.10

9 months ago