AI-Shell: Your Fast Lane to AI Power in the Command Line

Update: the tool now allows any model selection from the 3 services offered and long prompts via your default cli tool (https://github.com/j-d-carmichael/ai-shell/blob/main/CHANGELOG.md) Artificial intelligence is everywhere, transforming how we work, code, and create. We have powerful web interfaces like ChatGPT, Claude.ai, and Gemini, and increasingly sophisticated IDE integrations like GitHub Copilot. But what if neither feels quite right for your workflow? Sometimes, loading a full web GUI feels like overkill for a quick question. Other times, integrated tools, while powerful, might feel too intrusive or not flexible enough for specific, ad-hoc queries. As a developer often living in the terminal, I found myself wanting something faster, more direct, and less disruptive. That’s why I created AI-Shell. ais --help Usage: ais [options | command] ["Your prompt here..."] Interact with AI services via the command line. Arguments: prompt The prompt to send to the AI (leave empty for interactive chat, it will open your default cli text editor) Options: -V, --version output the version number -v, --verbose Enable verbose output -h, --help display help for command Commands: set Set/update the AI service, model, and API key set-system-prompt|sp Set or update the system prompt for AI interactions config|c List the current AI configuration (service and model) config-clear Removes all cached config data and stored API keys list|ls List all available AI configurations (service and model) ai-shell (ais) AI-Shell is a simple, open-source command-line interface (CLI) tool designed for developers, sysadmins, and anyone who prefers the speed and efficiency of the terminal. It allows you to interact seamlessly with leading AI models from Google (Gemini), OpenAI (GPT), and Anthropic (Claude) without ever leaving your command line. Why AI-Shell? The Need for Speed and Simplicity The core idea behind AI-Shell is to bridge the gap. It’s for those moments when you need AI assistance now, without context switching to a browser or wrestling with an integration that doesn’t quite fit the immediate need. Speed: Launching a terminal and typing ais “your question” is significantly faster than opening a browser tab, waiting for it to load, and then typing. Focus: Stay within your terminal environment, whether it’s in your IDE’s integrated terminal, a separate iTerm/Windows Terminal window, or SSH’d into a server. Control: You choose the provider (OpenAI, Anthropic, Google) and the specific model you want to use. Privacy: Your API keys and preferences are stored securely and locally using the conf package, never leaving your machine. What Does AI-Shell Do & How It Works AI-Shell keeps things straightforward: 1) Easy Setup: The first time you run ais (or explicitly run ais set), it guides you through selecting your preferred AI provider (OpenAI, Anthropic, Google), choosing a model (like gpt-4o-mini, claude-3–5-sonnet, or gemini-2.5), and securely entering your API key (which is masked during input). ais set 2) Instant Answers & Chat: Ask a question directly, and the AI’s response streams back to your terminal. The conversation history is maintained within that session, allowing you to continue the chat naturally. ais "Explain the concept of promises in JavaScript" # AI responds... # > Can you give me a simple code example? # AI responds... 3) Manage Configuration: Easily check which service and model you currently have configured (without revealing your API key) or list all the models AI-Shell currently knows about. # See current configuration ais config # List available current models and sevrices available ais list # or ais ls 4) End the Chat: Simply press Ctrl+C to end the current interactive session. Who Is AI-Shell For? If you’re someone who: Spends a significant amount of time in the terminal. Prefers keyboard-driven workflows. Needs quick answers or code snippets from AI without disrupting your flow. Finds web UIs too slow for quick queries. Wants a simple, configurable way to access different AI models from one place. …then AI-Shell might be the perfect addition to your toolkit. The Road Ahead: Future Ideas AI-Shell is designed to be simple, but there’s room for growth while staying true to its terminal-first philosophy. Here are some ideas I’m exploring for the future: Third-Party Prompt Templates: Imagine being able to quickly prime the AI with a specific persona or expertise using community-contributed templates. # Hypothetical future usage ais --template nodejs-expert "How do I handle streaming data efficiently?" ais --template vue-element-plus-guru "Show me best practices for form validation" This would allow users to pull in predefined system promp

Apr 26, 2025 - 23:08
 0
AI-Shell: Your Fast Lane to AI Power in the Command Line

Image description

Update: the tool now allows any model selection from the 3 services offered and long prompts via your default cli tool (https://github.com/j-d-carmichael/ai-shell/blob/main/CHANGELOG.md)

Artificial intelligence is everywhere, transforming how we work, code, and create. We have powerful web interfaces like ChatGPT, Claude.ai, and Gemini, and increasingly sophisticated IDE integrations like GitHub Copilot. But what if neither feels quite right for your workflow?

Sometimes, loading a full web GUI feels like overkill for a quick question. Other times, integrated tools, while powerful, might feel too intrusive or not flexible enough for specific, ad-hoc queries. As a developer often living in the terminal, I found myself wanting something faster, more direct, and less disruptive.

That’s why I created AI-Shell.

ais --help                                                  
Usage: ais [options | command] ["Your prompt here..."]

Interact with AI services via the command line.

Arguments:
  prompt                The prompt to send to the AI (leave empty for interactive chat, it will open your default cli text editor)

Options:
  -V, --version         output the version number
  -v, --verbose         Enable verbose output
  -h, --help            display help for command

Commands:
  set                   Set/update the AI service, model, and API key
  set-system-prompt|sp  Set or update the system prompt for AI interactions
  config|c              List the current AI configuration (service and model)
  config-clear          Removes all cached config data and stored API keys
  list|ls               List all available AI configurations (service and model)

Image description
ai-shell (ais)

AI-Shell is a simple, open-source command-line interface (CLI) tool designed for developers, sysadmins, and anyone who prefers the speed and efficiency of the terminal. It allows you to interact seamlessly with leading AI models from Google (Gemini), OpenAI (GPT), and Anthropic (Claude) without ever leaving your command line.

Why AI-Shell? The Need for Speed and Simplicity

The core idea behind AI-Shell is to bridge the gap. It’s for those moments when you need AI assistance now, without context switching to a browser or wrestling with an integration that doesn’t quite fit the immediate need.

  1. Speed: Launching a terminal and typing ais “your question” is significantly faster than opening a browser tab, waiting for it to load, and then typing.
  2. Focus: Stay within your terminal environment, whether it’s in your IDE’s integrated terminal, a separate iTerm/Windows Terminal window, or SSH’d into a server.
  3. Control: You choose the provider (OpenAI, Anthropic, Google) and the specific model you want to use.
  4. Privacy: Your API keys and preferences are stored securely and locally using the conf package, never leaving your machine.

What Does AI-Shell Do & How It Works

AI-Shell keeps things straightforward:

1) Easy Setup: The first time you run ais (or explicitly run ais set), it guides you through selecting your preferred AI provider (OpenAI, Anthropic, Google), choosing a model (like gpt-4o-mini, claude-3–5-sonnet, or gemini-2.5), and securely entering your API key (which is masked during input).

ais set

2) Instant Answers & Chat: Ask a question directly, and the AI’s response streams back to your terminal. The conversation history is maintained within that session, allowing you to continue the chat naturally.

ais "Explain the concept of promises in JavaScript"
# AI responds...
# > Can you give me a simple code example? # AI responds...

3) Manage Configuration: Easily check which service and model you currently have configured (without revealing your API key) or list all the models AI-Shell currently knows about.

# See current configuration 
ais config  
# List available current models and sevrices available
ais list 
# or 
ais ls

4) End the Chat: Simply press Ctrl+C to end the current interactive session.

Who Is AI-Shell For?

If you’re someone who:

  • Spends a significant amount of time in the terminal.
  • Prefers keyboard-driven workflows.
  • Needs quick answers or code snippets from AI without disrupting your flow.
  • Finds web UIs too slow for quick queries. Wants a simple, configurable way to access different AI models from one place.

…then AI-Shell might be the perfect addition to your toolkit.

The Road Ahead: Future Ideas

AI-Shell is designed to be simple, but there’s room for growth while staying true to its terminal-first philosophy. Here are some ideas I’m exploring for the future:

Third-Party Prompt Templates: Imagine being able to quickly prime the AI with a specific persona or expertise using community-contributed templates.

# Hypothetical future usage 
ais --template nodejs-expert "How do I handle streaming data efficiently?" 

ais --template vue-element-plus-guru "Show me best practices for form validation"

This would allow users to pull in predefined system prompts via the CLI, making it easy to tailor the AI’s responses for specialized tasks without manual setup each time.

Chat History & Resumption: While sessions are currently ephemeral, adding persistent chat history would be powerful. You could list previous conversations and reopen a thread, all within the terminal, maintaining the tool’s lightweight nature.

Filesystem Interaction (Maybe): Further down the line, perhaps enabling the AI to suggest file creation or modifications directly within the project structure could be explored, though this would need careful consideration regarding security and user intent.

Get Started!

Ready to give AI-Shell a try? If you have Node.js (v18 or later recommended) installed, getting started is as simple as:

npm install -g ai-shell

Then, just run ais “Your first question” and follow the setup prompts.

AI-Shell is open-source (MIT License), and contributions, feedback, and feature requests are highly welcome! Check out the repository on GitHub:

https://github.com/j-d-carmichael/ai-shell

Let me know what you think!