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.
Learn how to configure AI providers, skills, tools, and sessions in your atmos.yaml.
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
The answer prints on stdout. The progress spinner and any approval prompts go to stderr, so piping the answer (for example atmos ai ask "..." | cat) stays clean.
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 Atmos tool execution for faster, simpler queries. CLI providers retain their native tools.
--session <name-or-id>,-s- Resume a saved session by name or ID, or create one with this name. Requires
ai.sessions.enabled: true. Saves questions and answers so subsequentask,exec, andchatinvocations can continue the conversation. Environment variable:ATMOS_AI_SESSION. --mcp <servers>- MCP servers to use (comma-separated). Skips automatic server routing and starts only the specified servers. Can be repeated:
--mcp aws-iam --mcp aws-billing. Useatmos mcp listto see available server names. Environment variable:ATMOS_AI_MCP
When multiple MCP servers are configured with API providers, Atmos automatically selects only the servers relevant to your question using a lightweight routing call. Use --mcp to bypass routing and specify servers directly. CLI providers (claude-code, codex-cli, copilot-cli, opencode, gemini-cli) skip routing — all servers are passed to the CLI tool, which handles selection internally.
Examples
General Atmos Questions
Configuration-Specific Questions
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?"
MCP Server Questions
# Auto-routing selects the right server automatically
atmos ai ask "What did we spend on EC2 last month?"
atmos ai ask "Is GuardDuty enabled in us-east-1?"
# Specify servers directly (skip routing)
atmos ai ask --mcp aws-iam "List all admin roles"
atmos ai ask --mcp aws-iam,aws-cloudtrail "Who accessed the admin role?"
# Environment variable
ATMOS_AI_MCP=aws-billing atmos ai ask "Show our billing summary"
Tool Approval
When the AI needs to run a tool, for example atmos list stacks, ask pauses and shows an approval prompt in your terminal. Claude waits while you decide and then continues in the same run. There are no extra flags, and you do not need to re-run the command.
After you choose, the prompt disappears and a one-line receipt stays, so the answer is easy to find:
Use the arrow keys to choose an option and press Enter.
- Allow once
- Run the tool this time only.
- Always allow
- Run the tool and remember the decision in
.atmos/ai.settings.local.json. ForBash, the decision is scoped to the exact command, for exampleBash(atmos list stacks). A different command still prompts. The option label shows the saved scope; tools without a specifier, including MCP tools, are remembered for all arguments. - Deny once
- Refuse this call. The model continues and explains what it could not do.
- Always deny
- Refuse the call and remember the decision in
.atmos/ai.settings.local.json.
Press Esc, Ctrl-D, or Ctrl-C at the prompt to abort the run.
To skip prompts for tools you trust, list them in ai.tools.allowed, or set ai.tools.mode in your atmos.yaml:
See AI Tools for the full permission flow, and the Claude Code provider for provider-specific behavior.
When approval would be needed and no terminal is available, atmos ai ask fails with an error instead of waiting. Run the command in a terminal, set ai.tools.mode: allow (or yolo in an isolated runner), or add the tool to ai.providers.claude-code.allowed_tools. For automation, atmos ai exec is designed for non-interactive use.
Questions From the AI
When the AI needs you to choose between options or confirm something before it continues, it asks with a selection list instead of a free-form question in its reply. This works with the claude-code provider.
Use the arrow keys and press Enter. Choose Other… to type an answer that is not listed. Some questions allow several choices; use Space to mark each one. Your answer goes back to the AI, which continues in the same run. Press Esc, Ctrl-D, or Ctrl-C to abort the run.
A question is not a tool permission, so ai.tools.mode, allowed, and blocked do not apply to it. In CI and other places without a terminal, the AI is told nobody can answer and carries on with reasonable assumptions.
Follow-Up Questions
An answer often ends with an offer to go further, such as "I can break that down by tenant if you'd like". In a terminal, ask keeps the conversation open so you can accept the offer without retyping the question or starting over.