/oopsiee-cli

A CLI tool for oopsiee-server. Simplifies daily operations and on-call duty by letting you run repeated and cumbersome tasks with one-liners.

Primary LanguageTypeScript

oOPSiee 🙈

oOPSiee CLI Version Build Status Dependencies Status

A CLI tool for oopsiee-server. Simplifies daily operations and on-call duty by letting you run repeated and cumbersome tasks with one-liners.

  • Supports synchronous commands

  • Supports asynchronous jobs

  • Easily extensible

  • Simple installation and configuration

  • Comes with help entries

  • Runs on all platforms

  • Uses private/public key authentication

    • Supports encrypted private keys and integrates with ssh-agent

  • Written in TypeScript

  • Semi-automatic dependency updates with Dependabot


Installation

Homebrew

brew install edosrecki/tools/oopsiee

# To update:
brew upgrade oopsiee

Releases

Download a corresponding distribution from Releases and add the executable to your PATH.

Build from source

Optionally, you can also build it from source by building and packaging it manually - see Build and Package sections.

Usage

Configure

  1. Add your public key to oopsiee-server.

  2. Log into oopsiee-cli:

> oopsiee login
? Username: foobar
? Private key file path: ~/.ssh/id_rsa

Encrypted private key?

Encrypted private keys are supported via ssh-agent, which needs to be configured:

oopsiee config set user.ssh-agent-socket <SSH_AGENT_SOCKET>

Help

oopsiee help
oopsiee help <COMMAND>

Run command

# Run synchronously/asynchronously (whichever is default for command)
oopsiee <COMMAND> [ARGS] [OPTS]

# Force command to run synchronously
oopsiee <COMMAND> [ARGS] [OPTS] --sync

# Force command to run asynchronously
oopsiee <COMMAND> [ARGS] [OPTS] --async

# Fetch results of asynchronous command execution
oopsiee job <ID>

Run

Development mode

npm run exec:dev -- <COMMAND> [ARGS] [OPTS]

Distribution mode

npm run exec:dist -- <COMMAND> [ARGS] [OPTS]

Build

npm run clean
npm run build

Package

Pre-configured

# Packages for Node.JS 12 on MacOS, Linux, and Windows
npm run bundle

Manual

See pkg for details.

npx pkg <NODE_RANGE>-<PLATFORM>-<ARCH>

# Examples
npx pkg node8-macos-x64
npx pkg node10-linux-x86
npx pkg node6-win-x64

Test

npm test
npm run test:watch

Deploy

To deploy a new version of oopsiee-cli, merge master branch into release branch. New version will automatically get released by CI system.