Skip to content

Commit

Permalink
docs: add multiple binaries example and consolidate config docs (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
marwanhawari authored Jan 21, 2025
1 parent 0d214f5 commit 463ffd3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ stew install Stewfile

# Install headlessly from a Stewfile.lock.json
stew install Stewfile.lock.json

# Install mutliple binaries per repo/asset
stew install astral-sh/uv # Install uv the first time
stew install astral-sh/uv # Install uvx the second time
```

### Search
Expand Down Expand Up @@ -152,19 +156,33 @@ stew list --tags > Stewfile # Pin tags
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 also 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`.

Make sure that the installation path is in your `PATH` environment variable. Otherwise, you won't be able to use any of the binaries installed by `stew`.

# FAQ
### Why couldn't `stew` automatically find any binaries for X repo?
The repo probably uses an unconventional naming scheme for their binaries. You can always manually select the release asset.

### Will `stew` work with private GitHub repositories?
Yes, `stew` will automatically detect if you have a `GITHUB_TOKEN` environment variable and allow you to access binaries from your private repositories.

### Where does `stew` install binaries?
The default installation path will depend on your OS:
| Linux/macOS | Windows |
| ------------ | ---------- |
| `~/.local/bin` | `~/AppData/Local/stew/bin` |

However, this location can be [configured](https://github.com/marwanhawari/stew/blob/main/config.md).

Make sure that the installation path is in your `PATH` environment variable. Otherwise, you won't be able to use any of the binaries installed by `stew`.
20 changes: 0 additions & 20 deletions config.md

This file was deleted.

0 comments on commit 463ffd3

Please sign in to comment.