Skip to content

chore: adopt official curl installer for Claude Code CLI setup#1432

Merged
atxtechbro merged 1 commit intomainfrom
chore/claude-install-curl
Dec 4, 2025
Merged

chore: adopt official curl installer for Claude Code CLI setup#1432
atxtechbro merged 1 commit intomainfrom
chore/claude-install-curl

Conversation

@atxtechbro
Copy link
Copy Markdown
Owner

Git Statistics

  • Files changed: 1
  • Lines changed: 26 (10 additions, 16 deletions)

Summary

  • switch installation to official curl script for Claude Code CLI
  • remove node/npm prerequisites; add curl availability check
  • keep version detection and setup guidance after install

@amazon-q-developer
Copy link
Copy Markdown
Contributor

Code review in progress. Analyzing for code quality issues and best practices. You can monitor the review status in the checks section at the bottom of this pull request. Detailed findings will be posted upon completion.

Using Amazon Q Developer for GitHub

Amazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation.

Slash Commands

Command Description
/q <message> Chat with the agent to ask questions or request revisions
/q review Requests an Amazon Q powered code review
/q help Displays usage information

Features

Agentic Chat
Enables interactive conversation with Amazon Q to ask questions about the pull request or request specific revisions. Use /q <message> in comment threads or the review body to engage with the agent directly.

Code Review
Analyzes pull requests for code quality, potential issues, and security concerns. Provides feedback and suggested fixes. Automatically triggered on new or reopened PRs (can be disabled for AWS registered installations), or manually with /q review slash command in a comment.

Customization

You can create project-specific rules for Amazon Q Developer to follow:

  1. Create a .amazonq/rules folder in your project root.
  2. Add Markdown files in this folder to define rules (e.g., cdk-rules.md).
  3. Write detailed prompts in these files, such as coding standards or best practices.
  4. Amazon Q Developer will automatically use these rules when generating code or providing assistance.

Example rule:

All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
All Amazon DynamoDB Streams tables must have encryption enabled.
All Amazon SNS topics must have encryption enabled and enforce SSL.
All Amazon SNS queues must enforce SSL.

Feedback

To provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository.

For more detailed information, visit the Amazon Q for GitHub documentation.

Footnotes

  1. Amazon Q Developer uses generative AI. You may need to verify generated code before using it in your environment. See the AWS Responsible AI Policy.

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

Security Review Summary

This PR switches from npm-based installation to curl-based installation for Claude Code CLI. While this simplifies dependencies by removing Node.js/npm requirements, it introduces a critical security vulnerability.

Critical Issues Found:

  1. Security Risk: Direct piping of curl output to bash without verification (CWE-494)
  2. Resource Leak: Missing cleanup of temporary files

Recommendation:

The security vulnerability must be addressed before merge. The suggested fix downloads the script to a temporary file, performs basic validation, and ensures proper cleanup. This maintains the simplicity of the curl-based approach while adding essential security safeguards.

The change from npm to curl installation is otherwise sound and reduces system dependencies appropriately.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

fi

echo "Installing Claude Code CLI via official install script..."
if ! curl -fsSL https://claude.ai/install.sh | bash; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛑 Security Vulnerability: Piping curl output directly to bash without verification creates a significant security risk. The script downloads and executes code from without any integrity checks, certificate validation, or content verification.

Suggested change
if ! curl -fsSL https://claude.ai/install.sh | bash; then
# Download and verify the install script before execution
INSTALL_SCRIPT=$(mktemp)
if ! curl -fsSL -o "$INSTALL_SCRIPT"; then
echo -e "${RED}Failed to download Claude Code CLI installer. Please check your network connectivity.${NC}"
rm -f "$INSTALL_SCRIPT"
return 1
fi
# Basic verification - check if it looks like a shell script
if ! head -1 "$INSTALL_SCRIPT" | grep -q "^#!/"; then
echo -e "${RED}Downloaded installer does not appear to be a valid shell script.${NC}"
rm -f "$INSTALL_SCRIPT"
return 1
fi
echo "Installing Claude Code CLI via official install script..."
if ! bash "$INSTALL_SCRIPT"; then
echo -e "${RED}Failed to install Claude Code CLI. Please try again or check your network connectivity.${NC}"
rm -f "$INSTALL_SCRIPT"

Comment on lines 75 to 76
return 1
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing cleanup of temporary file. The temporary install script should be removed after execution to prevent leaving sensitive files on the filesystem.

Suggested change
return 1
fi
return 1
fi
rm -f "$INSTALL_SCRIPT" # Clean up temporary file

@atxtechbro atxtechbro merged commit 797955c into main Dec 4, 2025
@atxtechbro atxtechbro deleted the chore/claude-install-curl branch December 4, 2025 14:17
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.

1 participant