Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelarie committed Oct 18, 2024
1 parent 2ee281f commit 0d4df28
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,37 @@ cargo install nu-alias-converter

## Usage

The main purpose of this tool is to convert Bash aliases to Nushell aliases.
The main purpose of this tool is to convert Bash aliases to Nushell aliases.

This can be done with this simple command:

```bash
nu-alias-converter .bash_aliases # will generate a bash-aliases.nu file in the same directory
# will generate a bash-aliases.nu file in the same directory
nu-alias-converter .bash_aliases
```

You can also pass directories as the file path. The tool will search for files
with names like `.bash_aliases`, `.aliases`, or `.bash_profile` in the specified
directory:

```bash
# will search for alias files in the specified directory
nu-alias-converter /path/to/directory
```

but the best use case is to use it in the Nushell environment. This way, the
file will be regenerated at the start of each shell session, so you will always
be on sync with your Bash aliases.
For optimal use, integrate it into your Nushell environment. This approach offers two key advantages:

1. **Automatic regeneration:** The alias file is recreated at the start of each shell session.
2. **Continuous synchronization:** Your Nushell aliases stay up-to-date with your Bash aliases.

This ensures that any changes to your Bash aliases are immediately reflected in your Nushell environment.

Add this to the end of your `env.nu` file (find it by running `$nu.env-path` in Nushell):

```nushell
# This command will be shorter in the future, I promise
nu-alias-converter ~/.bash_aliases -o $"($nu.default-config-dir)/bash-alises.nu" | ignore
```
````
Now add this to your `config.nu` to source the generated aliases file (find the path
with `nu.config-path`):
Expand Down

0 comments on commit 0d4df28

Please sign in to comment.