Skip to content

bturrubiates/axs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Small Go tool to simplify accessing machines.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published