Amazon Lightsail CLI Extensions
April 23, 2026 ยท View on GitHub
This project is the source code of lightsailctl, a tool that
augments Amazon Lightsail features in AWS CLI.
Usage
lightsailctl is executed automatically by AWS CLI when certain
subcommands are used, such as aws lightsail push-container-image.
$ lightsailctl --plugin -h
Usage of `lightsailctl --plugin`:
--input payload
plugin payload
--input-stdin
receive plugin payload on stdin
Installing
Homebrew ๐ป
brew install aws/tap/lightsailctl
From Source
lightsailctl is written in Go, so please install Go.
If all you want is to install lightsailctl binary, then do the following:
go install github.com/aws/lightsailctl@latest
Note: the executable is installed in
$HOME/go/binon macOS/Linux/Unix and in%USERPROFILE%\go\binon Windows.
Keep reading if you want to work with lightsailctl source code locally.
After you clone this repo and open your terminal app in it, you'll be able to test and build this code like so:
go test ./...
go install ./...
Windows
For Windows installation instructions, please see Install Docker, AWS CLI, and the Lightsail Control plugin for containers.
Development
The Makefile wraps the common tasks:
make tools # install goreleaser and golangci-lint (one-time)
make lint # run golangci-lint
make test # run unit tests
make ci # lint + test (same as CI)
make snapshot # build local release artifacts via goreleaser (dist/)
make help # list targets
Under The Hood
Let's consider this command and see what actually happens:
aws lightsail push-container-image \
--service-name hello \
--image hello-world:latest \
--label www
The above command pushes a local container image with tag
hello-world:latest to make it available in Lightsail container
service deployments for service hello.
This container image pushing logic requires a number of steps that are
outsourced from AWS CLI to lightsailctl.
Here's a shell invocation of lightsailctl that approximates what AWS
CLI does when the command above is invoked:
$ echo '{
"inputVersion": "1",
"operation": "PushContainerImage",
"payload": {
"service": "hello",
"label": "www",
"image": "hello-world:latest"
}
}' | lightsailctl --plugin --input-stdin
85fcec7ef3ef: Layer already exists
3e5288f7a70f: Layer already exists
56bc37de0858: Layer already exists
1c91bf69a08b: Layer already exists
cb42413394c4: Layer already exists
Digest: sha256:0b159cd1ee1203dad901967ac55eee18c24da84ba3be384690304be93538bea8
Image "hello-world:latest" registered.
Refer to this image as ":hello.www.73" in deployments.
Security Disclosures
See CONTRIBUTING.md for more information.
Giving Feedback and Contributing
Aside from the security feedback covered above, do you have any feedback, bug reports, questions or feature ideas?
You are welcome to write up an issue for us.
Please read about Contributing Guidelines.
Releases
Releases are automated: pushing a v*.*.* tag triggers
.github/workflows/release.yml, which uses
GoReleaser to cross-compile binaries and attach them to a
new GitHub release.
License
This project is licensed under the Apache-2.0 License.