Skip to content

feat: Add Q CLI and local SMUS MCP #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 18, 2025
Merged

feat: Add Q CLI and local SMUS MCP #736

merged 15 commits into from
Jul 18, 2025

Conversation

omursalo
Copy link
Contributor

@omursalo omursalo commented Jun 27, 2025

Description

This PR adds a Q CLI install to the v2 and v3 Dockerfiles similar to AWS CLI. It also enables free tier Q CLI login based on the SageMaker Unified Studio domain's Q Developer settings and sets some environment variables for Q CLI telemetry. We're also adding a SageMaker Unified Studio local MCP server for use with Q CLI.

Type of Change

  • Image update - Bug fix
  • [x ] Image update - New feature
  • Image update - Breaking change
  • SMD image build tool update
  • Documentation update

Release Information

Does this change need to be included in patch version releases? By default, any pull requests will only be added to the next SMD image minor version release once they are merged in template folder. Only critical bug fix or security update should be applied to new patch versions of existed image minor versions.

  • Yes (Critical bug fix or security update)
  • [x ] No (New feature or non-critical change)
  • N/A (Not an image update)

If yes, please explain why:
[Explain the criticality of this change and why it should be included in patch releases]

How Has This Been Tested?

We tested the features by building an image locally and attaching it to a SageMaker Unified Studio domain. We verified that Q CLI is accessible from the terminal, Q CLI loads in the added MCP server, and that users can chat with Q in their terminal. Additionally, we ran the tests when building the images. Most of the tests passed with a few failures from the GPU image tests, but those seem unrelated to our changes.

Checklist:

  • [x ] My code follows the style guidelines of this project
  • [x ] I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Test Screenshots (if applicable):

image

Related Issues

[Link any related issues here]

Additional Notes

[Any additional information that might be helpful for reviewers]

@omursalo omursalo requested a review from a team as a code owner June 27, 2025 23:07
@omursalo omursalo changed the title [feat] Add Q CLI feat: Add Q CLI Jun 27, 2025
@omursalo omursalo changed the title feat: Add Q CLI [Do Not Merge] feat: Add Q CLI Jul 2, 2025
@arief-hidayat
Copy link

I want this. thank you. hopefully it will get merged soon.

claytonparnell
claytonparnell previously approved these changes Jul 3, 2025
Copy link
Contributor

@claytonparnell claytonparnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you add some more detail of how you tested/which cases you ran?

@@ -62,6 +62,12 @@ RUN apt-get update && apt-get upgrade -y && \
sudo ./aws/install && \
rm -rf aws awscliv2.zip && \
: && \
# Install Q CLI
curl --proto '=https' --tlsv1.2 -sSf "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip" -o "q.zip" && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we plan to consume new updates to the Q CLI?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when new images are built, we'll pull the latest Q CLI version at that time.

@@ -200,6 +200,30 @@ else
echo readonly LOGNAME >> ~/.bashrc
fi

# Setup Q CLI auth mode
q_settings_file="$HOME/.aws/amazon_q/settings.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will this get executed?
Lets say there is a tier change from free to pro or pro to tier, can you explain the flow that happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is executed when the space starts up. So if we start with free tier, this will add the AMAZON_Q_SIGV4 variable to the local .bashrc file. If we switch tiers to paid, then the next time we open the space it will not set that variable. If the tier switch happens while we're actively using the space, then we'd need to restart the space to update the environment.

@omursalo omursalo changed the title [Do Not Merge] feat: Add Q CLI feat: Add Q CLI and local SMUS MCP Jul 18, 2025
@TRNWWZ TRNWWZ merged commit d0c5708 into aws:main Jul 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants