Back/Engineering/Gemini/Claude Code
AdvancedEngineeringGeminiClaude Code

Automate Repetitive AI Commands with Custom Shell Aliases and CLIs

Speed up your development workflow by creating shortcuts for frequent AI commands using shell aliases and building dedicated command-line tools to script complex, repetitive AI tasks.

From How I AI

Beyond Vibe Coding: Advanced AI Engineering with John Lindquist

with Claire Vo

Automate Repetitive AI Commands with Custom Shell Aliases and CLIs

Tools Used

Gemini

Google AI assistant

Claude Code

Claude for coding tasks

02Step-by-Step Guide
1

Create Aliases for Frequent Commands

In your shell configuration file (e.g., .zshrc), define short aliases for your most-used AI commands, such as setting a specific model or loading context files.

Prompt:
alias cdi='claude append-system-prompt "$(cat memory/ai/diagrams/**/*.md)"'
2

Identify a Repetitive, Multi-Step Task

Find a recurring task that involves a structured conversation with an AI, such as generating design mockups for a specific page type and style.

3

Build a Custom Command-Line Tool

Write a small script that acts as a Command-Line Interface (CLI) tool. This tool will wrap an AI API (like Gemini's) to perform your specific task.

4

Structure the CLI for Key Inputs

Design the tool to prompt the user for only the essential variables (e.g., 'What type of website?', 'What page?'). This constrains the input and makes the prototyping process faster and more repeatable.

5

Execute the Task via API Call

The CLI tool should combine the user's inputs with a predefined prompt structure and send the final prompt to the AI via an API call to get the desired output, such as generated images.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready