{"id":20127761,"url":"https://github.com/davidcardoso/my-ez-cli","last_synced_at":"2025-05-06T18:31:49.961Z","repository":{"id":38328059,"uuid":"467998240","full_name":"DavidCardoso/my-ez-cli","owner":"DavidCardoso","description":"CLI Tools using Docker + Shell Script.","archived":false,"fork":false,"pushed_at":"2025-05-01T08:11:57.000Z","size":916,"stargazers_count":5,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-01T09:24:19.748Z","etag":null,"topics":["aws","cdktf","cli","dev","devops-tools","docker","google-cloud","node","python","serverless","shell-script","speedtest","sso","terraform","tooling","yarn","yarn-berry"],"latest_commit_sha":null,"homepage":"https://github.com/My-Tooling/my-ez-cli","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidCardoso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-09T16:05:17.000Z","updated_at":"2024-07-22T14:46:56.000Z","dependencies_parsed_at":"2023-09-12T02:31:29.860Z","dependency_job_id":"ac8a73bc-eb4d-4855-8bb4-259046194657","html_url":"https://github.com/DavidCardoso/my-ez-cli","commit_stats":null,"previous_names":["my-tooling/my-ez-cli","davidcardoso/my-ez-cli"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fmy-ez-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fmy-ez-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fmy-ez-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidCardoso%2Fmy-ez-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidCardoso","download_url":"https://codeload.github.com/DavidCardoso/my-ez-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252744524,"owners_count":21797638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdktf","cli","dev","devops-tools","docker","google-cloud","node","python","serverless","shell-script","speedtest","sso","terraform","tooling","yarn","yarn-berry"],"created_at":"2024-11-13T20:23:39.886Z","updated_at":"2025-05-06T18:31:49.502Z","avatar_url":"https://github.com/DavidCardoso.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My Ez CLI\n\nTools via **Unix Command Line Interface** with no installation and just using **Docker** + **Shell Script**.\n\n- [My Ez CLI](#my-ez-cli)\n  - [Prerequisites](#prerequisites)\n  - [Setup](#setup)\n  - [Usage examples](#usage-examples)\n    - [AWS CLI](#aws-cli)\n      - [AWS Get Session Token](#aws-get-session-token)\n      - [AWS SSO](#aws-sso)\n      - [AWS SSO Get Credentials](#aws-sso-get-credentials)\n    - [Python](#python)\n      - [Using other Python versions](#using-other-python-versions)\n    - [Node](#node)\n      - [Using other Node versions](#using-other-node-versions)\n    - [Yarn](#yarn)\n      - [Using Yarn with NPM token and custom ports](#using-yarn-with-npm-token-and-custom-ports)\n      - [Using Yarn with other Node versions](#using-yarn-with-other-node-versions)\n      - [Yarn Berry (v2+)](#yarn-berry-v2)\n    - [Serverless Framework](#serverless-framework)\n    - [Terraform](#terraform)\n      - [`CONTEXT` variable](#context-variable)\n      - [`DOTENV_FILE` variable](#dotenv_file-variable)\n      - [`TF_RC_FILE` variable](#tf_rc_file-variable)\n      - [`AWS_CREDENTIALS_FOLDER` variable](#aws_credentials_folder-variable)\n      - [`GCLOUD_CREDENTIALS_FOLDER` and `GOOGLE_APPLICATION_CREDENTIALS` variables](#gcloud_credentials_folder-and-google_application_credentials-variables)\n    - [Cloud Development Kit for Terraform (CDKTF)](#cloud-development-kit-for-terraform-cdktf)\n    - [Ookla Speedtest CLI](#ookla-speedtest-cli)\n    - [Google Cloud CLI](#google-cloud-cli)\n    - [Graph Viz for docker compose](#graph-viz-for-docker-compose)\n    - [Playwright](#playwright)\n  - [Author](#author)\n  - [Contributors](#contributors)\n\n## Prerequisites\n\n- [Docker](https://www.docker.com/get-started).\n- [Zshell + Oh My Zsh](https://ohmyz.sh/).\n\n## Setup\n\nIt adds aliases to your `~/.zshrc` file and symbolic links to your `/usr/local/bin/` folder:\n\n```shell\n./setup.sh\n# --------------------------------------------------------------------------------\n#                   My Ez CLI • Setup\n# --------------------------------------------------------------------------------\n#   Hope you enjoy it! :D\n# --------------------------------------------------------------------------------\n#   Note: Aliases may be created in '~/.zshrc' file...\n# --------------------------------------------------------------------------------\n#   Note: Symbolic links may be created in '/usr/local/bin/' folder...\n# --------------------------------------------------------------------------------\n#   Warning: Root access may be needed.\n# --------------------------------------------------------------------------------\n#   GitHub: https://github.com/DavidCardoso/my-ez-cli\n# --------------------------------------------------------------------------------\n\n# 1) ALL                6) node             11) docker-compose-viz\n# 2) aws                7) yarn             12) playwright\n# 3) terraform          8) yarn-berry       13) python\n# 4) cdktf              9) serverless       14) EXIT\n# 5) gcloud             10) speedtest\n# Choose an option:\n```\n\n## Usage examples\n\n### AWS CLI\n\n\u003e See [more](config/aws).\n\n```shell\n# help\naws help\n\n# list buckets\naws s3 ls --profile my-aws-profile\n\n# download a file from a bucket\naws s3 cp s3://my-bucket/my-file /path/to/local/file --profile my-aws-profile\n```\n\n#### AWS Get Session Token\n\n```shell\n# authenticate using MFA\naws-get-session-token \u003cMFA_DIGITS\u003e\n```\n\n#### AWS SSO\n\n```shell\n# authenticate using SSO\naws-sso\n#1) configure\n#2) login\n#3) logout\n#Choose an option:\n```\n\n#### AWS SSO Get Credentials\n\n\u003e [Building the docker image](docker/aws-sso-cred/).\n\nIf you need to get/know the SSO credentials being used, run:\n\n```shell\naws-sso-cred $AWS_PROFILE\n# or specify a profile of your choice\naws-sso-cred my-working-profile\n```\n\n### Python\n\n\u003e It is using version `3.12.4` as default.\n\n```shell\n# see version\npython --version\n\n# run interpreter\npython\n\n# run a script\npython main.py\n```\n\n#### Using other Python versions\n\nThis script is using the same env var used by [PyEnv](https://github.com/pyenv/pyenv?tab=readme-ov-file#understanding-python-version-selection).\n\nSo all you need to do is to declare the `PYENV_VERSION` before calling the `python` command.\n\n```shell\n# Export directly or add it to your profile configs (e.g.,`.zshrc`).\nexport PYENV_VERSION=3.9.19\npython main.py\n\n# or pass it inline\nPYENV_VERSION=3.9.19 python main.py\n\n# Note: the respective docker image will be downloaded if not found locally\n# Unable to find image 'python:3.9.19' locally\n# 3.9.19: Pulling from library/python\n# 21988c13fd96: Download complete\n# 42d758104bc9: Download complete\n# 6d0099138f57: Download complete\n# Digest: sha256:47d6f16aa0de11f2748c73e7af8d40eaf44146c6dc059b1d0aa1f917f8c5cc58\n# Status: Downloaded newer image for python:3.9.19\n```\n\n### Node\n\n\u003e It is using Node 20 (current LTS version).\n\n```shell\n# see node version\nnode -v\n\n# run node interpreter\nnode\n\n# run a node script\nnode somefile.js\n```\n\n#### Using other Node versions\n\n```shell\n# just add the node version as a suffix\nnode14 -v\nnode16 -v\nnode18 -v\n```\n\n### Yarn\n\n\u003e It is using Node 20 (current LTS version).\n\n```shell\n# see yarn version\nyarn -v\n\n# start the package.json from a JS project\nyarn init\n\n# install a package as dev dependency\nyarn add some-pkg --dev\n\n# install a package globally\nyarn global add another-pkg\n```\n\n#### Using Yarn with NPM token and custom ports\n\nUse `MEC_BIND_PORTS` env var if you want to bind ports between the host and container:\n\n```shell\nMEC_BIND_PORTS=\"8080:80 9090:80\" yarn\n\n# or\nexport MEC_BIND_PORTS=\"8080:80 9090:80\"\nyarn\n```\n\nIn order to be able to install NPM packages from a private repository,\nyou might need to inform `NPM_TOKEN` env var.\n\n```shell\nNPM_TOKEN=your-token-here yarn\n\n# or\nexport NPM_TOKEN=your-token-here\nyarn\n```\n\n\u003e **Hint**: you can put this on your default shell config file.\\\n\u003e Example for zsh: `echo \"export NPM_TOKEN=your-token-here\" \u003e\u003e ~/.zshrc`\n\n#### Using Yarn with other Node versions\n\n\u003e Some NPM packages aren't compatible with newer Node versions yet.\n\n```shell\n# just add the node version as a suffix\nyarn14 -v\nyarn16 -v\nyarn18 -v\n```\n\n#### Yarn Berry (v2+)\n\n```shell\n# if you have replaced yarn\nyarn --version # it should show 3.6+\n\n# otherwise\nyarn-berry --version # it should show 3.6+\n```\n\n### Serverless Framework\n\nIt is ready to work with AWS.\n\n\u003e [See more about the docker image](docker/serverless).\n\n```shell\n# see versions\nserverless -v\n\n# help\nserverless --help\n\n# Starting from a template\n# note: replace \"template-name\" below with the folder name of the example you want to use\n\n# method 1\nserverless create \\\n  -u https://github.com/serverless/examples/tree/master/template-name \\\n  -n my-project-folder\n\n# method 2 [recommended]\nserverless init \\\n  template-name \\\n  -n my-project-folder\n\n# Hint: if you get build errors, try it\ncd my-project-folder \u0026\u0026 yarn\n\n# Serverless.com account login\n# note: It is also possible to use an access key to authenticate via serverless CLI\nserverless login\n\n# Deploy your project\nserverless deploy\n\n# Invoke a Lambda Function\nserverless invoke -f hello\n\n# Invoke and display lambda logs\nserverless invoke -f hello --log\n\n# Fetch lambda logs\nserverless logs -f hello\nserverless logs -f hello --tail\n```\n\n\u003e [Serverless Getting Started docs](https://www.serverless.com/framework/docs/getting-started).\n\n\u003e [Serverless templates](https://github.com/serverless/examples).\n\n### Terraform\n\n\u003e **Important**: ensure you are using the right provider credentials/roles/permissions before executing any command.\n\n\u003e Take a look at Terraform AWS modules [public registry](https://registry.terraform.io/browse/modules?provider=aws) and [usage examples](https://github.com/terraform-aws-modules).\n\n```shell\n# help\nterraform -help\n\n# start the terraform in a project\nmkdir my-terraform-project\ncd my-terraform-project\nterraform init\n\n# set the right environment\n# useful for multiple environments\n# hint: avoid using default environment\nterraform workspace list\nterraform workspace new ${ENVIRONMENT}\nterraform workspace select ${ENVIRONMENT}\n\n# validate terraform files\nterraform validate\n\n# see  changes\nterraform plan\n# save changes to an output file (recommended)\nterraform plan -out=tfplan\n\n# apply changes to the providers (aws, gcp, azure, etc)\nterraform apply\n# apply changes using tfplan output file (recommended)\nterraform apply tfplan\n\n# destroy created resources on the providers\n# warning: do not run it in production! ;D\nterraform destroy\n```\n\n#### `CONTEXT` variable\n\nBy default, the parent directory is mounted on the container.\nThis allows files inside parent folder to be referenced in the Terraform files.\n\nFor instance, if you need to use a Terraform `module` that is located two levels up\nin the filesystem, you can use `CONTEXT` variable before the `terraform` command\nto define the absolute path to that module (or another folder).\n\n```shell\n# option 1\nCONTEXT=$(cd \"$PWD/../../\" \u0026\u0026 pwd) terraform --version\nCONTEXT=$(cd \"$PWD/../../\" \u0026\u0026 pwd) terraform init\n\n# option 2\nCONTEXT=$(cd \"$PWD/../../\" \u0026\u0026 pwd)\nCONTEXT=$CONTEXT terraform --version\nCONTEXT=$CONTEXT terraform init\n\n# option 3\nexport CONTEXT=$(cd \"$PWD/../../\" \u0026\u0026 pwd)\nterraform --version\nterraform init\n```\n\n#### `DOTENV_FILE` variable\n\nAll variables in `DOTENV_FILE` file will be available inside the container.\n\nBy default, the terraform container will use `${PWD}/.env` file.\n\nInform a different value if you want to point to another one.\n\n```shell\nexport DOTENV_FILE=local.env\nterraform init\nterraform plan\n\n# or\nDOTENV_FILE=local.env terraform init\nDOTENV_FILE=local.env terraform plan\n```\n\n#### `TF_RC_FILE` variable\n\nThis is used for Terraform Cloud login.\n\nBy default, the terraform container will use `${HOME}/.terraformrc` file.\n\nInform a different value if you want to point to another one.\n\n```shell\nexport TF_RC_FILE=/another/path/to/terraform-credentials/file\nterraform init\n# it should recognize the backend config pointing to your TF Cloud workspace(s)\n```\n\n#### `AWS_CREDENTIALS_FOLDER` variable\n\nThis is used for AWS CLI authentication.\n\nBy default, the terraform container will use `${HOME}/.aws` folder.\n\nInform a different value if you want to point to another one.\n\n```shell\nexport AWS_PROFILE=your-aws-profile\nexport AWS_CREDENTIALS_FOLDER=/another/path/to/credentials/folder/\nterraform init\nterraform plan\nterraform apply\n# it should be able to deploy to your aws account based on the credentials used\n```\n\n\u003e See [more about AWS auth configs](config/aws).\n\n#### `GCLOUD_CREDENTIALS_FOLDER` and `GOOGLE_APPLICATION_CREDENTIALS` variables\n\nThis is used for GCP CLI authentication.\n\nBy default, the terraform container will use `${HOME}/.config/gcloud` folder,\nand `/root/.config/gcloud/application_default_credentials.json` file, respectively.\n\n\u003e `GOOGLE_APPLICATION_CREDENTIALS` path starts with `/root/` because this is the default user inside the container. Therefore you should not change it to your local user.\n\nInform different values if you want to point to another one.\n\n```shell\nexport GCLOUD_CREDENTIALS_FOLDER=/another/path/to/credentials/folder/\nexport GOOGLE_APPLICATION_CREDENTIALS=/root/another/path/to/credentials/file\nterraform init\nterraform plan\nterraform apply\n# it should be able to deploy to your cloud account based on the credentials used\n```\n\n### Cloud Development Kit for Terraform (CDKTF)\n\nIt is ready to work with Python.\n\n\u003e [Building the docker image for Python](docker/cdktf/python/).\n\n```shell\nmkdir /my/folder/learn-cdktf\ncd /my/folder/learn-cdktf\n\ncdktf --help\n\n# starts a new project from a template\ncdktf init --template=\"python\" --providers=\"aws@~\u003e4.0\"\n```\n\n### Ookla Speedtest CLI\n\n[Building the docker image](docker/speedtest/README.md).\n\n```shell\n# help\nspeedtest --help\n\n# run a speed test\nspeedtest\n```\n\n### Google Cloud CLI\n\n```shell\n# If are not logged in, run the command below and follow the steps:\n# 1. Copy/paste the provided URL in your browser\n# 2. Authorize using your Google account\n# 3. Copy/paste the generated auth code back in your terminal\ngcloud-login\n\n# If your current project is [None] or you wanna change it, set one.\ngcloud config set project \u003cPROJECT_ID\u003e\n\n# Test if it is working...\ngcloud version\ngcloud help\ngcloud storage ls\n```\n\n\u003e [gcloud CLI overview](https://cloud.google.com/sdk/gcloud).\n\n\u003e [gcloud auth login](https://cloud.google.com/sdk/gcloud/reference/auth/login).\n\n### Graph Viz for docker compose\n\nThis will create a dependency graph in `display` only, `dot`, or `image` formats\nbased on a docker-compose YAML file (defaults to `./docker-compose.yml`).\n\n\u003e For more info, please check its [official documentation](https://github.com/pmsipilot/docker-compose-viz?tab=readme-ov-file#usage).\n\n```shell\n# navigate to the directory where the docker-compose YAML file is\ncd /my/project/with/docker-compose-file/\n\n# using just default options\ndocker-compose-viz render\n\n# using a custom docker compose file\ndocker-compose-viz render ./my-custom-docker-compose.yml\n\n# dot output format\ndocker-compose-viz render --output-format=dot\n\n# image output format\ndocker-compose-viz render --output-format=image\n\n# setting the path/name of the output file\ndocker-compose-viz render --output-format=image --output-file=graph.png\n```\n\n### Playwright\n\n```shell\nplaywright # it will open the /bin/bash inside the container\n# then you can run the other test related commands\nnpx playwright install chromium\nnpm run test\n# etc...\n```\n\n\u003e For more info, please check its [official documentation](https://playwright.dev/docs/docker).\n\n## Author\n\n[David Cardoso](https://github.com/DavidCardoso)\n\n## Contributors\n\nFeel free to become a contributor! ;D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcardoso%2Fmy-ez-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcardoso%2Fmy-ez-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcardoso%2Fmy-ez-cli/lists"}