Skip to main content

atmos ai ask

Use this command to ask the AI assistant a specific question and get an immediate response, without entering an interactive chat session.

Experimental

Configure AI

Learn how to configure AI providers, skills, tools, and sessions in your atmos.yaml.

atmos ai ask --help

Description

The atmos ai ask command allows you to ask questions directly from the command line. The AI assistant analyzes your question in the context of your Atmos configuration and provides a detailed response.

This is ideal for:

  • Quick one-off questions
  • Scripting and automation
  • Getting specific information without interactive mode
  • CI/CD pipeline integration

Usage

atmos ai ask [question]

Arguments

question
The question to ask the AI assistant (required). Use quotes for multi-word questions.

Flags

--include <pattern>
Add glob patterns to include in context (can be repeated)
--exclude <pattern>
Add glob patterns to exclude from context (can be repeated)
--no-auto-context
Disable automatic context discovery
--no-tools
Disable tool execution for faster, simpler queries

Examples

General Atmos Questions

atmos ai ask

$ atmos ai ask "What are Atmos stacks?"

👽 Thinking...

Atmos stacks are configurations that define how components are deployed
across different environments. A stack is essentially a YAML file that
specifies:

1. Which components to deploy
2. Variable values for those components
3. Environment-specific settings
4. Stack inheritance relationships

Stacks enable you to:
- Manage multiple environments (dev, staging, prod)
- Share common configurations across environments
- Override settings for specific use cases
- Organize infrastructure logically

Configuration-Specific Questions

atmos ai ask (Claude)

$ atmos ai ask "what stacks and components do we have in the infra?"

👽 Thinking...

I'll list all the available stacks and components in your infrastructure.

Based on the infrastructure configuration, here are the stacks and components:

## Stacks (4 total)

1. **ue1-network** - Network stack in us-east-1
2. **ue1-prod** - Production stack in us-east-1
3. **uw2-network** - Network stack in us-west-2
4. **uw2-prod** - Production stack in us-west-2

## Components by Stack

### ue1-network

• tgw/attachment - Transit Gateway attachment
• tgw/hub - Transit Gateway hub
• vpc - Virtual Private Cloud

### ue1-prod

• tgw/attachment - Transit Gateway attachment
• vpc - Virtual Private Cloud

### uw2-network

• tgw/attachment - Transit Gateway attachment
• tgw/cross-region-hub-connector - Cross-region Transit Gateway connector
• vpc - Virtual Private Cloud

### uw2-prod

• tgw/attachment - Transit Gateway attachment
• vpc - Virtual Private Cloud

## Summary

Your infrastructure is organized across two AWS regions (us-east-1 and us-west-2),
with dedicated network and production stacks in each region. The network stacks
contain Transit Gateway hubs for network connectivity, while the production stacks
use Transit Gateway attachments to connect to the network infrastructure. All stacks
include VPC components for network isolation.

atmos ai ask (Gemini)

$ atmos ai ask "what is the metadata section of the vpc component in the ue1-prod stack?"

👽 Thinking...

The metadata section of the vpc component in the ue1-prod stack is:

component: mock
locked: true

atmos ai ask (Claude)

$ atmos ai ask "what is the metadata section of the vpc component in the ue1-prod stack?"

👽 Thinking...

I'll help you find the metadata section of the vpc component in the ue1-prod stack.

Based on the results, the metadata section of the vpc component in the ue1-prod stack is:

metadata:
component: mock
locked: true

This metadata indicates that:

• The component field is set to "mock" (which is the actual Terraform component being used)
• The locked field is set to true (indicating this component configuration is locked)

Component-Specific Questions

atmos ai ask "Describe the vpc component in the dev stack"
atmos ai ask "What variables does the eks component require?"
atmos ai ask "How is the rds component configured in production?"

Best Practices Questions

atmos ai ask "What's the best way to organize my components?"
atmos ai ask "How should I structure my stack inheritance?"
atmos ai ask "What are the security best practices for Atmos?"

Workflow Questions

atmos ai ask "How do I use workflows in Atmos?"
atmos ai ask "What's the difference between terraform and helmfile components?"
atmos ai ask "How do I vendor external components?"

Advanced Usage

In Scripts and Automation

#!/bin/bash

# Get AI assistance in a script
response=$(atmos ai ask "What components are affected by changes to networking?")
echo "$response"

# Use in CI/CD
if atmos validate stacks; then
atmos ai ask "What's the recommended deployment order for these stacks?"
fi

Complex Multi-Part Questions

# Use quotes for multi-word questions
atmos ai ask "How do I migrate from one cloud provider to another using Atmos?"

# Ask about specific error messages
atmos ai ask "I'm getting error 'component not found'. What does this mean and how do I fix it?"

Output Format

The command outputs:

  1. Thinking indicator - Shows the AI is processing
  2. AI response header - Identifies the response source
  3. Formatted response - Markdown-formatted answer with code blocks, lists, and emphasis

Comparison with Other Commands

atmos ai ask
One-off questions, scripting, quick answers.
atmos ai chat
Extended conversations, learning, exploration.