{"id":37141692,"url":"https://github.com/moldiscovery/swing","last_synced_at":"2026-01-14T16:37:57.758Z","repository":{"id":129574633,"uuid":"251538224","full_name":"moldiscovery/swing","owner":"moldiscovery","description":"Command line tool used to manage upload and download versioned files from AWS S3","archived":false,"fork":false,"pushed_at":"2023-03-22T11:42:50.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T16:41:33.092Z","etag":null,"topics":["aws","aws-s3","cli","go","golang"],"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/moldiscovery.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-31T08:04:53.000Z","updated_at":"2023-03-22T10:44:20.000Z","dependencies_parsed_at":"2023-06-12T07:00:35.238Z","dependency_job_id":null,"html_url":"https://github.com/moldiscovery/swing","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/moldiscovery/swing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldiscovery%2Fswing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldiscovery%2Fswing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldiscovery%2Fswing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldiscovery%2Fswing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moldiscovery","download_url":"https://codeload.github.com/moldiscovery/swing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moldiscovery%2Fswing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:32:27.303Z","status":"ssl_error","status_checked_at":"2026-01-14T16:28:36.419Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","aws-s3","cli","go","golang"],"created_at":"2026-01-14T16:37:57.316Z","updated_at":"2026-01-14T16:37:57.751Z","avatar_url":"https://github.com/moldiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swing\n\nSwing is a command line tool used to manage upload and download versioned files from AWS S3. It has been thought as an alternative to Git LFS.\n\nVersioning **MUST** be enabled on the buckets used with Swing for it to work correctly.\n\nEach time a file is uploaded its path and version are added to a CSV, the Swing file, so that it can be commited to VCS to ease tracking.\n\nFiles can be easily downloaded by running Swing in the same directory of the Swing file, all modified files will be downloaded using the specified version, if the specified version is not found the latest version will be downloaded instead.\n\n# Download\n\nDownload Swing for your OS from the [Releases page][swing-releases] and put it in your project root. Start using it\n\n# Configuration\n\nSwing will use the credentials found in the AWS shared credentials file, you can specify which profile to use by setting the env var `AWS_PROFILE`, otherwise the `default` profile will be used. The credentials file is stored in `~/.aws/credentials` on Linux and OS X, and `%UserProfile%\\.aws\\credentials` on Windows\n\nIf no credentials file is found Swing will search for this env vars:\n\n- AWS_ACCESS_KEY_ID\n- AWS_SECRET_ACCESS_KEY\n- AWS_SESSION_TOKEN (optional)\n\nIf the user's account has more a MFA device associated it will be prompted for the token generated.\nIn case the devices are more then one it will be first prompted to pick a device to use for MFA.\n\nIf neither credentials file and env vars are found Swing will fail.\n\nTo create your access keys see the [official AWS documentation][aws-credentials-docs].\nTo know more about the environment variables see [this other documentation][aws-env-vars-docs].\n\n## Configuration Examples\n\n### Using AWS Client\n\nInstall aws-cli using your favourite package manager or windows installer and Run\n\n```\n$ aws configure\nAWS Access Key ID [None]: my-aws-key\nAWS Secret Access Key [None]: my-aws-secret-key\nDefault region name [None]:\nDefault output format [None]:\n```\n\n### Using Environment Variables\n\n**_Linux_**\n\n```\nexport AWS_ACCESS_KEY_ID=my-aws-key\nexport AWS_SECRET_ACCESS_KEY=my-aws-secret-key\n```\n\nFor a persistent configuration copy above lines in your\n\n`~/.bashrc` or `~/.zshrc` depending on your shell\n\n**_Windows_**\n\nUsing Powershell:\n\n```\n$Env:AWS_ACCESS_KEY_ID = \"\u003cmy-aws-key\u003e\"\n$Env:AWS_SECRET_ACCESS_KEY= \"\u003cmy-aws-secret-key\u003e\"\n```\n\n# Users\n\n## Quickstart\n\n### Existing projects using swing\n\nOn existing projects it is supposed to have `swing.csv` somewhere in the code. If it's in the same dir swing is you'll just run\n\n```\n$ swing -d -s pathto/swing.csv\n```\n\n### New projects\n\nJust start uploading your files on an existing S3 bucket. You must have access to the bucket specified with option `-bucket` (Check the following Usage Section for details)\n\n## Usage\n\nSwing accepts these arguments:\n\n- `-h` or `-help` prints the help\n- `-r` or `-region` AWS region in which the bucket is stored\n- `-b` or `-bucket` name of the bucket to use\n- `-s` or `-swing-file` specifies a custom CSV file used to write files list on upload and read them on download, defaults to `swing.csv`\n- `-d` or `-download` starts download of files found in specified swing file\n- `-h` or `-help` shows the help text\n\nTo upload:\n\n```\nswing --bucket \u003cs3_bucket\u003e --region \u003caws_region\u003e \u003cpath_to_file\u003e\n```\n\nMultiple files can be uploaded at the same time if necessary:\n\n```\nswing --bucket \u003cs3_bucket\u003e --region \u003caws_region\u003e \u003cpath_to_file_1\u003e \u003cpath_to_file_2\u003e \u003cpath_to_file_3\u003e\n```\n\nIf the `--region` flag is omitted the region specified in the AWS shared config file for the current profile will be used, if no config file is found Swing will fail. The config file is stored in `~/.aws/config` on Linux and OS X, and in `%UserProfile%\\.aws\\config` on Windows.\n\nNote that the list of paths saved will be relative to the Swing file and they **MUST** be on the same or below folder.\n\nTo download:\n\n```\nswing --download\n```\n\nIf no default Swing file is found in the current folder nothing will be done.\n\nBoth on upload and download you can specify a custom Swing file with `--swing-file` and the relative path.\n\n# Developers\n\n## Necessary AWS IAM permissions\n\nS3 Buckets permissions\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListAllMyBuckets\",\n                \"s3:GetBucketLocation\",\n                \"s3:GetBucketAcl\"\n            ],\n            \"Resource\": \"arn:aws:s3:::*\"\n        },\n        {\n            \"Sid\": \"devBucketsAccess\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:*\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::mybucket*\"\n            ]\n        }\n    ]\n}\n```\n\nIAM permissions\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"GetUserInformations\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:GetUser\",\n                \"iam:ListMFADevices\"\n            ],\n            \"Resource\": \"arn:aws:iam::*:user/${aws:username}\"\n        }\n    ]\n}\n```\n\n## Swing file\n\nThe Swing file is a CSV not meant to be edited manually, each field is separated by a semicolon (`;`).\n\nThis is an example:\n\n```\nfile;region;bucket;md5;version_id\ndata/my_database.sqlite;eu-central-1;test.bucket.com;412300cb44e55e67dced78c42e7fbcaa;Edhf5InUn20iG8errAxTo3qjZx.OCXjE\nbig_binary;eu-central-1;test.bucket.com;ac6f71a29304799218cc2427f567f436;paZmQA4Di4kHbjbY1623l1raqqgYWRG3\nlibraries/other_lib.a;eu-central-1;test.bucket.com;f572bf8f0ca53b342aca927a509d3f6c;8_QHfD.C050sVkQKtqEz1jay7ZqGn2lZ\n```\n\n`file` is the path of the file relative to the Swing file.\n`region` and `bucket` are respectively the AWS region in which the bucket is hosting the file.\n`md5` is the hash of the file calculated during the upload.\n`version_id` is the id of the object uploaded version, returned by AWS after successful upload.\n\n## Build\n\nGo 1.14 or later are required.\n\nTo build run:\n\n```\ngo build\n```\n\nOr just install it with:\n\n```\ngo install\n```\n\n## Create a new Release\n\nGit Tag with X.X.X (e.g: 0.1.4), an action build will be triggered and if everything is ok a new release with same name will be ready for download\n\n[aws-env-vars-docs]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html\n[aws-credentials-docs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey\n[swing-releases]: https://github.com/moldiscovery/swing/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoldiscovery%2Fswing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoldiscovery%2Fswing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoldiscovery%2Fswing/lists"}