How it works
Ask mode operates in three phases:Basic usage
Implicit AWS detection
Explicit AWS flag
--aws to explicitly enable AWS context gathering.
Context gathering
Clanker intelligently determines which AWS services to query based on your question:Service detection
From~/workspace/source/internal/aws/client.go:198-262:
Supported service keywords
| Keyword | Service | Data Retrieved |
|---|---|---|
ec2, instance | EC2 | Instance state, type, IPs |
lambda, function | Lambda | Functions, runtime, last modified |
rds, database | RDS | DB instances, status, config |
s3, bucket | S3 | Buckets, creation dates |
ecs, container | ECS | Clusters, services, tasks |
iam, role | IAM | Roles (names only) |
log, cloudwatch, error | CloudWatch Logs | Log groups, recent errors |
Error log analysis
When asking about errors, Clanker fetches recent error logs:~/workspace/source/internal/aws/client.go:273-284:
AI tool calling
When AWS or GitHub context is enabled, Clanker uses AI tool calling for dynamic operations:Tool-based execution
From~/workspace/source/cmd/ask.go:1050-1061:
Available tools
Tools enable the AI to:- Execute AWS CLI commands dynamically
- Query specific resources by ID/ARN
- Analyze CloudWatch metrics
- Inspect security group rules
- Check IAM permissions
Advanced queries
Multi-service questions
Time-based queries
Cost analysis
Profile and region selection
Specify AWS profile
Use environment-based profiles
Configure environments in~/.clanker/config.yaml:
~/workspace/source/cmd/ask.go:664-678:
Discovery mode
Enable comprehensive infrastructure scanning:- Activates AWS and Terraform contexts
- Checks all services in parallel
- Returns resource counts and availability
~/workspace/source/cmd/ask.go:528-535:
Routing logic
Clanker uses intelligent routing to determine the target service:Keyword-based inference
LLM classification for ambiguous queries
When multiple services are detected, Clanker uses LLM-based routing: From~/workspace/source/cmd/ask.go:562-583:
Route-only mode (for integrations)
AI provider configuration
Configure AI provider
Set your preferred AI provider in~/.clanker/config.yaml:
Override via flags
Examples
Find stopped EC2 instances
Find stopped EC2 instances
Analyze Lambda cold starts
Analyze Lambda cold starts
Security group audit
Security group audit
Cost optimization
Cost optimization
Next steps
Maker/apply workflow
Generate and execute infrastructure plans
Service support
See all supported AWS services