Skip to content

Tomlord1122/go-recipe

Repository files navigation

Go Recipe - Command Manager

Go Recipe is a modern Terminal User Interface (TUI) application for managing and executing shell commands. It allows you to organize commands into categories, add new commands, and execute them either in foreground or background mode.

Features

  • Organize commands with categories and tags
  • Filter commands by category or text search
  • Execute commands and view output
  • Background execution mode
  • Add, edit, and delete commands
  • Persistent configuration

Installation

Prerequisites

  • Go 1.18 or higher

Install via go install

go install github.com/Tomlord1122/go-recipe/cmd/go-recipe@latest

Building from source

# Clone the repository
git clone https://github.com/Tomlord1122/go-recipe.git
cd go-recipe

# Build the application
make build

Usage

Run the application:

cd build
./go-recipe

Keyboard Shortcuts

  • ↑/↓ or k/j: Navigate up and down the command list
  • Enter: Execute the selected command
  • n: Add a new command
  • e: Edit the selected command
  • d: Delete the selected command
  • f: Filter commands by name
  • c: Cycle through categories
  • h: Show/hide help screen
  • b: Toggle background execution mode
  • q/Esc: Quit the application

Architecture

The application follows the Model-View-Update (MVU) architecture pattern:

  1. Model: Core data structures and state management
  2. View: UI rendering based on current state
  3. Update: State transitions and event handling

Libraries Used

Configuration

The application stores your commands in JSON format at:

~/.go-recipe/commands.json

Per-command settings

  • WorkingDirMode: current (default) | home | absolute
  • WorkingDirPath: used when mode is absolute; supports ~, $HOME, ${cwd}
  • UseShell: when true, the command runs via your shell (e.g., bash -lc), so pipes/quotes work
  • Interactive: when true, interactive commands (e.g., htop, ssh) will open attached (on macOS a new Terminal window)

Background runs

  • If background mode is enabled (toggle with b), output is written to logs under:
~/.go-recipe/logs/

Releasing

Cutting a new release is automated via GitHub Actions and GoReleaser.

  1. Ensure tests are green:
     make test
  2. Choose a new semver tag, e.g. v1.2.3.
  3. Tag and push:
     git checkout master
     git pull
     git tag -a v1.2.3 -m "Release v1.2.3"
     git push origin v1.2.3
  4. The CI workflow (triggered by tags v*.*.*) runs GoReleaser and publishes cross-platform binaries and checksums on the GitHub Releases page.

Installing a specific version

  • Via go install:

      go install github.com/Tomlord1122/go-recipe/cmd/go-recipe@v1.2.0
  • Or download a prebuilt binary from the Releases page, extract it, and run:

      ./go-recipe version

Verifying downloads

Each release includes checksums.txt. To verify:

shasum -a 256 -c checksums.txt

License

MIT License

About

A Convenient TUI app that can store commands you frequently use.

Resources

License

Stars

Watchers

Forks

Packages

No packages published