This commit is contained in:
JMARyA 2024-10-21 10:55:56 +02:00
parent dd36f51615
commit 0d987a882c
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 105 additions and 0 deletions

View file

@ -233,6 +233,7 @@ rev: 2024-07-14
- [dysk](./cli/dysk.md)
- [pass](./cli/pass.md)
- [ocrs](./cli/ocrs.md)
- [stew](./cli/stew.md)
## System
- [Core Utils](./cli/system/Core%20Utils.md)

View file

@ -0,0 +1,104 @@
---
obj: application
repo: https://github.com/marwanhawari/stew
rev: 2024-10-21
---
# stew
🥘 An independent package manager for compiled binaries.
## Features
* Install binaries from GitHub releases or directly from URLs.
* Easily distribute binaries across teams and private repositories.
* Get the latest releases ahead of other package managers.
* Rapidly browse, install, and experiment with different projects.
* Configure where to install binaries.
* No need for `sudo`.
* Just a single binary with 0 dependencies.
* Portable `Stewfile` with optional pinned versioning.
* Headless batch installs from a `Stewfile.lock.json` file.
## Usage
### Install
```sh
# Install from GitHub releases
stew install junegunn/fzf # Install the latest release
stew install junegunn/fzf@0.27.1 # Install a specific, tagged version
# Install directly from a URL
stew install https://github.com/cli/cli/releases/download/v2.4.0/gh_2.4.0_macOS_amd64.tar.gz
# Install from an Stewfile
stew install Stewfile
# Install headlessly from a Stewfile.lock.json
stew install Stewfile.lock.json
```
### Search
```sh
# Search for a GitHub repo and browse its contents with a terminal UI
stew search ripgrep
```
### Browse
```sh
# Browse a specific GitHub repo's releases and assets with a terminal UI
stew browse sharkdp/hyperfine
```
### Upgrade
```sh
# Upgrade a binary to its latest version. Not for binaries installed from a URL.
stew upgrade rg # Upgrade using the name of the binary directly
stew upgrade --all # Upgrade all binaries
```
### Uninstall
```sh
# Uninstall a binary
stew uninstall rg # Uninstall using the name of the binary directly
stew uninstall --all # Uninstall all binaries
```
### Rename
```sh
# Rename an installed binary using an interactive UI
stew rename rg # Rename using the name of the binary directly
```
### List
```sh
# List installed binaries
stew list # Print to console
stew list > Stewfile # Create an Stewfile without pinned tags
stew list --tags > Stewfile # Pin tags
```
### Config
```sh
# Configure the stew file paths using an interactive UI
stew config # Automatically updates the stew.config.json
```
## Configuration
`stew` can be configured with a `stew.config.json` file. The location of this file will depend on your OS:
|Linux/macOS | Windows |
| ------------ | ---------- |
| `$XDG_CONFIG_HOME/stew` or `~/.config/stew` | `~/AppData/Local/stew/Config` |
You can configure 2 aspects of `stew`:
1. The `stewPath`: this is where `stew` data is stored.
2. The `stewBinPath`: this is where `stew` installs binaries
The default locations for these are:
| | Linux/macOS | Windows |
| ------------ | ------------ | ---------- |
| `stewPath` | `$XDG_DATA_HOME/stew` or `~/.local/share/stew` | `~/AppData/Local/stew` |
| `stewBinPath` | `~/.local/bin` | `~/AppData/Local/stew/bin` |
There are multiple ways to configure these:
* When you first run `stew`, it will look for a `stew.config.json` file. If it cannot find one, then you will be prompted to set the configuration values.
* After `stew` is installed, you can use the `stew config` command to set the configuration values.
* At any time, you can manually create or edit the `stew.config.json` file. It should have values for `stewPath` and `stewBinPath`.