CLIPR is a server that the CloudFoundry CLI can interact with to browse and install plugins. This documentation covers how to run CLIPR itself, as well as how to create your own implementation if desired.
git cloneorgo getthis repo
- To Git clone, you need to have git installed
Clone this repo
git clone https://github.com/cloudfoundry/cli-plugin-repo
- Push CLIPR to your instance of Cloud Foundry by doing
cf pushat the root of CLIPR
- Install Go
- Ensure your $GOPATH is set correctly
- Use
go buildto build the binary, here is an example in OSX/Linux which produces an executable calledclipr
$ go build -o clipr ./- Invoke the binary
./cliprwith the following options
-n: IP Address for the server to listen on, default is0.0.0.0-p: Port number for the server to listen on, default is8080
Once you have a CLIPR server running, either as a Cloud Foundry app or a stand alone server
- Add the running server to your CLI via the
add-plugin-repocommand, for example,cf add-plugin-repo local-repo http://localhost:8080 - Browse & install plugins from CLI. Alternatively, you can point your browser at the server address, for example,
http://localhost:8080to see a listing of plugins
- Install Go
- Ensure your $GOPATH is set correctly
- Get the CLIPR source code:
go get code.cloudfoundry.org/cli-plugin-repo - Fork the repository
- Add your fork as a remote:
cd $GOPATH/src/code.cloudfoundry.org/cli-plugin-repo
git remote add your_name https://github.com/your_name/cli-plugin-repoAlternatively, you can create your own plugin repo implementation. The server must meet the requirements:
- server must have a
/listendpoint which returns a JSON object that lists the plugin info in the correct form
{"plugins": [
{
"name":"echo",
"description":"echo repeats input back to the terminal",
"version":"0.1.4",
"date":"0001-01-01T00:00:00Z",
"company":"",
"author":"",
"contact":"[email protected]",
"homepage":"https://github.com/johndoe/plugin-repo",
"binaries": [
{
"platform":"osx",
"url":"https://github.com/johndoe/plugin-repo/raw/main/bin/osx/echo",
"checksum":"2a087d5cddcfb057fbda91e611c33f46"
},
{
"platform":"win64",
"url":"https://github.com/johndoe/plugin-repo/raw/main/bin/windows64/echo.exe",
"checksum":"b4550d6594a3358563b9dcb81e40fd66"
}
]
}
]}- To see a live example of the JSON object, browse to http://plugins.cloudfoundry.org/list