Skip to content

fugue/fugue-client

Repository files navigation

Fugue API Client

This is a command line client for the Fugue API.

For CLI documentation and examples, see the Fugue docs site.

For information about enabling a client in your account, see the API User Guide. More details of the underlying Swagger API are available here.

This project is under active development and is not yet stable. Commands will change as we incorporate feedback.

Install

The easiest way to install the client is to download a prebuilt binary from the releases page.

Detailed installation steps are below:

You can also build from source.

For more information, see the CLI documentation.

macOS

  1. Select the prebuilt fugue-darwin-amd64 binary from the releases page and save it to disk (do not open it):

Download the macOS binary fugue-darwin-amd64

  1. cd into the directory where you downloaded fugue-darwin-amd64.

  2. Rename the binary fugue and move it to a location in your $PATH, such as /usr/local/bin. You can do both with the following command:

mv fugue-darwin-amd64 /usr/local/bin/fugue
  1. Change file permissions to enable execution:
chmod 755 /usr/local/bin/fugue
  1. Set environment variables FUGUE_API_ID and FUGUE_API_SECRET:
export FUGUE_API_ID=61ae1bed-1b6f-1234-5678-1a2b3c4d5e6f
export FUGUE_API_SECRET=f7a89ac99cab9dd2948712345678901234567890
  1. You should be able to run the fugue executable now:
fugue

If you get an error message that the application cannot be opened, see these instructions.

Linux

  1. Select the prebuilt fugue-linux-amd64 binary from the releases page and save it to disk (do not open it):

Download the Linux binary fugue-linux-amd64

  1. cd into the directory where you downloaded fugue-linux-amd64.

  2. Rename the binary fugue and move it to a location in your $PATH, such as /usr/local/bin. You can do both with the following command:

sudo mv fugue-linux-amd64 /usr/local/bin/fugue
  1. Change file permissions to enable execution:
chmod 755 /usr/local/bin/fugue
  1. Set environment variables FUGUE_API_ID and FUGUE_API_SECRET:
export FUGUE_API_ID=61ae1bed-1b6f-1234-5678-1a2b3c4d5e6f
export FUGUE_API_SECRET=f7a89ac99cab9dd2948712345678901234567890
  1. You should be able to run the fugue executable now:
fugue

Windows

  1. Download the prebuilt fugue.exe binary from the releases page and save it to disk (do not open it):

Download the Windows fugue.exe binary

  1. Open up cmd (Windows Command Shell) and create the directory C:\Fugue\bin:
md C:\Fugue\bin
  1. cd into the directory where you downloaded fugue.exe and move the binary to C:\Fugue\bin:
move fugue.exe C:\Fugue\bin
  1. Update PATH environment variable to add the new directory to your user path:
setx PATH "%PATH%;C:\Fugue\bin"
  1. Set environment variables FUGUE_API_ID and FUGUE_API_SECRET:
setx FUGUE_API_ID 61ae1bed-1b6f-1234-5678-1a2b3c4d5e6f
setx FUGUE_API_SECRET f7a89ac99cab9dd2948712345678901234567890
  1. Close the cmd window and open a new one so the environment variables take effect.

  2. You should be able to run the fugue executable now:

fugue --version

Docker

Regula is available as a Docker image on DockerHub here.

To use the Fugue client Docker image, run:

docker run --rm -it -e FUGUE_API_ID=<your API ID> -e FUGUE_API_SECRET=<your API secret> fugue/fugue-client

When integrating this in a CI pipeline, we recommend pinning the image to a specific version, e.g. fugue/fugue-client:v0.19.1. See the tags page for the current list of available tags.

Environment Variables

The client uses the following required environment variables:

Build from Source

Install Go:

brew install go

Build the client executable:

make build

Install to $GOPATH/bin:

make install

Usage

Show usage:

fugue -h
Fugue API Client

Usage:
  fugue [command]

Available Commands:
  create      Create a resource
  delete      Delete a resource
  get         Retrieve a resource
  help        Help about any command
  list        List a collection of resources
  scan        Trigger a scan
  sync        Sync files to your account
  update      Update a resource

Flags:
  -h, --help      help for fugue
      --json      outputs the Fugue API JSON response
      --version   version for fugue

Use "fugue [command] --help" for more information about a command.

Command Documentation

Aliases

You may use the shorthand env instead of environment when running commands.

For example:

fugue list envs

Debug

To see the HTTP headers and the json exchanged between the CLI and the Fugue API, set the environment variable DEBUG=1. For example:

DEBUG=1 fugue list environments