https://github.com/brandonkramer/shellquote
Shell argument quoting and prompt-file helpers for Go command templates. Stdlib-only.
https://github.com/brandonkramer/shellquote
command-line go golang library quoting shell
Last synced: 10 days ago
JSON representation
Shell argument quoting and prompt-file helpers for Go command templates. Stdlib-only.
- Host: GitHub
- URL: https://github.com/brandonkramer/shellquote
- Owner: brandonkramer
- License: mit
- Created: 2026-06-01T19:30:54.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-06-01T19:48:51.000Z (about 1 month ago)
- Last Synced: 2026-06-01T21:23:26.850Z (about 1 month ago)
- Topics: command-line, go, golang, library, quoting, shell
- Language: Go
- Size: 47.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# shellquote
Shell argument quoting and prompt-file helpers for command templates.
## Install
From [pkg.go.dev](https://pkg.go.dev/github.com/brandonkramer/shellquote):
```bash
go get github.com/brandonkramer/shellquote@v0.1.0
```
## Usage
```go
path, err := shellquote.WritePrompt(runDir, promptContent)
cmd := shellquote.SubstitutePrompt("cat {prompt}", path)
quoted := shellquote.Quote("/tmp/a file")
```
Constants:
- `shellquote.DefaultPromptFile` — `"prompt.md"`
- `shellquote.PromptPlaceholder` — `"{prompt}"`
## Development
Lefthook and golangci-lint are pinned in `go.mod` as **tools** (dev-only). Install git hooks once per clone:
```bash
make install-hooks
```
```bash
make check
make test
make lint
```