This guide covers installing the mpe CLI and the Go library.
The easiest way to install mpe on macOS or Linux is via Homebrew using our custom tap:
brew tap manetu/tap
brew install mpe
To upgrade to the latest version:
brew upgrade mpe
Clone the repository and build:
git clone https://github.com/manetu/policyengine.git
cd policyengine
make build
The binary will be created at target/mpe. Add it to your PATH:
# Add to your shell profile (.bashrc, .zshrc, etc.)
export PATH=$PATH:/path/to/policyengine/target
If you have Go installed, you can install directly:
go install github.com/manetu/policyengine/cmd/mpe@latest
After installation, verify the CLI is working:
mpe --help
You should see output like:
NAME:
mpe - A CLI application for working with the Manetu PolicyEngine
USAGE:
mpe [global options] [command [command options]]
COMMANDS:
test Invokes various aspects of policy-decision flow, simplifying policy-domain authoring and verification
serve Creates a decision-point service
lint Validate PolicyDomain YAML files for syntax errors and lint embedded Rego code
build Build PolicyDomain YAML from PolicyDomainReference (with external .rego files)
version Print the version of mpe
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--trace, -t Enable OPA trace logging output to stderr for commands that evaluate REGO
--help, -h show help
To use the PolicyEngine in your Go application:
go get github.com/manetu/policyengine@latest
Then import into your code:
import (
"github.com/manetu/policyengine/pkg/core"
"github.com/manetu/policyengine/pkg/core/options"
)
If you want to contribute to the PolicyEngine:
# Clone the repository
git clone https://github.com/manetu/policyengine.git
cd policyengine
# Install dependencies
go mod download
# Run tests
make test
# Run all checks (lint, test, static analysis)
make all
Now that you have the CLI installed, proceed to:
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |