Skip to content

D&D inspired Powershell helper to register defined commands as simple functions with parameter completers. Every Wizard should have one.

License

Notifications You must be signed in to change notification settings

Ark667/Spellbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Spellbook

D&D inspired Powershell helper to register defined commands as simple functions with parameter completers. Every Wizard should have one.
Explore the docs »
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Tips
  5. Contributing
  6. License
  7. Contact

About The Project

This project was intended to boost Powershell productivity by making day to day tasks faster and easier. The basic idea is define Powershell commands with its parameter and default value definitions in a file, and make a process register function aliases over them with parameter completers. This makes the command call crazy easy with Tab autocomplete magic.

This idea comes specially useful with Docker containers, avoiding to install nothing but Docker, and run complex commands without extra prerequisites. Some extra features where added after, like extended history, index, and command help.

(back to top)

Built With

Powershell execution policy must allow script execution.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Spell definitions are YAML based, but Powershell does not have a built in ConvertFrom-Yaml. Installing this module makes the trick for now.

Install-Module powershell-yaml

(back to top)

Getting Started

  1. Clone the repo.

    git clone https://github.com/Ark667/Spellbook.git
    
  2. Execute Spellbook register.

    .\Spellbook\src\Spellbook.ps1
    
  3. Execute index command, just type "Spell" and Tab through options.

    Spellbook-Index
    

(back to top)

Usage

Configure in $profile the invocation of this script The global commands you can search for spells, view its documentation or update the current definitions.

The index shows available spells registered. Filter argument apply over result on Tags and School.

Spellbook-Index [filter]

Help shows command documentation.

Spellbook-Help [spell]

History shows commands execution log with its full info.

Spellbook-History

Update registers the current definitions.

Spellbook-Update

Now you can execute some spells.

This example execute de AWS Cli through official Docker container. This spell (Aws-Cli) also has an alias to make it work like AWS Cli where installed in your machine.

aws

This simple spell will create a MySql container with mapped volume, exposed port and default root password, everything displayed on output.

Create-MySql

Just enjoy!

(back to top)

Tips

Spellbook load can be added on Powershell terminal startup adding a call to Spellbook.ps1 on profile file. Just edit the file with this call.

notepad.exe $profile

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Show me your spells!

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

ko-fi

(back to top)

Contact

Aingeru Medrano - @AingeruBlack

Project Link: https://github.com/Ark667/Spellbook

(back to top)

Acknowledgments

http://patorjk.com

(back to top)

About

D&D inspired Powershell helper to register defined commands as simple functions with parameter completers. Every Wizard should have one.

Topics

Resources

License

Stars

Watchers

Forks