axs

command module
v0.0.0-...-5c39182 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: MIT Imports: 8 Imported by: 0

README

axs -- Simplifying access

axs is a small tool to simplify accessing machines.

Why?

I frequently find myself using ephemeral development setups that are configured with conveniences such as serial connections to the host, serial connections to pieces of hardware, ssh accessible BMC, ssh accessible power strips, etc. axs allows defining groups of machines and providing ways to access the various subsystems available in a hierarchical fashion.

Installation

go install github.com/bturrubiates/axs

Configuration

axs expects to find the list of machines in a configuration file. By default, the configuration file lives at $HOME/.axsrc.json. The configuration file could be JSON, YAML, TOML, or anything else that Viper supports. I personally prefer to use JSON, but it shouldn't matter.

Access methods should be specified using URL format. Currently only SSH and telnet are supported.

Usage

ben at yggdrasil :: ./axs -h
Usage: ./axs [OPTIONS] target
  -config string
        Config file. (default "$HOME/.axsrc.json")
  -list
        List targets.
  -resolve
        Resolve command.

Passing the -resolve flag with a target will generate the access command, but will print it instead of executing it.

Completions

Completions are only available for zsh. Download the completion/axs.zsh file and source it in your ~/.zshrc.

Example

Given the following configuration:

{
    "cc1": {
        "bay-a": {
            "host": "ssh://ben@bay-a:22",
            "serial": "telnet://bay-a:23"
        },
        "bay-b": {
            "host": "ssh://[email protected]",
            "bmc": "ssh://[email protected]"
        }
    }
}
ben at yggdrasil :: ./axs -config config.json -resolve cc1.bay-a.host
ssh -p 22 ben@bay-a

The target given must resolve to a string, otherwise axs will error:

ben at yggdrasil :: ./axs -config config.json -resolve cc1.bay-a
2017/07/11 22:43:11 target not found

Documentation

Overview

Axs (pronounced access) implements a simple machine manager. The configuration file by default is found at $HOME/.axsrc.json. An example of the configuration file format:

{
	"cc1": {
		"bay-a": {
			"host": "ssh://ben@bay-a:22",
			"serial": "telnet://bay-a:23"
		},
		"bay-b": {
			"host": "ssh://[email protected]",
			"bmc": "ssh://[email protected]"
		}
	}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL