{"id":16370753,"url":"https://github.com/integralist/ero","last_synced_at":"2025-10-26T07:32:03.909Z","repository":{"id":57614077,"uuid":"83029843","full_name":"Integralist/ero","owner":"Integralist","description":"Ero is a cli tool, built in Go, used to diff between local \u0026 remote Fastly VCL files","archived":false,"fork":false,"pushed_at":"2017-03-24T09:19:40.000Z","size":10,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T17:21:14.695Z","etag":null,"topics":["cdn","cli","client","diff","fastly","go","golang","varnish","vcl"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Integralist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-24T10:23:15.000Z","updated_at":"2023-08-21T22:20:39.000Z","dependencies_parsed_at":"2022-09-11T01:01:05.673Z","dependency_job_id":null,"html_url":"https://github.com/Integralist/ero","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Integralist/ero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Integralist","download_url":"https://codeload.github.com/Integralist/ero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281074244,"owners_count":26439422,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cdn","cli","client","diff","fastly","go","golang","varnish","vcl"],"created_at":"2024-10-11T03:05:52.925Z","updated_at":"2025-10-26T07:32:03.535Z","avatar_url":"https://github.com/Integralist.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ero\n\nEro is a cli tool, built in [Go](https://golang.org), used to diff between local \u0026 remote [Fastly CDN](https://www.fastly.com/) VCL files\n\n\u003e ero is \"difference\" in Finnish\n\nIf you require a cli tool for uploading local VCL files to a remote version within a Fastly account, then see [Lataa](https://github.com/Integralist/lataa)\n\n## Why?\n\nTypically when modifying VCL files, I'll be working within a 'staging' environment (this would be where we test out any VCL changes _before_ applying them to our production environment). \n\nLots of different engineers 'borrow' the staging environment so they can test their changes, but they don't necessarily put the `master` version back (which leaves the stage environment in an unknown, and possibly unstable, state). \n\nThis ultimately means I don't know what's changed in comparison to the branch I happen to be working on. What I've experienced in the past is a scenario where I upload a single VCL file to stage (this would be the file I'm modifying), but things don't work as expected because another VCL file has been changed to something from another engineer's testing branch and it causes a conflict or some other odd behaviour.\n\nThe `ero` cli tool allows me to quickly verify which files I _actually_ need to update (i.e. the file on stage isn't the same as what's in `master`). Otherwise I'll be forced to blindly upload 10+ separate VCL files via the Fastly UI to ensure that stage is in a stable state for me to upload my own changes on top of.\n\n## Installation\n\n```bash\ngo get github.com/integralist/ero\n```\n\n## Usage\n\n```bash\nero -help\n\n  -debug\n        show the error/diff output\n  -dir string\n        vcl directory to compare files against (default \"VCL_DIRECTORY\")\n  -help\n        show available flags\n  -match string\n        regex for matching vcl directories\n  -service string\n        your service id (default \"FASTLY_SERVICE_ID\")\n  -skip string\n        regex for skipping vcl directories (default \"^____\")\n  -token string\n        your fastly api token (default \"FASTLY_API_TOKEN\")\n  -vcl-version string\n        specify Fastly service 'version' to verify against\n  -version\n        show application version\n```\n\nSpecify credentials via cli flags:\n\n```bash\nero -service 123abc -token 456def\n```\n\n\u003e If no flags provided, fallback to environment vars:  \n\u003e `FASTLY_SERVICE_ID` and `FASTLY_API_TOKEN`\n\nView the error/diff output using the debug flag:\n\n```bash\nero -debug\n```\n\n\u003e Typically you'll not care for the output,  \n\u003e you just want to know the files didn't match up\n\nSpecify which nested directories you want to verfiy against:\n\n```bash\nero -match 'foo|bar'\n```\n\n\u003e Note: .git directories are automatically ignored  \n\u003e If no flag provided, we'll look for the environment var:  \n\u003e `VCL_MATCH_DIRECTORY`\n\nSpecify which nested directories you want to skip over:\n\n```bash\nero -skip 'foo|bar'\n```\n\n\u003e If no flag provided, we'll look for the environment var:  \n\u003e `VCL_SKIP_DIRECTORY`\n\n## Example\n\nThe following example execution has presumed the use of the environment variables: `VCL_DIRECTORY`, `FASTLY_API_TOKEN`, `FASTLY_SERVICE_ID` to keep the length of the command short.\n\n```bash\n$ ero -match www -debug\n\nNo difference between the version (123) of 'ab_tests_callback' and the version found locally\n        /Users/foo/code/cdn/www/fastly/ab_tests_callback.vcl\n\nNo difference between the version (123) of 'ab_tests_deliver' and the version found locally\n        /Users/foo/code/cdn/www/fastly/ab_tests_deliver.vcl\n\nNo difference between the version (123) of 'blacklist' and the version found locally\n        /Users/foo/code/cdn/www/fastly/blacklist.vcl\n\nNo difference between the version (123) of 'ab_tests_config' and the version found locally\n        /Users/foo/code/cdn/www/fastly/ab_tests_config.vcl\n\nNo difference between the version (123) of 'set_country_cookie' and the version found locally\n        /Users/foo/code/cdn/www/fastly/set_country_cookie.vcl\n\nNo difference between the version (123) of 'ab_tests_recv' and the version found locally\n        /Users/foo/code/cdn/www/fastly/ab_tests_recv.vcl\n\nThere was a difference between the version (123) of 'main' and the version found locally\n        /Users/foo/code/cdn/www/fastly/main.vcl\n\n18,21c18\n\u003c   # Blacklist check\n\u003c   # Add any IP or User-Agent that should be blacklisted to the blacklist.vcl file\n\u003c   call check_ip_blacklist;\n\u003c   call check_url_blacklist;\n---\n\u003e   call check_foo_blacklist;\n```\n\n## Build\n\nI find using [Gox](https://github.com/mitchellh/gox) the simplest way to build multiple OS versions of a Golang application:\n\n```bash\ngo get github.com/mitchellh/gox\n\ngox -osarch=\"linux/amd64\" -osarch=\"darwin/amd64\" -osarch=\"windows/amd64\" -output=\"ero.{{.OS}}\"\n\n./ero.darwin -h\n```\n\n## Environment Variables\n\nThe use of environment variables help to reduce the amount of flags required to get stuff done. For example, I always diff against a stage environment of Fastly and so I don't want to have to put in the same credentials all the time.\n\nBelow is a list of environment variables this tool supports:\n\n* `FASTLY_API_TOKEN`\n* `FASTLY_SERVICE_ID`\n* `VCL_DIRECTORY`\n* `VCL_MATCH_DIRECTORY`\n* `VCL_SKIP_DIRECTORY`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegralist%2Fero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fero/lists"}