Easyp
easyp is a cli tool for workflows with proto files.
For now, it's just linter and package manager, but... who knows, who knows...
Just testing
Official site
https://easyp.tech/
Telegram chat
https://t.me/easyptech
Install
Build from source
- Clone repository
- Build
go build ./cmd/easyp
Install from github
go install github.com/easyp-tech/easyp/cmd/easyp@latest
Init
Creates empty easyp project.
Creates easyp.yaml (by default) and easyp.lock files.
Usage
easyp init
Linter
easyp support buf's linter rules.
Usage
easyp lint -cfg example.easyp.yaml
Breaking check
Checking your current API on backward compatibility with API from another branch.
Usage
easyp breaking --against $BRANCH_TO_COMPARE_WITH
Generate
Generate proto files.
Usage
There are several ways to get proto files to generate:
- from current local repository:
generate:
inputs:
- directory: WHERE YOUR PROTO FILES ARE
- from remote git repository:
generate:
inputs:
- git_repo:
url: "URL TO REMOTE REPO"
sub_directory: DIR WITH PROTO FILES ON REMOTE REPO
NOTE: format url the same as in deps section.
plugins section: config for protoc
Example:
plugins:
- name: go
out: .
opts:
paths: source_relative
- name: go-grpc
out: .
opts:
paths: source_relative
require_unimplemented_servers: false
Package manager
Install dependence from easyp config (or lock file).
Usage
easyp -cfg example.easyp.yaml mod download
Read your dependencies from easyp.lock file and install them.
If easyp.lock is empty or doesn't exist easyp read dependencies from easyp.yaml config file (deps section).
easyp -cfg example.easyp.yaml mod update
Read dependencies from easyp.yaml config file and ignore easyp.lock file.
Could be used for update versions: set version in easyp.yaml file and run update command.
easyp -cfg example.easyp.yaml mod vendor
Copy all your proto files dependencies to local dir (like go mod vendor command).
Configuration
Write list of your dependencies in easyp.yaml config with in section deps.
For example:
deps:
- github.com/googleapis/googleapis@common-protos-1_3_1
NOTE: Use only git tag or full hash of commit version.
By default, easyp use $HOME/.easyp dir to storage cache and downloaded modules, you could override it with EASYPPATH env var.
Install from private repositories
There are two ways to install from private repository.
- Use
.netrc
Create .netrc in your home dir:
machine $GIT_HOSTING
login $YOUR_LOGIN
password $YOUR_API_TOKEN
In that case you have to create API token on git hosting
- Use ssh keys
[url "ssh://git@$GIT_HOSTING/"]
insteadOf = https://$GIT_HOSTING/
for example:
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
Auto-completion
zsh auto-completion
- Add the following line to your ~/.zshrc startup script:
source <(easyp completion zsh)
- Re-launch your shell or run:
source ~/.zshrc
Bash auto-completion
- Install bash-completion and add the software to your
~/.bashrc.
- Add the following line to your ~/.bashrc startup script:
source <(easyp completion bash)
- Re-launch your shell or run:
source ~/.bashrc