Skip to content

Your AI-powered terminal sidekick. Delegate commands, dodge syntax Googling, and let your terminal intern handle the grunt work. Smart, snappy, and ready to hustle! 🚀

License

Notifications You must be signed in to change notification settings

mathiasschopmans/dingen.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📟 dingen.sh - The AI-Powered Command Line Sidekick

"Dingens" [ˈdɪŋəns] — that handy German word from the Ruhr area for "thingamajig" or "whatchamacallit". You know, when you can’t quite remember the name of that... dingens.

And speaking of German words, "dingen" means "to hire" or "to delegate" — which is exactly what this tool does. It hires your terminal as an AI-powered sidekick, ready to take on the commands you don’t want to figure out yourself.

True to its name, dingen.sh has your back when you’re stuck trying to remember that command. It’s a smart command-line wrapper that turns your half-baked ideas into fully-formed commands—no need to Google your way through obscure flags or syntaxes.

Utilizing persisted system prompts and the power of LLMs through gh models, dingen.sh helps you generate and run commands with ease and build own dingens by aliasing. ✨

Features

  • Reads a system prompt from a specified file.
  • Accepts user prompts and optional parameters.
  • Validates input to ensure correct usage.
  • Interacts with an AI model to generate commands.
  • Copies generated commands to the clipboard for easy access.
  • Provides syntax highlighting for generated commands.
  • Confirms execution of commands before running them.

Perfect for when you need to delegate the grunt work and focus on real tasks—because even the terminal deserves an intern. 💼

By letting you define your own system prompts like the demo home-assistant prompt, dingen.sh adapts to your workflow, generating precise shell commands tailored to your needs. With built-in error handling and clipboard integration, it streamlines automation—turning your terminal into a powerhouse of efficiency that is superior to other consoles. 🕹️📺

Example

- 💭 "Dingens, Werner, kannst du mir ma eben dat Bierchen kalt stellen? 🍻"
+ 💻 `dingen.sh ./prompts/home-assistant "stell Kühlschrank auf 6°"`

Wayyy to long - let's create or own "dingens" by adding an alias alias werner='dingen.sh ./prompts/home-assistant' in our .bashrc or .zshrc and try again:

- 💭 "Dingens, Werner, stell die Heizung hoch, is ja kälter als inne Zeche hier!"
+ 💻 `werner "stell wohzimmer auf 23 grad"`

🌎 Translation

Usage

To use the script, run the following command in your terminal:

./dingens.sh <system_prompt_file> [--max-tokens <number>] <user_prompt>

Arguments

  • <system_prompt_file>: Path to the file containing the system prompt.
  • --max-tokens <number>: (Optional) Maximum number of tokens for the AI response. Default is 100.
  • <user_prompt>: The prompt you want to send to the AI.

Example

./dingens.sh ./prompts/home-assistant "turn off lights in the living room"

Dependencies

  • GitHub CLI: Install via brew install gh
  • gh models extension to be installed: gh extension install gh/models
  • gh auth login to authenticate with GitHub.
  • bat for syntax highlighting: brew install bat
  • jq for JSON parsing: brew install jq
  • Requires pbcopy for clipboard functionality (macOS).

Installation

On the fly installation

Given you have the required dependencies installed, you can "install" it on the fly by adding the following alias to your .bashrc or .zshrc:

alias dingen.sh='function _dingens() { bash -c "$(curl -fsSL https://dingen.sh/script)" -- "$@"; }; _dingens'

⚠️ Caution: I would not recommend this for production use for performance and security reasons.

Static installation

  1. Clone the repository:
    git clone https://github.com/mathiasschopmans/dingen.sh.git
    
  2. Make the script executable:
    chmod +x ~/path/to/dingen.sh
  3. Add an alias to your .bashrc or .zshrc:
    alias dingen.sh='bash ~/path/to/dingen.sh'
  4. Source your .bashrc or .zshrc:
    source ~/.bashrc
    # or
    source ~/.zshrc
  5. Install dependencies:
    brew install bat gh jq
  6. Authenticate with GitHub:
    gh auth login
  7. Install the gh models extension:
    gh extension install gh/models

Contributing

Contributions are welcome. Please open an issue or submit a pull request for any enhancements or bug fixes.

The End

From @mathiasschopmans with löve. 💌

Rheurdt York, Germany, 2025

About

Your AI-powered terminal sidekick. Delegate commands, dodge syntax Googling, and let your terminal intern handle the grunt work. Smart, snappy, and ready to hustle! 🚀

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published