Skip to content
An interactive CLI for browsing Azure, inspired by http://resources.azure.com/
Branch: master
Clone or download
Latest commit c303490 Jun 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.vscode
cmd Refactor for testing and add tests for delete process Apr 8, 2019
docs
internal/pkg Add missing comment Jun 19, 2019
pkg
scripts
swagger-specs
.gitignore
.golangci.toml Add ignore for mispell errors Jun 17, 2019
.goreleaser.yml
Dockerfile Attempt docker fix #3 Feb 27, 2019
LICENSE Create LICENSE Dec 10, 2018
Makefile Update make file to set GO111MODULE=on Jun 25, 2019
README.md
azure-pipelines.yaml
ci.Dockerfile Add azure pipeline file for integration testing Apr 9, 2019
go.mod migrated from deps to go mod Apr 5, 2019
go.sum

README.md

AzBrowse

An interactive CLI for browsing azure resources, inspired by resources.azure.com

Go Report Card Go Doc Release

Test Type Status
Unit Tests CircleCI
Integration Tests Build Status

Status

This is a pet project which has matured thanks to support from awesome contributions.

Currently I'm using it every day but it is experimental so use with caution on a production environment!!

Demo

Install

Pre-req: Ensure you have the az command from Azure CLI setup on your machine and are logged-in otherwise azbrowse won't work!

Mac (via HomeBrew)

brew install lawrencegripper/tap/azbrowse

Windows (via Scoop)

Install Scoop

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Install AzBrowse using Scoop

scoop bucket add azbrowse https://github.com/lawrencegripper/scoop-bucket.git
scoop install azbrowse

Linux (via Releases tar.gz)

Grab the url to the .tar.gz for the latest release for your platform/architecture. E.g. https://github.com/lawrencegripper/azbrowse/releases/download/v1.1.193/azbrowse_linux_amd64.tar.gz

Download the release (either via the browser or wget https://github.com/lawrencegripper/azbrowse/releases/download/v1.1.193/azbrowse_linux_amd64.tar.gz).

Extract the binary from the archive to a suitable location (here we're using /usr/bin for convenience): tar -C /usr/bin -zxvf azbrowse_linux_amd64.tar.gz azbrowse

Make the binary executable: chmod +x /usr/bin/azbrowse

Install via azure-cli extention

Warning: This is experimental and Non-functional on Windows. Only tested on Unix based systems

Want to run az browse and have the azure-cli install and run azbrowse?

This extension from Noel Bundick lets you do just that

DIY

Simply download the archive/package suitable for your machine, from the release page, and execute it.

Bonus: Add it to your $PATH so you can run azbrowse anywhere.

Test out via Docker

You can then start azbrowse in docker by mounting in your $HOME directory so azbrowse can access the login details from your machine inside the docker container.

docker run -it --rm -v $HOME:/root/ -v /etc/localtime:/etc/localtime:ro lawrencegripper/azbrowse

Usage

Below is a table containing the default key bindings. If you'd like to customise the key bindings to be more suitable for your setup, please refer to the section on custom key bindings.

Navigation

Key Does
↑/↓ Select resource
PgDn/PgUp Move up or down a page of resources
Home/End Move to the top or bottom of the resources
Backspace Go back
ENTER Expand/View resource

Operations

Key Does
CTRL+E Toggle Browse JSON For longer responses you can move the cursor to scroll the doc
CTRL+o (o for open) Open Portal Opens the portal at the currently selected resource
DEL: Delete resource The currently selected resource will be deleted (Requires double press to confirm)
CTLT+F: Toggle Fullscreen Gives a fullscreen view of the JSON for smaller terminals
CTLT+S: Save JSON to clipboard Saves the last JSON response to the clipboard for export
CTLT+A: View Actions for resource This allows things like ListKeys on storage or Restart on VMs

Debugging

Running azbrowse --debug will start an in-memory collector for the opentracing and a GUI to browse this at http://localhost:8700. You can use this to look at tracing information output by azbrowse as it runs.

tracing ui

Developing

Environment Setup

Note: Golang 1.12 is recommended.

First, clone this repository. azbrowse is written in Go and so you will want to set up your Go development environment first. If this is your first time, the offical install guide is probably a good place to start. Make sure you have GOPATH/bin in your PATH, using the instructions here as guidance on doing that.

In addition to installing Go, there are a couple of tool dependencies you'll need. These are:

You can install these yourself following the instructions on their github pages, or you can run...

make setup

This runs the script scripts/install_dev_tools.sh, which will install these tools for you.

Building

With your Go development environment set up, use make to build azbrowse.

Take a look at the Makefile yourself, but the main rules are:

Run Tests and Build

make build

Running integration tests (requires a full terminal)

make integration

Install Local Development Build

make install

Automated builds

The CircleCI build runs the golang build, unit tests and linting. The AzureDevOps build run the integration tests under XTerm.

Running locally

make integration && make ci-docker

To run the full Travis-CI locally, you need to have the TRAVIS_BUILD_NUMBER environment variable defined, so running it as follows may be easier:

TRAVIS_BUILD_NUMBER=0.1 make ci-docker

Custom Key Bindings

If you wish to override the default key bindings, create a ~/.azbrowse-settings.json file (where ~ is your users home directory).

The file should be formated like so:

{
    "keyBindings": {
        ...
        "Copy": "F8",
        "Help": "Ctrl+H",
        ...
    }
}

In the file you can override the keys for actions using keys from the lists below.

Actions

Actions: Does
Quit Terminates the program
Copy Copies the resource JSON to clipboard
ListDelete Deletes a resources
Fullscreen Toggles fullscreen
Help Toggles help view
ItemBack Go back from an item to a list
ItemLeft Switch from the item json to the menu
ListActions List available actions on a resource
ListBack Go back on a list
ListBackLegacy Go back on a list (legacy terminals)
ListDown Navigate down a list
ListUp Navigate up a list
ListRight Switch from the list to an item view
ListEdit Toggle edit mode on a resource
ListExpand Expand a selected resource
ListOpen Open a resource in the Azure portal
ListRefresh Refresh a list

Keys

  • Up
  • Down
  • Left
  • Right
  • Backspace
  • Backspace2
  • Delete
  • Home
  • End
  • PageUp
  • PageDown
  • Insert
  • Tab
  • Space
  • Esc
  • Enter
  • Ctrl+2
  • Ctrl+3
  • Ctrl+4
  • Ctrl+5
  • Ctrl+6
  • Ctrl+7
  • Ctrl+8
  • Ctrl+[
  • Ctrl+]
  • Ctrl+Space
  • Ctrl+_
  • Ctrl+~
  • Ctrl+A
  • Ctrl+B
  • Ctrl+C
  • Ctrl+D
  • Ctrl+E
  • Ctrl+F
  • Ctrl+G
  • Ctrl+H
  • Ctrl+I
  • Ctrl+J
  • Ctrl+K
  • Ctrl+L
  • Ctrl+M
  • Ctrl+N
  • Ctrl+O
  • Ctrl+P
  • Ctrl+Q
  • Ctrl+R
  • Ctrl+S
  • Ctrl+T
  • Ctrl+U
  • Ctrl+V
  • Ctrl+W
  • Ctrl+X
  • Ctrl+Y
  • Ctrl+Z
  • F1
  • F2
  • F3
  • F4
  • F5
  • F6
  • F7
  • F8
  • F9
  • F10
  • F11
  • F12

For compatibility reasons you may notice some keys will have multiple mappings.

Plans

Issues on the repository track plans, I'd love help so feel free to comment on an issue you'd like to work on and we'll go from there.

You can’t perform that action at this time.