axolgo-cli

command module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 1 Imported by: 0

README

axolgo-cli, the Axolotl CLI Library in Golang

Release
Code Quality
Activity
License

This is the CLI library of the Axolotl series in Golang. Command is designed to fit daily operational usage and the sub-command is added for better experience. You may configure axolgo through configuration file or command line parameters.

Go package: https://pkg.go.dev/github.com/tchiunam/axolgo-cli

Use it with your Go module

To add as dependency for your package or upgrade to the latest version:

go get github.com/tchiunam/axolgo-cli

To upgrade or downgrade to a specific version:

go get github.com/tchiunam/axolgo-cli@v1.2.3

To remove dependency on your module and downgrade modules:

go get github.com/tchiunam/axolgo-cli@none

See 'go help get' or https://golang.org/ref/mod#go-get for details.

Build

Download the source and run:

go build -o axolgo

See 'go help build' or https://golang.org/ref/mod#go-build for details.

Install

To install latest version:

go install github.com/tchiunam/axolgo-cli@latest

To build and install version in module-aware mode:

go install github.com/tchiunam/axolgo-cli@v1.2.3

See 'go help install' or https://golang.org/ref/mod#go-install for details.

Run test

To run test:

go test ./...

To run test with coverage result:

go test -coverpkg=./... ./...

Examples

AWS

To update database cluster parameter group:

axolgo aws rds modifyDBClusterParameterGroup --name <parameter_group_name> --parameter-file <yaml_file_containing_parameters>

To describe EC2 instances with given Instance IDs:

axolgo aws ec2 describeInstances --instance-id <instance_id> --instance-id <instance_id>

To describe EC2 instances with given Private IP Addresses:

axolgo aws ec2 describeInstances --private-ip-address 127.0.0.1 --private-ip-address 127.0.0.2
GCP

To list all compute engine instances in a zone:

axolgo gcp compute listInstances --project proj1 --zone asia-east1-a

To list compute engine instances with the given ID:

axolgo gcp compute listInstances --project proj1 --zone asia-east1-a --id 7452065390813417482
Cryptography

To encrypt a message:

axolgo cryptography encrypt --key-file secret.key --message "Galaxy is a big space where there are many planets and stars."

You will be prompted to enter the passphrase and message if you don't provide them as parameters:

axolgo cryptography encrypt
Enter passphrase: 
Enter message to be encrypted. Enter a new line and press Ctrl+D to finish:
<message here>

To decrypt a message:

axolgo cryptography decrypt --key-file secret.key --message 5602259f17f41c7a1289d26c4cc540bdfe939a93d4f01f4f6830739f2488c04e7875890280d966a3509217b73e290c2bcdbbf2b8676395bd87ae000dcac8343ac3cf3e389968e185f96810302947ea6809d62dfee404e318d2

You will be prompted to enter the passphrase and message if you don't provide them as parameters:

axolgo cryptography decrypt
Enter passphrase: 
Enter message to be decrypted. Enter a new line and press Ctrl+D to finish:
<message here>

Test report

Code Coverage graph

Code Coverage graph


See more
  1. axolgo-lib for the base library
  2. axolgo-cloud for using cloud library (AWS SDK and GCP API)

License

FOSSA Status

Documentation

Overview

Copyright © 2022 tchiunam

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
pkg
cmd

Jump to

Keyboard shortcuts

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