{"id":16649198,"url":"https://github.com/rcmdnk/ec2","last_synced_at":"2026-04-29T03:06:43.228Z","repository":{"id":43603808,"uuid":"511417621","full_name":"rcmdnk/ec2","owner":"rcmdnk","description":"AWS CLI Wrapper","archived":false,"fork":false,"pushed_at":"2026-04-07T15:53:50.000Z","size":138,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-07T17:27:19.155Z","etag":null,"topics":["aws","aws-ec2","ec2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcmdnk.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-07T06:57:12.000Z","updated_at":"2026-04-07T15:53:54.000Z","dependencies_parsed_at":"2024-01-29T18:55:10.476Z","dependency_job_id":"8773e994-c4f7-4679-8da2-9abb33fe070a","html_url":"https://github.com/rcmdnk/ec2","commit_stats":null,"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/rcmdnk/ec2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcmdnk%2Fec2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcmdnk%2Fec2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcmdnk%2Fec2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcmdnk%2Fec2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcmdnk","download_url":"https://codeload.github.com/rcmdnk/ec2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcmdnk%2Fec2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32408456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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-ec2","ec2"],"created_at":"2024-10-12T09:07:55.291Z","updated_at":"2026-04-29T03:06:43.221Z","avatar_url":"https://github.com/rcmdnk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ec2\n\nAWS CLI Wrapper for EC2 management.\n\n## Requirement\n\n- [AWS CLI](https://aws.amazon.com/cli/)\n\n## Installation\n\nUse Homebrew:\n\n```\n$ brew install rcmdnk/rcmdnkpac/ec2\n```\n\nIf you have not installed `awscli` by Homebrew, it is also installed.\n\nOr put `bin/ec2` and `bin/ec2_submit` anywhere in the PATH.\n(In this case, you need to install `awscli` by yourself.)\n\n## ec2\n\n### Usage\n\n```\nUsage: ec2 \u003csubcommand\u003e [options]\n\nSubcommands:\n  commands                           List commands.\n  delete_job                         Delete jobs.\n  describe                           Show detailed information about instances\n  help                               Show help.\n  images                             List images.\n  instances                          List instances.\n  jobs                               List jobs.\n  launch                             Launch a new instance.\n  list                               Alias for instances.\n  list_json_groups                   List available JSON groups\n  ls                                 Alias for instances.\n  mosh                               Mosh to an instance.\n                                     Use `mosh [commands] [options]`.\n  new_image                          Create a new image from an instance.\n  new_template                       Create a new template from an image.\n  price                              Alias for pricing.\n  pricing                            Show pricing of instance types.\n  rm                                 Alias for terminate.\n  rm_image                           Delete images.\n  scp                                SCP to an instance.\n                                     Use `scp \u003cfile\u003e [options]`.\n  ssh                                SSH to an instance.\n                                     Use `ssh [commands] [options]`.\n  start                              Start stopped instances.\n  stop                               Stop running instances.\n  submit                             Make a new instance and submit a job.\n                                     Use `submit \u003cfile or commands\u003e [options].\n                                     If __submit_command is not set, need one\n                                     bash file.\n                                     If __submit_command is set, given options\n                                     are recognized as command. Use `--` to\n                                     separate options for ec2 and options  for\n                                     the command.\n                                     If `__curent_dir` is set, the command is\n                                     executed in the current directory.\n                                     (Need same directory structure in the\n                                     instance.)\n  templates                          List templates.\n  terminate                          Terminate instances.\n  types                              List instance types.\n  update_types                       Force update instance type list cache\n  version                            Show version.\n\nOptions:\n  --all, -a                          Set 1 to ignore preset filters.\n  --aws-profile                      Profile name for aws cli (if not\n                                     specified, the default profile is used.)\n  --cli-input-json, -c               A json file which has parameters to launch\n                                     an instance. Multiple files can be\n                                     assigned by comma separated list.\n                                     If multiple files are given, secondary\n                                     files are used if the first one failed by\n                                     the capacity problem.\n  --cli-input-json-group, -G         JSON group name for launch\n                                     an instance. Multiple groups can be\n                                     assigned by comma separated list.\n                                     If multiple groups are given, secondary\n                                     groups are used if the first one failed by\n                                     the capacity problem.\n  --cli-input-json-directory, -C     A directory which has json files. If\n                                     cli_input_json is not assigned and\n                                     cli_input_json_directory is set, files are\n                                     searched and it enters the selection mode.\n  --cpu-filter                       Filter to pick up instance type by CPU.\n  --dry-run, -d                      Set 1 to run as dry run mode (modification\n                                     commands are not executed.)\n  --gpu-filter                       Filter to pick up instance type by GPU.\n  --image-id                         Image name for new_image/rm_image command.\n  --image-name, -I                   Image name for new_image/rm_image command.\n  --image-name-filter                Filter to pick up images (AMI).\n  --instance-id, -i                  Assign instance id to be managed. If '' or\n                                     'select' is passed, it is selected\n                                     interactively.\n  --instance-type, -t                 Instance type for launch command. If ''\n                                     or 'select' is passed, it is selected\n                                      interactively.\n  --mosh-server, -m                  Mosh server path.\n  --n-cpu-core, -n                   Set number of CPU core of instance to set\n                                     other than default number.\n  --n-thread                         Set 1 to disable hyper-threading.\n  --name-filter, -f                  Only instances which include this value\n                                     is listed.\n  --private-ip, -P                   Set 1 to use private IP addresses instead\n                                     of public IP addresses.\n  --retry-non-spot                   Set 0 to disable retry to launch a\n                                     non-spot instance when launching a spot\n                                     instance failed.\n  --selection-tool, -s               Selection tool list, separated by ','. The\n                                     default value is 'sentaku,peco,fzy,fzf'.\n                                     The first one found is used. If nothing,\n                                     bash's 'select' is used. Tools ref:\n                                       - [sentaku](https://github.com/rcmdnk/sentaku/)\n                                       - [peco](https://github.com/peco/peco)\n                                       - [fzy](https://github.com/jhawthorn/fzy)\n                                       - [fzf](https://github.com/junegunn/fzf)\n  --spot-instance, -S                Set 1 to launch a spot instance.\n  --ssh-key, -k                      Key for ssh.\n  --ssh-option                       Additional ssh options.\n  --ssh-user, -u                     User for ssh.\n  --submit-command                   Set 1 to submit command instead of\n                                     submitting script file.\n  --submit-current-dir               Set 1 to use the current directory as the\n                                     working directory by submit.\n  --submit-n-retry-launch            Number of retries to launch an instance by\n                                     submit. Default is 0.\n  --submit-retry-launch-interval     Interval of retry to launch an instance by\n                                     submit (sec) when all combinations of\n                                     cli_input_json failed. Default is 60.\n  --submit-n-retry-ssh               Number of retries after ssh connection\n                                     failed. Default is 0.\n  --submit-retry-ssh-interval        Interval of retry after ssh connection\n                                     failed (sec). Default is 10.\n  --submit-name                      Name of submitted job. If not given, the\n                                     command name is used.\n  --submit-max-jobs                  Maximum number of submitted jobs running\n                                     in parallel.\n  --submit-measure-time              Set 1 to measure time of the command.\n  --submit-remain-instance           Set 1 to keep instances after finishing\n                                     submitted jobs.\n  --template-id, -T                  Assign template id. If not given, not\n                                     templated is used. If 'select' is passed,\n                                     it is selected interactively.\n  --user-data, -U                    user data file for luanch (run-instances),\n                                     e.g: file:///path/to/your/user/data/script\n  --verbose, -v                      Set 1 to run as verbose mode (show\n                                     executing commands.)\n  --help, -h                         Show help.\n```\n\n### AWS CLI Profile\n\nIf you want to use a profile other than the default,\nuse `--aws-profile`, set `aws_profile` in the configuration file or\nset:\n\n```\nexport AWS_PROFILE=xxx\n```\n\nbefore using ec2.\n\n### Configuration\n\nUse **~/.config/ec2/config**.\n\nOptions can be set like:\n\n```\nname_filter=my-instance\n```\n\n`#` can be used to comment out the line.\n\nAvailable options are same as the command line options starting with `--`, but without `--` and `-` is replaced by `_`,\ni.e., `aws_profile` for `--aws-profile`.\n\n### Examples\n\n#### Manage my instances with the prefix \"my-instances\"\n\nMake ~/.config/ec2/config file as follows:\n\n```\nname_filter=my-instances\nssh_key=~/.ssh/my_ssh.pem\nssh_user=ec2-user\naws_profile=my-profile\n```\n\nThis will show only instances which include `my-instances` in the Name.\n\nIt uses the key **~/.ssh/my_ssh.pem** at `ec2 ssh` or `ec2 mosh`, with the user name `ec2-user`.\n\nSet `aws_profile` if you want to use other than the default profile.\n\n#### Launch new instance\n\n```\n$ ec2 -t r3.large launch\n```\n\nIf you give `-t select`, you can choose the instance type from the list.\n\nYou can pass the template name by `-T \u003cyour template\u003e`, too.\n\n#### Create a new template version\n\nFirst, make a new AMI from an existing instance:\n\n```\n$ ec2 new_image\n```\n\nThen, make new template version:\n\n```\n$ ec2 new_template\n```\n\nDuring the command, select the template name that you want to update\nand select a new AMI created above.\n\nIf old AMI is not necessary, remove it:\n\n```\n$ ec2 rm_image\n```\n\nThis command also removes the associated snapshot.\n\nNote: `new_image` create a new version of the template. If you do not have any templates,\nmake it with the Web interface or aws cli command directly.\n\n### Development\n\n#### pre-commit\n\nInstall pre-commit by pip:\n\n```\n$ pip3 install pre-commit\n```\n\nor by Homebrew\n\n```\n$ brew install pre-commit\n```\n\nInstall pre-commit environment:\n\n```\n$ pre-commit install\n```\n\nThen, automatically checked at `git commit` or run checks manually:\n\n```\n$ pre-commit run -a\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcmdnk%2Fec2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcmdnk%2Fec2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcmdnk%2Fec2/lists"}