https://github.com/staticaland/between
https://github.com/staticaland/between
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/staticaland/between
- Owner: staticaland
- Created: 2025-06-22T22:05:29.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-25T21:49:31.000Z (12 months ago)
- Last Synced: 2026-01-19T11:38:38.086Z (5 months ago)
- Language: Go
- Size: 29.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# between
A CLI tool that replaces text between two markers in files.
## Installation
### Homebrew (macOS/Linux)
First, tap the repository:
```bash
brew tap staticaland/between
```
Then, install the cask:
```bash
brew install --cask between
```
### From Source
```bash
go build -o between
```
Or install directly:
```bash
go install
```
## Usage
### Basic Example
Replace content between default HTML-style markers:
```bash
between replace -f index.html --content "Updated content"
```
This finds `` and `` markers and replaces everything between them.
### Custom Markers
Use custom markers for different file types:
```bash
# YAML configuration
between replace -f config.yaml \
--start-marker "# BEGIN CONFIG" \
--end-marker "# END CONFIG" \
--content "database_url: postgres://localhost/mydb"
# Markdown documentation
between replace -f docs.md \
--start-marker "## Generated Content" \
--end-marker "## End Generated" \
--content "This section is automatically updated"
```
### Real-world Examples
Update API documentation:
```bash
between replace -f README.md \
--start-marker "" \
--end-marker "" \
--content "$(curl -s http://localhost:3000/api/docs)"
```
Update configuration from template:
```bash
between replace -f app.config \
--start-marker "# AUTO-GENERATED" \
--end-marker "# END AUTO-GENERATED" \
--content "$(cat config-template.txt)"
```
## Command Reference
```sh
between replace [flags]
Flags:
-f, --file string File to process (required)
--content string New content to insert (required)
--start-marker string Start marker (default "")
--end-marker string End marker (default "")
-h, --help help for replace
```