Configuration Playbook
Amazon Q Developer CLI
Overview
Configure Amazon Q for AWS-integrated code generation and analysis.
Quick Start
Install Amazon Q CLI and set basic settings:
brew install --cask amazon-q
q login
q settings chat.defaultModel "claude-3-sonnet"
q settings chat.enableKnowledge trueConfiguration Files & Locations
Amazon Q uses different configuration locations for different purposes:
Settings Configuration
| Scope | Location | Purpose | Git Tracked? |
|---|---|---|---|
| Global | Managed via q settings commands | User defaults, authentication, model settings | N/A |
| Project | .q/ directory (project root) | Team shared settings, context files | Yes |
| Local | .q/settings.local.yaml (project root) | Personal overrides (git-ignored) | No |
Manage settings via: q settings [key] [value] - This is the recommended way. See official settings guide.
MCP Configuration
MCP servers are configured separately:
| Scope | Location | Purpose | Git Tracked? |
|---|---|---|---|
| Global | ~/.aws/amazonq/default.json | MCP server configurations (all projects) | No |
| Project | .amazonq/default.json | Project-specific MCP servers | Yes |
| Legacy (Global) | ~/.aws/amazonq/mcp.json | Legacy MCP config (deprecated) | No |
| Legacy (Project) | .amazonq/mcp.json | Legacy project MCP config (deprecated) | Yes |
Note: Modern MCP configuration is in default.json. Legacy mcp.json support is controlled by useLegacyMcpJson field in ~/.aws/amazonq/default.json.
Authentication Setup
Amazon Q uses AWS Builder ID (free) or AWS Identity Center (pro) for authentication.
Builder ID (Free Tier)
- Run login command:
q login --license free - Opens browser for authentication
- Free tier with basic features
AWS Identity Center (Pro Tier)
- Run login with your organization’s details:
q login --license pro \ --identity-provider https://your-org.awsapps.com/start \ --region us-east-1 - Follow browser authentication flow
- Full access to all features
Check status: q whoami
Model & Core Configuration
| Option | Type | Default | Purpose |
|---|---|---|---|
chat.defaultModel | string | ”claude-3-sonnet” | Primary AI model for conversations |
chat.enableThinking | boolean | true | Enable complex reasoning tool |
chat.greeting.enabled | boolean | false | Show greeting message on chat start |
telemetry.enabled | boolean | true | Share usage metrics with AWS |
chat.enableKnowledge | boolean | true | Enable knowledge base functionality |
Example settings:
q settings chat.defaultModel "claude-3-opus"
q settings chat.enableThinking true
q settings telemetry.enabled falseTool Permissions & Security
Control which tools Amazon Q can use with granular permissions. Agent configuration uses JSON format:
{
"tools": [
"fs_read",
"fs_write",
"execute_bash",
"use_aws"
],
"allowedTools": [
"fs_read",
"fs_*",
"@git/git_status"
],
"toolsSettings": {
"fs_write": {
"allowedPaths": ["src/**", "tests/**"]
},
"execute_bash": {
"allowedCommands": ["git status", "cargo check", "npm test"]
},
"use_aws": {
"allowedServices": ["s3", "lambda", "dynamodb"]
}
}
}
For per-user settings managed via q settings commands, use the CLI (e.g., q settings chat.defaultModel "claude-3-sonnet").
MCP Servers & Tool Integration
Register external Model Context Protocol (MCP) servers to extend Amazon Q’s capabilities.
Global MCP Configuration
Edit ~/.aws/amazonq/default.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
},
"timeout": 60000
},
"git": {
"command": "git-mcp",
"args": [],
"env": {
"GIT_CONFIG_GLOBAL": "/dev/null"
},
"timeout": 120000
}
},
"tools": [
"@github",
"@git/git_status",
"@git/git_log"
],
"allowedTools": [
"@github/search_*",
"@git"
]
}
Project-Level MCP Configuration
Create .amazonq/default.json in project root:
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["./mcp-server-postgres.js"],
"env": {
"DATABASE_URL": "postgresql://localhost/mydb"
}
}
},
"tools": ["use_postgres"],
"allowedTools": ["@postgres/*"]
}
Environment variable resolution uses ${VAR_NAME} syntax from shell environment.
Knowledge Base Configuration
Enable semantic search over your project:
q settings chat.enableKnowledge true
q settings knowledge.indexType "Best" # or "Fast"
q settings knowledge.maxFiles 1000
q settings knowledge.defaultIncludePatterns '["**/*.rs", "**/*.md", "**/*.toml"]'
q settings knowledge.defaultExcludePatterns '["**/target/**", "**/node_modules/**"]'Agent Configuration
Create specialized AI assistants in .q/agents/my-agent.json:
{
"name": "rust-developer",
"description": "Specialized for Rust and AWS development",
"prompt": "You are an expert Rust developer with AWS knowledge",
"model": "claude-3-sonnet",
"tools": [
"fs_read",
"fs_write",
"execute_bash",
"use_aws",
"@git"
],
"allowedTools": [
"fs_*",
"execute_bash",
"use_aws",
"@git/*"
],
"resources": [
"file://README.md",
"file://docs/**/*.md"
],
"hooks": {
"postToolUse": [
{
"matcher": "fs_write",
"command": "rustfmt $(jq -r '.tool_input.path')"
}
]
}
}
Run with: q chat --agent rust-developer
Team & Enterprise Configuration
Amazon Q enforces separation between team-shared configuration (git-tracked) and personal settings (local only):
Shared Team Configuration (Git-Tracked)
Store team guidelines and custom agents in version control:
Project Rules (.amazonq/rules/**/*.md):
Code Review Process
- All changes require at least 2 approvals
- Include tests for new functionality
- Update documentation for API changes
Commit Messages
- Use conventional commit format
- Include ticket numbers in commit messages
**Shared Agents** (`.amazonq/cli-agents/team-agent.json`):
```json
{
"name": "team-agent",
"description": "Team development standards agent",
"resources": [
"file://.amazonq/rules/**/*.md",
"file://README.md",
"file://docs/**/*.md"
],
"tools": [
"fs_read",
"execute_bash"
]
}
Personal Overrides (Local Only)
Individual developers set personal preferences via q settings commands (not committed):
q settings chat.defaultModel "claude-3-opus"
q settings telemetry.enabled false
q settings chat.defaultAgent team-agent
Settings are stored in ~/.aws/amazonq/ (never commit to git).
MCP Servers for Teams
Shared MCP servers go in project-level .amazonq/default.json:
{
"mcpServers": {
"shared-github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
},
"allowedTools": [
"@github/search_*",
"fs_read"
]
}Custom Commands & Recipes
Amazon Q supports custom agents and prompt templates rather than fixed commands. Create agents for common workflows:
name: "deploy"
description: "Handles deployment workflows"
prompt: "You are a deployment specialist"
tools:
- execute_bash
- use_aws
toolsSettings:
execute_bash:
allowedCommands:
- "git push"
- "npm run build"
- "aws s3 sync"Best Practices
✅ Do:
- Use
q settingscommands to manage configuration - Store sensitive values in environment variables or
.envfiles - Create project-specific agents in
.q/agents/ - Use tool permissions to limit access in shared environments
- Enable knowledge base for better project context
- Commit team settings to version control, keep personal overrides local
❌ Don’t:
- Edit YAML files directly (use
q settingscommands) - Commit personal authentication tokens
- Disable all tool permissions (breaks functionality)
- Use wildcard permissions in production without review
- Ignore the
q diagnosticcommand when troubleshooting
Troubleshooting & Validation
Validate configuration:
q diagnostic
q settings list
Common issues:
| Problem | Solution |
|---|---|
| Auth fails | Run q login and check q whoami |
| Tools blocked | Check allowedTools and toolsSettings in settings |
| MCP server not found | Verify command path and environment variables |
| Knowledge base empty | Run q settings chat.enableKnowledge true |
| Settings not applied | Use q settings list to verify, restart chat session |
Debug mode:
q settings log.level "debug"
q chat --verbose
Check logs: q diagnostic --format json
Additional Resources
Last updated: 2025-11-12