Skip to content

Commit

Permalink
docs: pipx
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Nunamaker committed Jul 29, 2024
1 parent b331736 commit 0ff05a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
46 changes: 40 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPI version](https://badge.fury.io/py/rstring.svg)](https://badge.fury.io/py/rstring)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Rstring is a developer tool that uses Rsync to efficiently gather and stringify code from your projects. It's designed to streamline the process of preparing code context for AI programming assistants, making it easy to get intelligent insights about your codebase.
Rstring is a developer tool that uses [Rsync](https://linux.die.net/man/1/rsync) to efficiently gather and stringify code from your projects. It's designed to streamline the process of preparing code context for AI programming assistants, making it easy to get intelligent insights about your codebase.

<div align="center">
<img alt="Rstring demo" src="https://github.com/user-attachments/assets/c85106e3-2b02-42ff-b585-4234a58e8b9a" width="600">
Expand All @@ -12,10 +12,41 @@ Rstring is a developer tool that uses Rsync to efficiently gather and stringify

## Installation

Rstring requires Python 3.8+. We recommend using `pipx` for installation, as it installs Rstring in an isolated environment, preventing conflicts with other packages.

### Using pipx (recommended)

1. Install pipx if you haven't already. Follow the [official pipx installation guide](https://pipx.pypa.io/stable/installation/) for your operating system.

2. Install Rstring:
```bash
pipx install rstring
```

### Using pip

If you prefer to use pip, you can install Rstring with:

```bash
pip install rstring
```

### Updating Rstring

To update Rstring to the latest version:

With pipx:
```bash
pipx upgrade rstring
```

With pip:
```bash
pip install --upgrade rstring
```

For more detailed information about pipx and its usage, refer to the [pipx documentation](https://pipx.pypa.io/stable/).

## Quick Start

Basic usage:
Expand All @@ -27,7 +58,6 @@ rstring # Use the default preset
rstring --include=*/ --include=*.py --exclude=* # traverse all dirs, include .py files, exclude everything else
```


Get help:
```bash
rstring --help
Expand Down Expand Up @@ -77,7 +107,7 @@ rstring -i

## Understanding Rstring

1. **Rsync Usage**: Rstring uses Rsync to efficiently select files based on include/exclude patterns.
1. **Under the Hood**: Rstring efficiently selects files based on filters by running `rsync --archive --itemize-changes --dry-run --list-only <your filters>`. This means you can use Rsync's powerful include/exclude patterns to customize file selection.

2. **Preset System**: The default configuration file is at `~/.rstring.yaml`. The 'common' preset is used by default and includes sensible exclusions for most projects.

Expand All @@ -94,15 +124,19 @@ rstring -i

5. **Clipboard Integration**: Output is automatically copied to clipboard unless disabled with `--no-clipboard`.

6. **Git Integration**: By default, Rstring respects .gitignore patterns. Use `--no-gitignore` to ignore them.

## Pro Tips

1. **Explore the default preset**: Check `~/.rstring.yaml` to see how the 'common' preset works.

2. **Customize for your project**: Create a project-specific preset for quick context gathering.
2. **Refer to Rsync documentation**: Rstring uses Rsync for file selection. Refer to the [Filter Rules](https://linux.die.net/man/1/rsync) section of the rsync man page to understand how include/exclude patterns work.

3. **Customize for your project**: Create a project-specific preset for quick context gathering.

3. **Use with AI tools**: Rstring is great for preparing code context for AI programming assistants.
4. **Use with AI tools**: Rstring is great for preparing code context for AI programming assistants.

4. **Large projects may produce substantial output**: Use `--preview-length` or specific patterns for better manageability.
5. **Large projects may produce substantial output**: Use `--preview-length` or specific patterns for better manageability.

## Support and Contributing

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
],
},
install_requires=[
"colorama>=0.4.6",
"pyyaml>=6.0.1",
],
extras_require={
Expand Down

0 comments on commit 0ff05a6

Please sign in to comment.