Shortcuts

Learn how to create and manage shortcuts for lla plugins to simplify common operations. Shortcuts allow you to create intuitive aliases for frequently used plugin actions, reducing typing and improving workflow efficiency.

Shortcuts for Faster Commands

Shortcuts turn long plugin commands into short aliases.

Creating Shortcuts

The easiest way to create shortcuts is using the interactive builder:

lla shortcut create

The interactive builder provides:

  • Plugin Discovery - Browse all installed plugins with arrow keys
  • Action Selection - See available actions with descriptions
  • Auto-Fill - Descriptions automatically populated from plugin metadata
  • Validation - Real-time checking for duplicate names and conflicts
  • Beautiful UI - Themed prompts with intuitive navigation

Example Session:

$ lla shortcut create
 
? Select a plugin:
 jwt - JWT token decoder and analyzer
    google_search - Search Google from command line
    npm - NPM package search with bundle size info
    kill_process - Interactive process manager
    ...
 
? Select an action:
 decode - Decode and analyze JWT tokens
    search - Search through saved tokens
    help - Show help information
 
? Enter shortcut name: decode-jwt
 
? Description: Decode JWT tokens
 
 Shortcut 'decode-jwt' created successfully!

Manual Creation

You can also create shortcuts manually:

lla shortcut add NAME PLUGIN ACTION [-d DESCRIPTION]

Example with Code Snippet Extractor:

# Create an intuitive snippet extraction command
lla shortcut add snip code_snippet_extractor extract -d "Extract code snippet"
 
# Add a quick way to search your snippets
lla shortcut add search code_snippet_extractor search -d "Search snippets"
 
# Add a quick way to list your snippets
lla shortcut add snippets code_snippet_extractor list -d "List all snippets"
 
# Simple snippet viewing
lla shortcut add view code_snippet_extractor get -d "View snippet details"

Shortcuts in Action

Replace long commands with short ones:

# Instead of this lengthy command:
lla plugin --name code_snippet_extractor --action extract --args "file.rs" "function_name" 10 20 3
 
# Simply use:
lla snip "file.rs" "function_name" 10 20 3
 
# Replace this:
lla plugin --name code_snippet_extractor --action list
 
# With this:
lla snippets
 
# Instead of:
lla plugin --name code_snippet_extractor --action search --args "query"
 
# Just type:
lla search "query"

Shortcut Management

Manage shortcuts:

# View all shortcuts
lla shortcut list
 
# Remove unused shortcuts
lla shortcut remove snip

Import and Export

Share shortcuts across machines or with your team using import/export.

Exporting Shortcuts

Export all shortcuts and plugin aliases to a TOML file:

# Export to file
lla shortcut export shortcuts.toml
 
# Export to stdout (for piping)
lla shortcut export

The exported file includes:

  • All configured shortcuts
  • Plugin aliases
  • Descriptions and metadata
  • Portable TOML format

Example export file:

# shortcuts.toml
[shortcuts]
decode-jwt = { plugin = "jwt", action = "decode", description = "Decode JWT tokens" }
snip = { plugin = "code_snippet_extractor", action = "extract", description = "Extract code snippet" }
kill = { plugin = "kill_process", action = "interactive", description = "Kill processes" }
 
[plugin_aliases]
j = "jwt"
k = "kill_process"
n = "npm"

Importing Shortcuts

Import shortcuts from a TOML file:

# Replace all existing shortcuts
lla shortcut import shortcuts.toml
 
# Merge with existing shortcuts (skip conflicts)
lla shortcut import shortcuts.toml --merge

Import modes:

  • Replace (default): Replaces all existing shortcuts with imported ones
  • Merge (--merge): Adds new shortcuts, skips conflicts, keeps existing

Sharing Workflows

Team Setup:

# Create team shortcuts
lla shortcut create  # Build your collection
 
# Export for team
lla shortcut export team-shortcuts.toml
 
# Share file via Git
git add team-shortcuts.toml
git commit -m "Add team lla shortcuts"
git push
 
# Team members import
git pull
lla shortcut import team-shortcuts.toml --merge

Personal Backup:

# Backup shortcuts
lla shortcut export ~/dotfiles/lla-shortcuts.toml
 
# Restore on new machine
lla shortcut import ~/dotfiles/lla-shortcuts.toml

Cross-Machine Sync:

# On machine 1
lla shortcut export ~/Dropbox/lla-shortcuts.toml
 
# On machine 2
lla shortcut import ~/Dropbox/lla-shortcuts.toml --merge

Suggested Shortcut Set

A compact set for Code Snippet Extractor:

# Snippet Creation and Management
lla shortcut add snip code_snippet_extractor extract -d "Extract code snippet"
lla shortcut add tags code_snippet_extractor add-tags -d "Add tags to snippet"
lla shortcut add cat code_snippet_extractor set-category -d "Set snippet category"
 
# Viewing and Navigation
lla shortcut add snippets code_snippet_extractor list -d "List all snippets"
lla shortcut add view code_snippet_extractor get -d "View snippet details"
 
# Data Portability
lla shortcut add export code_snippet_extractor export -d "Export snippets"
lla shortcut add import code_snippet_extractor import -d "Import snippets"

Usage Examples

Examples:

# Quick snippet extraction
lla snip "main.rs" "process_data" 10 20 3
 
# Effortless organization
lla tags "abc123" "rust" "algorithm"
lla cat "abc123" "Algorithms"
 
# Simple navigation
lla snippets
lla view "abc123"
 
# Search snippets
lla search "abc123"
 
# Data management
lla export "my_snippets.json"