gobot-age
TypeScript icon, indicating that this package has built-in type declarations

1.1.1-alpha.21 • Public • Published

Gobot

Age via npm

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

Part of the Gobot project.

Usage

Quick run

npx gobot age --version

Quick use

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

Basic version locking

npm i gobot-age

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

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

Locking to a specific version

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

npm i gobot-age@1.1.1

Override the default version imposed by this package

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

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

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

Pass environment variables

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

Install globally for CLI access

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

npm i -g gobot-age
age --help

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

CLI

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

age [options]

Age (https://age-encryption.org/) runner for Gobot (https://github.com/benallfree/gobot)

Options

Name Default Discussion
--g-v true Show informational output
--g-vv false Show even more output
--g-vvv false Show even more output
--g-cache-path host specific The cache path to use
--g-use-version * Run a specific binary version (format: x.y.z semver or x.y.* semver range)
--g-os host specific Specify OS/Platform
--g-arch host specific Specify OS/Platform

API

Full API docs

Sample project

View the Age sample project on github.

Try Gobot's other apps

Gobot has a growing list (currently 52) 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-age versions mirror age versions. Gobot knows about 14 releases of age:

Version freebsd darwin linux win32
1.1.1 x64 arm64/x64 arm64/x64/arm x64
1.1.0 x64 arm64/x64 arm64/x64/arm x64
1.1.0-rc.1 x64 arm64/x64 arm64/x64/arm x64
1.0.0 x64 arm64/x64 arm64/x64/arm x64
1.0.0-rc.3 x64 arm64/x64 arm64/x64/arm x64
1.0.0-rc.2 x64 arm64/x64 arm64/x64/arm x64
1.0.0-rc.1 x64 arm64/x64/arm x64
1.0.0-beta7 x64 arm64/x64/arm x64
1.0.0-beta6 x64 arm64/x64/arm x64
1.0.0-beta5
1.0.0-beta4
1.0.0-beta3
1.0.0-beta2 x64 arm64/x64/arm x64
1.0.0-beta1

Readme

Keywords

Package Sidebar

Install

npm i gobot-age

Weekly Downloads

2

Version

1.1.1-alpha.21

License

ISC

Unpacked Size

8.15 kB

Total Files

6

Last publish

Collaborators

  • benallfree