Coder Social home page Coder Social logo

inkel / consul-catalog Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 2 KB

Queries Consul catalog and print out registered nodes and services. Useful for tab completion.

License: MIT License

Go 100.00%
go golang golang-application consul completion consul-catalog devops devops-tools cli

consul-catalog's Introduction

consul-catalog

Queries Consul catalog and prints out registered nodes and services.

Usage

Install the latest version:

go install -u github.com/inkel/consul-catalog

By default it will print the nodes and services registered. You can control whether to include nodes or services with the following flags:

$ ./consul-catalog -h
Usage of ./consul-catalog:
  -nodes
        Include node names in output (default true)
  -services
        Include services in output (default true)

This is useful for TAB completion on the CLI. For instance, in Bash, to add TAB completion to your ssh command, you could do something like this:

_consul_catalog() {
    COMPRELY=( $( compgen -W "$(consul-catalog -services=false)" -- "$(_get_cword)" ) )
}
complete -F _consul_catalog ssh

Note we are using the -services=false flag to exclude services from being printed.

License

See LICENSE.

consul-catalog's People

Contributors

inkel avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

consul-catalog's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.