DEV Community

John  Ajera
John Ajera

Posted on

Building a DevContainer Feature for Amazon Q CLI (Inspired by a Kiwi Memory Game)

๐Ÿ’ก Building a DevContainer Feature for Amazon Q CLI (Inspired by a Kiwi Memory Game)

While experimenting with Amazon Q CLI, I stumbled upon a small but persistent friction point: getting it installed in a Dev Container every time.

So I solved it.

This is the story of building a memory game with Amazon Q, the packaging challenge I ran into, and how I solved it with a custom Dev Container Feature published on GitHub Container Registry (GHCR).

๐ŸŽฎ The Project: Q Kiwi Memory Game

I wanted to test how far I could go using Amazon Q CLI as a pair programmer. So I started a fun little repo called:

๐Ÿ‘‰ q-kiwi-memory-game

It's a simple memory game powered by HTML/JS, designed with a clean goal: build entirely with Q CLI prompting.

I used the CLI to generate functions, refactor layout, and even tune CSS. The experience was surprisingly smoothโ€ฆ but only after I sorted out the environment.

๐Ÿ“Š The Problem: Reinstalling Q CLI Every Time

Amazon Q CLI isn't bundled in standard containers or features. And since Dev Containers are ephemeral or rebuilt often, I kept hitting the same pain:

โ€œWhy do I have to install Amazon Q CLI manually every single time?โ€

This broke flow. And since I love DevContainers for isolated development, I needed a better way.

โœจ The Solution: DevContainer Feature for Amazon Q CLI

So I built this:

๐Ÿ‘‰ ghcr.io/jajera/features/amazon-q-cli:1

This is a Dev Container Feature that installs the Amazon Q CLI into your environment, automatically.

You just reference it in your .devcontainer.json:

{
  "name": "With Amazon Q CLI",
  "features": {
    "ghcr.io/jajera/features/amazon-q-cli:1": {}
  }
}
Enter fullscreen mode Exit fullscreen mode

Thatโ€™s it. Rebuild your Dev Container, and you're ready to run:

q help
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“… No more curl && tar && sudo mv.

๐Ÿ”ง Under the Hood

The feature is built using the containers.dev feature spec, packaged and published via GHCR.

Repo: github.com/jajera/features
Image: ghcr.io/jajera/features/amazon-q-cli

The install script handles downloading the latest version of Q CLI from AWS, sets it in your path, and ensures it's ready for use as soon as your container starts.

๐Ÿงฌ Why This Matters

If you're experimenting with AI coding tools like Amazon Q CLI, you want your setup to be frictionless. This makes it:

  • โœ… Easy to onboard
  • โœ… Reproducible for teams
  • โœ… Quick to rebuild without reinstall hell

Combine it with GitHub Codespaces or VS Code Remote Containers, and youโ€™ve got a ready-to-code AI-enhanced playground in seconds.

๐ŸŒŸ Final Thoughts

Packaging up the Amazon Q CLI as a DevContainer feature wasn't just a convenienceโ€”it's the kind of developer quality-of-life improvement that keeps flow going.

If you're building with Amazon Q or just want a smooth setup experience, I hope this helps.

๐Ÿ‘‰ Game on.
๐Ÿš€ Happy building.

Top comments (0)