findy-agent-cli

command module
v0.24.11 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

findy-agent-cli

lint test

findy-agent-cli is a command-line tool for Findy Agency Aries protocol engine. The tool is a standalone command with minimal dependencies i.e. none. The binary includes all that's needed to run it. It provides commands to

  • allocate new cloud agent;
  • authenticate thru WebAuthn by including headless FIDO2 authenticator which can be easily used from other processes thru JSON interface as well;
  • communicate with the cloud agent and make connections, invitations, cred defs, schemas, and listen the agent notifications;
  • execute protocol commands like issue credential, request proof, trust-ping, etc.;
  • start and communicate with chat-bots;
  • execute operation commands to agency itself like setting logging levels, querying statistics;
  • and naturally auto-completion is supported

Installation

TODO: installation script is coming soon.

Building From Source Files

Follow these steps to install CLI tool from the source. Please make sure that Go and git are both installed and working properly. You should have $GOPATH/bin/ in your $PATH variable.

Note! Go modules must be on.

  1. Clone findy-agent-cli
  2. Install binary: make install or make deps cli
  3. Binary will in $GOPATH/bin/ by name findy-agent-cli or if you used make deps cli by name cli
  4. To activate auto-completion run: . sa-compl.sh without arguments if you used make deps cli and use . sa-compl.sh findy-agent-cli findy-agent-cli if you used the first option.

CLI usage examples

Examples are now included in the command help which can be activated by cli agency -h or cli help agency.

Usage

In addition to passing command flags into the command, it is possible to use environment variables or configuration files to specify your flag values.

Configuration file

In order to use configuration file place your configuration file path to --config flag.

Example: findy-agent-cli bot start --config my_config.yaml

Dev Tip

If you have export FCLI_CONFIG=./cfg.yaml in your environment variables you easily can have directory based configurations to execute CLI-tools commands just by defining cfg.yaml files to those directories you want to present your agent. Only thing you have to do is switch to the directory which contains the proper cfg.yaml for the context you want to use. The directory name tells you the context you are in.

ENV variable usage

You can pass flag values using environment variables.

The example of typical and minimal settings for usage of the tool:

export FCLI_SERVER="host.domain.net:50051"
export FCLI_URL="https://host.domain.net"
export FCLI_TLS_PATH="/home/god/go/src/github.com/findy-network/certs"

The previous environment variables tell the findy-agent-cli where the WebAuthn server and gRPC agency are as well set the proper TLS certificate path.

ENV variable names can be found from flag usage info. To see flag info for specific command, use --help flag after the command.

Example: findy-agent-cli authn --help

Shell auto-completion

Use findy-agent-cli completion <shell type> command to generate findy-agent-cli auto-completion script to your shell environment.

You can load bash auto-completion code into your current shell with these commands:

Bash: source <(findy-agent-cli completion bash) zsh: source <(findy-agent-cli completion zsh)

Note! Bash auto-completion requires bash-completion to be installed beforehand.

Dev Tip

There is sa-compl.sh helper script to allow easily take use of auto-completion at the run-time even with complex aliases like this:

$ alias your_alias='go run .'
$ . ./sh-compl.sh "go run ." your_alias

If you are using make cli to build dev-time version of the command to your GOPATH you can just run $ . ./sh-compl.sh

Enable to all shell sessions (optional)

According which shell you are using, add one of the previous commands to your shell configuration scripts (e.g. .bash_profile/.zshrc)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
bot

Jump to

Keyboard shortcuts

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