80a90b65bb41dbc80852a792f2740c75c0186e26
spellbook 0.2.1-alpha
spellbook is a lightweight CLI command manager written in Go. It allows you to save complex shell commands as parameterized templates ("spells") and execute them instantly with custom arguments.
Table of contents
Features
- Pure Go & CGO-Free: Built with SQLite (
modernc.org/sqlite), resulting in a single portable binary without external dependencies. - Templating: Define dynamic parameters inside commands using
{{ .variable }}syntax. - Tags & Descriptions: Organize and document your command collection.
Building from Source
Prerequisites
- Go 1.22 or higher
Build Steps
# Clone the repository
git clone https://github.com/abelith/spellbook.git
cd spellbook
# Build static binary
CGO_ENABLED=0 go build -o spellbook .
# Move to bin directory (for Linux/macOS)
mv spellbook $(go env GOPATH)/bin/
Configuration
Env
SPELLBOOK_DB_PATH: db location (example:/spellbook/spellbook.db)
Usage
- Use
spellbook helpto list commands - Use
spellbook [command] --helpto get info on specific command
List spells
Use spellbook to list prepared spells
Add new spell
Use spellbook add -n name -t tags -d desc -- command to add a new spell
-nor--nameis a name of a spell-tor--tagsis a comma-separated list of spell tags-dor--descis a short description of spellcommandis an actual spell template
Remove a spell
Use spellbook rm [spell_name] to remove a spell
spell_nameis a name of a spell
Casting a spell
Use spellbook [spell_name] key=val to cast a spell
spell_nameis a name of a spellkey=valare key/value arguments
Examples
Said, you have added a spell like this
spellbook add -n my-spell -t net,http -d my-desc -- curl 127.0.0.1
To use it, run this command
spellbook my-spell
Or you may want to use dynamic parameters like this
spellbook add -n my-spell -t net,http -d my-desc -- curl {{.target}}
And cast the spell like this
spellbook my-spell target=127.0.0.1
Upcoming Features
- Search to navigate your spell book
- Export/import spellbooks
Languages
Go
100%