Welcome to Magi.Spells, a collection of optional spells for the Magi.CLI tool. These spells enhance your magical command-line experience by providing additional functionalities. The spells are stored in the Magi.Chamber server and can be easily pulled into your local environment.
Magi.Spells is a repository that serves as the source for additional spells used by Magi.CLI, a command-line tool that brings a touch of magic to your terminal. The spells in this repository are designed to extend the capabilities of Magi.CLI, allowing you to perform complex tasks with simple commands.
Each spell declares its own dependencies, ensuring modularity and scalability. This per-spell dependency management allows you to install only the packages required for the spells you use, keeping your environment clean and efficient.
To add spells from Magi.Spells to your Magi.CLI tool, use the ponder
command, which handles the installation of spells and their dependencies.
Ensure you have Magi.CLI installed:
pip install magi_cli_pypi
Install spells using the ponder
command:
cast ponder <spell_name>
Replace <spell_name>
with the name of the spell you wish to install. For example:
cast ponder runecraft
The ponder
command will fetch the spell from the Magi.Chamber, install any required dependencies, and make the spell available for use.
Each spell specifies its external dependencies using a special __requires__
variable within the spell script. This variable is a list of packages that are not part of Python's standard library but are required for the spell to function.
For example:
__requires__ = ['click', 'requests', 'openai']
When you install a spell using the ponder
command:
ponder
command extracts the __requires__
variable from the spell.If you attempt to use a spell whose dependencies are not installed, Magi.CLI will:
cast ponder <spell_name>
to install the missing dependencies.To prevent issues with missing dependencies at startup, Magi.CLI employs lazy loading for spells:
Below is a list of available spells along with their descriptions and dependencies.
click
, openai
click
, flask
, gitpython
click
, requests
, Pillow
, openai
, PyQt5
click
, beautifulsoup4
, openai
, requests
click
click
, paramiko
, cryptography
.tome
.click
To install the runecraft
spell:
cast ponder runecraft
You'll be prompted to install the spell and its dependencies.
After installing, you can use the spell by casting it with its alias:
cast rc path/to/your/script.sh
If you wish to uninstall a spell:
cast ponder runecraft
If the spell is already installed, the ponder
command will offer to uninstall it.
We welcome contributions to Magi.Spells! If you have an idea for a new spell or improvements to existing ones, please follow the guidelines below.
Fork the Repository: Create your own fork of the Magi.Spells repository.
Create a New Spell:
Add your spell script to the spells
directory.
__requires__
variable listing any external dependencies.alias
variable for the spell's command alias.main
function that invokes your spell.Follow the existing spell format for consistency.
Test Your Spell:
Use the ponder
command to install your spell and verify that dependencies are correctly managed.
Ensure your spell functions as intended.
Update Documentation:
Add your spell to the Available Spells section in the README.md
.
Include a description and list of dependencies.
Submit a Pull Request:
Once your spell is ready, submit a pull request to the main repository.
If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository. Provide as much detail as possible to help us address the problem.
Magi.Spells is released under the MIT License. By contributing to this repository, you agree to have your contributions licensed under the MIT License.