chore
- CHANGELOG.md - LICENSE.md - README.md
This commit is contained in:
1 parent
e4737ca179
commit
7f85815839
3 files changed
+123
No files matched your search
@@ -0,0 +1,99 @@
|
||||
# spellbook 0.1.0-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](#features)
|
||||
- [Building from Source](#building-from-source)
|
||||
- [Usage](#usage)
|
||||
- [Upcoming Features](#upcoming-features)
|
||||
|
||||
---
|
||||
|
||||
## 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](https://go.dev/) 1.22 or higher
|
||||
|
||||
### Build Steps
|
||||
|
||||
```shell
|
||||
# Clone the repository
|
||||
git clone https://github.com/abelith/spellbook.git
|
||||
cd spellbook
|
||||
|
||||
# Build static binary
|
||||
CGO_ENABLED=0 go build -o spellbook .
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
- Use `spellbook help` to list commands
|
||||
- Use `spellbook [command] --help` to 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
|
||||
- `-n` or `--name` is a name of a spell
|
||||
- `-t` or `--tags` is a comma-separated list of spell tags
|
||||
- `-d` or `--desc` is a short description of spell
|
||||
- `command` is an actual spell template
|
||||
|
||||
### Remove a spell
|
||||
|
||||
Use `spellbook rm [spell_name]` to remove a spell
|
||||
- `spell_name` is a name of a spell
|
||||
|
||||
### Casting a spell
|
||||
|
||||
Use `spellbook [spell_name] key=val` to cast a spell
|
||||
- `spell_name` is a name of a spell
|
||||
- `key=val` are key/value arguments
|
||||
|
||||
### Examples
|
||||
|
||||
Said, you have added a spell like this
|
||||
|
||||
```shell
|
||||
spellbook add -n my-spell -t net,http -d my-desc -- curl 127.0.0.1
|
||||
```
|
||||
|
||||
To use it, run this command
|
||||
|
||||
```shell
|
||||
spellbook my-spell
|
||||
```
|
||||
|
||||
Or you may want to use dynamic parameters like this
|
||||
|
||||
```shell
|
||||
spellbook add -n my-spell -t net,http -d my-desc -- curl {{.target}}
|
||||
```
|
||||
|
||||
And cast the spell like this
|
||||
|
||||
```shell
|
||||
spellbook my-spell target=127.0.0.1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Upcoming Features
|
||||
- Search to navigate your spell book
|
||||
- Configuration
|
||||
Reference in new issue
Block a user