micro cli

The micro cli is a command line interface for the micro toolkit micro.

Getting Started


go get github.com/micro/micro/v2

Interactive Mode

To use the cli as an interactive prompt

micro cli

Remove micro from the below commands when in interactive mode

Example Usage

List Services

micro list services

Get Service

micro get service go.micro.srv.example



go.micro.srv.example-fccbb6fb-0301-11e5-9f1f-68a86d0d36b6	[::]	62421

Call Service

micro call go.micro.srv.example Example.Call '{"name": "John"}'


	"msg": "go.micro.srv.example-fccbb6fb-0301-11e5-9f1f-68a86d0d36b6: Hello John"

Service Health

micro health go.micro.srv.example


node		address:port		status
go.micro.srv.example-fccbb6fb-0301-11e5-9f1f-68a86d0d36b6		[::]:62421		ok


micro register service '{"name": "foo", "version": "bar", "nodes": [{"id": "foo-1", "address": "", "port": 8080}]}'
micro deregister service '{"name": "foo", "version": "bar", "nodes": [{"id": "foo-1", "address": "", "port": 8080}]}'

Proxy Remote Env

Proxy remote environments using the micro proxy

When developing against remote environments you may not have direct access to service discovery which makes it difficult to use the CLI. The micro proxy provides a http proxy for such scenarios.

Run the proxy in your remote environment

micro proxy

Set the env var MICRO_PROXY_ADDRESS so the cli knows to use the proxy

MICRO_PROXY_ADDRESS=staging.micro.mu:8081 micro list services


   micro - A cloud-native toolkit

   micro [global options] command [command options] [arguments...]
    api		Run the micro API
    bot		Run the micro bot
    registry	Query registry
    call	Call a service or function
    query	Deprecated: Use call instead
    stream	Create a service or function stream
    health	Query the health of a service
    stats	Query the stats of a service
    list	List items in registry
    register	Register an item in the registry
    deregister	Deregister an item in the registry
    get		Get item from registry
    proxy	Run the micro proxy
    new		Create a new micro service by specifying a directory path relative to your $GOPATH
    web		Run the micro web app