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
- Clone repository
- Build
go build ./cmd/easyp
go install github.com/easyp-tech/easyp/cmd/easyp@latest
Creates empty easyp
project.
Creates easyp.yaml
(by default) and easyp.lock
files.
easyp init
easyp
support buf's
linter rules.
easyp lint -cfg example.easyp.yaml
Checking your current API on backward compatibility with API from another branch.
easyp breaking --against $BRANCH_TO_COMPARE_WITH
Generate proto files.
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
Install dependence from easyp
config (or lock file).
- download
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).
- update
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.
- vendor
easyp -cfg example.easyp.yaml mod vendor
Copy all your proto files dependencies to local dir (like go mod vendor
command).
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.
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
-
Configure your
ssh
config (~/.ssh/config
) with path to private key and git hosting's params -
Configure your git config (
~/.gitconfig
):
[url "ssh://git@$GIT_HOSTING/"]
insteadOf = https://$GIT_HOSTING/
for example:
[url "ssh://[email protected]/"]
insteadOf = https://github.com/
- Add the following line to your ~/.zshrc startup script:
source <(easyp completion zsh)
- Re-launch your shell or run:
source ~/.zshrc
- 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