README
ΒΆ
Ya - CLI
A lightweight command-line shortcut manager. Execute your frequently used PowerShell commands with simple, memorable shortcuts.
Name Origin: "Ya" comes from the Spanish word meaning "right now" - reflecting the instant execution of your commands.
β¬οΈ Download
Ya CLI β Multi-Platform Support
πͺ Windows
π macOS
π§ Linux
Windows β’ macOS β’ Linux | Always the latest version
Features
- Create custom shortcuts for long or complex commands
- Persistent storage of shortcuts in your user config directory
- Fast command execution via PowerShell (Windows) or Bash (Linux/macOS)
- Easy-to-use CLI interface built with Cobra
- Template values β add
{placeholders}to a command and Ya will prompt you to fill them in at runtime - Export your shortcuts to a JSON file for backup or sharing
- Import shortcuts from a JSON file β merges with existing shortcuts
- Search shortcuts by name or command
- Pass extra arguments to shortcuts at runtime (e.g.
-m "message") - GUI Available: Prefer a graphical interface? Check out Ya-GUI - a modern desktop application for managing your shortcuts visually
Platform Support
Supports Windows, Linux, and macOS.
- Windows: Uses PowerShell for command execution
- Linux/macOS: Uses Bash for command execution
Installation
πΊ Install with Homebrew (macOS & Linux)
If you have Homebrew installed, you can install Ya with:
brew tap d3uceY/homebrew-ya
brew install ya
Prerequisites
- Go 1.25.5 or higher
- Windows (PowerShell), Linux, or macOS (Bash)
Build from Source
- Clone or download this repository
- Navigate to the project directory
- Build the executable:
Windows:
go build -o ya.exe .
Linux/macOS:
go build -o ya .
chmod +x ya
- (Optional) Add the executable to your PATH for system-wide access
Adding to PATH (Recommended)
To use ya from any directory in your terminal, you need to add it to your system's PATH environment variable.
Windows
- Move the executable to a permanent location (e.g.,
C:\Program Files\Ya\ya.exe) - Add to PATH:
- Press
Win + Xand select "System" - Click "Advanced system settings" on the right
- Click "Environment Variables"
- Under "User variables" or "System variables", find and select "Path"
- Click "Edit"
- Click "New" and add the directory path (e.g.,
C:\Program Files\Ya) - Click "OK" on all windows
- Press
- Restart your terminal for changes to take effect
- Verify by running:
ya help
Quick method (PowerShell as Administrator):
# Create a directory for Ya
New-Item -Path "C:\Program Files\Ya" -ItemType Directory -Force
# Move ya.exe to this directory
Move-Item .\ya.exe "C:\Program Files\Ya\ya.exe"
# Add to PATH
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Ya", "User")
Linux/macOS
-
Move the executable to a directory in your PATH:
# Option 1: System-wide (requires sudo) sudo mv ya /usr/local/bin/ # Option 2: User-only mkdir -p ~/.local/bin mv ya ~/.local/bin/ -
Ensure the directory is in your PATH (if using
~/.local/bin):# For Bash (~/.bashrc) echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc # For Zsh (~/.zshrc) echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc -
Verify installation:
ya help
Usage
New Features (v0.3.0+)
- Search Shortcuts: Quickly find shortcuts by name or command.
- Show Shortcut: Display the command mapped to a specific shortcut.
- Import Shortcuts: Import a set of shortcuts from a JSON file β merges with existing ones.
- Export Shortcuts: Export your shortcuts to a JSON file for backup or sharing.
- Remove Shortcut: Delete a shortcut by name.
- Pass Extra Arguments: You can now pass additional arguments to your shortcuts at runtime.
- Template Values: Use
{placeholder}syntax in commands β Ya will prompt you to fill each one in before running.
See below for usage examples!
Managing Shortcuts with GUI
For a more visual and user-friendly experience, you can use Ya-GUI - a desktop application that provides:
- Visual shortcut management
- Real-time search and filtering
- Inline editing capabilities
- Modern, intuitive interface
All shortcuts created in Ya-GUI are fully compatible with the Ya CLI and vice versa.
View All Shortcuts
Display all available shortcuts:
ya help
List All Shortcuts
ya list
Shows all shortcuts and their mapped commands.
Add a New Shortcut
Create a new shortcut with a name and PowerShell command:
ya add <shortcut-name> '<powershell-command>'
Example:
ya add gs 'git status'
ya add dev 'cd C:\Projects\MyApp; npm run dev'
ya add ports 'netstat -ano | findstr LISTENING'
Remove a Shortcut
ya remove <shortcut-name>
Deletes the specified shortcut.
Execute a Shortcut
Run a saved shortcut:
ya <shortcut-name>
Example:
ya gs # Runs: git status
ya dev # Runs: cd C:\Projects\MyApp; npm run dev
ya ports # Runs: netstat -ano | findstr LISTENING
Pass Extra Arguments to Shortcuts
You can append extra arguments when running a shortcut. These will be added to the end of the command.
ya gcm -m "Initial commit"
# Runs: git commit -m "Initial commit"
Show a Shortcut's Command
ya show <shortcut-name>
Displays the command mapped to the shortcut.
Search for Shortcuts
ya search <search-term>
Finds shortcuts whose name or command contains the search term.
Import Shortcuts from a File
ya import <file-path>
Imports shortcuts from a JSON file (should be a map of shortcut names to commands). Merges with your existing shortcuts β duplicate keys are overwritten.
Export Shortcuts to a File
ya export <dir>
ya export <dir> --name <filename>
ya export <dir> -n <filename>
Exports all your shortcuts to a JSON file in the given directory. If --name is not provided, the file will be named shortcuts.json.
Examples:
ya export ./ # exports to ./shortcuts.json
ya export ./backups --name jan.json # exports to ./backups/jan.json
Template Values in Commands
You can add {placeholder} tokens anywhere in a command. When you run the shortcut, Ya will prompt you to fill in each value before executing.
Add a templated shortcut:
ya add commit 'git commit -m {message}'
ya add deploy 'kubectl set image deployment/{app} {app}={image}:{tag}'
Run it:
ya commit
β This command has template values. Fill them in below:
[1/1] message: fix login bug
Then runs git commit -m fix login bug.
- The same
{placeholder}used multiple times in one command is only prompted once - Commands without any
{}tokens run immediately as normal
How It Works
- Shortcuts are stored in JSON format at:
%APPDATA%\ya\data\shortcuts.json - Commands are executed via PowerShell using the
-Commandflag - The shortcuts file is automatically created on first use
Examples
Common Use Cases
# Quick navigation shortcuts
ya add proj 'cd C:\Users\YourName\Projects'
ya add docs 'cd C:\Users\YourName\Documents'
# Git shortcuts
ya add gp 'git pull'
ya add gps 'git push'
ya add gcm 'git commit -m'
# Development shortcuts
ya add start-api 'cd C:\MyApp\API; dotnet run'
ya add build 'cd C:\MyApp; npm run build'
# System maintenance
ya add clean 'Remove-Item -Path .\temp\* -Recurse -Force'
Troubleshooting
"Unknown shortcut" Error
If you see this message, the shortcut doesn't exist. Use ya help to see all available shortcuts or ya add to create a new one.
Commands Not Working
Ensure your command works in PowerShell before adding it as a shortcut. Test it directly in a PowerShell terminal first.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
Documentation
ΒΆ
There is no documentation for this package.