diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29..a445957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +## [Latest] + +## [0.1.0-alpha] - 2026-08-04 + +### Added +- Core CLI +- `add` command +- `rm` command +- Spell parameters \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index e69de29..145a35f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -0,0 +1,13 @@ +Copyright 2026 abelith + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index e69de29..c984c44 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file