@prmichaelsen/invoker
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

Invoker

NPM version NPM downloads

Execute bash commands using natural language.

img

Features

  • invoker starts an interactive terminal emulator which accepts natural language as input and executes a command that implements the intent of the input.
  • Prefix input with ? to enable confirmation before command execution.
  • invoker -f <input> to execute immediately
  • invoker -fs <input> to execute immediately and only output command results

Why use Invoker?

Invoker is nice when you need a command that you rarely use or that has non-straightforward syntax.

For instance, instead of typing:

find . type -f -name package.json -exec grep -l '@prmichaelsen' {} +

You can simply type:

Search this directory for a package.json that contains the text "@prmichaelsen"

Invoker will then construct a command designed to execute your intent, as demonstrated below.

img

Installation & Setup

npm i -g @prmichaelsen/invoker

Initial Setup

Invoker is built on AWS Bedrock Claude Anthropic v2 and it requires CLI authentication with an AWS profile authorized to call Bedrock in order to work. See the AWS docs on CLI authentication.

aws sso login --profile my-profile

If you aren't authenticated and authorized, Invoker will throw an error during usage.

Usage

Interactive Mode
invoker
Say Hi
echo Hi
Hi

Prompt to confirm before running:

invoker
? Say Hi
echo Hi (y/N)
y
Hi

Command Line Mode

invoker "Say Hi"
echo Hi

Pipe output:

invoker "Say Hi" | sh
Hi

Prompt to confirm before running:

invoker "? Say Hi"
echo Hi (y/N)
y
Hi

Demos

Hello World

img

Command confirmation

Invoker supports command confirmation by prefixing your input with ?.

img

Complex git workflow

With Invoker, you can focus on your workflow and less on memorizing commands and flags.

img

img

Miscellaneous

Invoker is very useful for commands that you do not often have to run, such as lsof -i. It's not a difficult command to remember, but if you only use it every few months, you'll find yourself looking it up each time you need to use it.

img

Invoker is a great learning tool as well. It enables beginners to effectively use the command line while also picking up new commands along the way.

img

Invoker's use cases are innumerable. You can automate the most trivial of tasks with very little effort.

img

img

⚠️ Warning

If you're not careful, Invoker can destroy your computer entirely.

Never use Invoker with sudo.

Use extra caution when executing any commands with side effects.

Make sure to prefix input with ? as necessary.

Use at your own risk.

Package Sidebar

Install

npm i @prmichaelsen/invoker

Weekly Downloads

0

Version

0.5.1

License

none

Unpacked Size

9.9 MB

Total Files

4

Last publish

Collaborators

  • prmichaelsen