Terminal Snippets is an plugin that allows you to quickly inject predefined command snippets into the terminal.
- 🚀 Quick access to frequently used terminal commands
- 📁 Organize snippets by categories with automatic submenus
- 🔤 Dynamic variables (project info, date/time, clipboard, etc.)
- 💬 Interactive variables (prompts, choices, confirmations)
- ⚙️ Easy configuration through Settings > Tools > Terminal Snippets
- 🎯 One-click command injection via terminal toolbar icon
- 💾 Persistent storage of your custom snippets
- 📤 Import/Export snippets as JSON
- 🔄 Compatible with both Classic Terminal and Reworked Terminal 2025
- Configure your snippets in Settings > Tools > Terminal Snippets
- Open a terminal window (View > Tool Windows > Terminal)
- Click the Terminal Snippets icon in the terminal toolbar
- Select a snippet to inject it into the terminal
- Download the latest
Terminal-Snippets-X.X.X.zipfrom my Jetbrains MarketPlace Page - Open your Jetbrains IDE
- Go to Settings/Preferences > Plugins
- Click the ⚙️ icon > Install Plugin from Disk...
- Select the downloaded ZIP file
- Restart IntelliJ IDEA
- Go to Settings/Preferences > Tools > Terminal Snippets
- Add your custom snippets with:
- Name: Display name of the snippet
- Category: Group snippets together (e.g., "Build", "Git", "Docker")
- Command: The command to inject (supports multi-line)
- Click OK to save
- Snippets are automatically organized by category in the dropdown menu
- If you have multiple categories, they appear as submenus
- If you have only one category, snippets are displayed in a flat list
- Leave category blank to use the default "General" category
- Export: Click the Export button to save your snippets as JSON with timestamp
- Import: Click the Import button to load snippets from a JSON file
- Duplicate snippets (same name + category) are automatically skipped during import
Terminal Snippets supports both static and interactive variables in your commands.
These variables are automatically resolved when the snippet is executed:
| Variable | Description | Example |
|---|---|---|
${PROJECT_NAME} |
Current project name | echo "Building ${PROJECT_NAME}" |
${PROJECT_PATH} |
Current project path | cd ${PROJECT_PATH} |
${FILE_PATH} |
Currently open file path | cat ${FILE_PATH} |
${SELECTION} |
Selected text in editor | echo "${SELECTION}" |
${CLIPBOARD} |
Clipboard content | echo ${CLIPBOARD} |
${DATE} |
Current date (dd/MM/yyyy) | echo "Build date: ${DATE}" |
${TIME} |
Current time (HH:mm:ss) | echo "Build time: ${TIME}" |
${YEAR} |
Current year | mkdir backup-${YEAR} |
${MONTH} |
Current month (01-12) | echo "Month: ${MONTH}" |
${MONTH_NAME_SHORT} |
Short month name (Jan, Feb...) | echo "${MONTH_NAME_SHORT}" |
${MONTH_NAME_FULL} |
Full month name (January...) | echo "${MONTH_NAME_FULL}" |
${DAY} |
Current day (01-31) | echo "Day: ${DAY}" |
${HOUR} |
Current hour (00-23) | echo "Hour: ${HOUR}" |
${MINUTE} |
Current minute (00-59) | echo "Minute: ${MINUTE}" |
${USERLOGIN} |
System username | echo "User: ${USERLOGIN}" |
${GIT_BRANCH} |
Current Git branch | echo "Branch: ${GIT_BRANCH}" |
${GIT_COMMIT} |
Current commit hash (full) | echo "Commit: ${GIT_COMMIT}" |
${GIT_COMMIT_SHORT} |
Current commit hash (short) | git tag v1.0-${GIT_COMMIT_SHORT} |
${GIT_REMOTE} |
Git remote URL | echo "Remote: ${GIT_REMOTE}" |
These variables prompt the user for input when the snippet is executed:
| Variable | Description | Example |
|---|---|---|
${VAR:Description} |
Simple text input | git commit -m "${VAR:Commit message}" |
${VAR:Description:Default} |
Text input with default value | docker run -p ${VAR:Port:8080}:8080 app |
${CHOICE:Description:opt1|opt2} |
Dropdown selection | mvn clean ${CHOICE:Phase:install|package|deploy} |
${CONFIRM:Description} |
Yes/No confirmation | echo "Confirmed: ${CONFIRM:Delete files?}" |
${PASSWORD:Description} |
Masked password input | docker login -p ${PASSWORD:Docker password} |
${PATH:Description} |
File/folder picker | cd ${PATH:Select directory} |
Build with timestamp:
echo "Building ${PROJECT_NAME} on ${DATE} at ${TIME}"
gradlew clean buildInteractive deployment:
cd ${PROJECT_PATH}
mvn clean ${CHOICE:Select phase:package|install|deploy}
echo "Deployed by ${USERLOGIN} at ${TIME}"Git-aware build:
echo "Building ${PROJECT_NAME} from branch ${GIT_BRANCH}"
echo "Commit: ${GIT_COMMIT_SHORT}"
gradlew build -Pversion=${GIT_BRANCH}-${GIT_COMMIT_SHORT}Conditional execution:
echo "Delete all logs?"
if [ "${CONFIRM:Are you sure?}" = "yes" ]; then
rm -rf logs/*
fiThe plugin comes with two example snippets:
- Pip Upgrade (Category: Python)
- Git Status (Category: Git)
- ✅ Commands are injected into the prompt
- ✅ Multi-line commands are supported
- ✅ Press Enter to execute
- ✅ You can modify the command before execution
- ✅ Commands are executed automatically
- ✅ Multi-line commands execute line by line
- ℹ️ No modification possible before execution (API limitation)
Plugin based on the IntelliJ Platform Plugin Template.