Skip to content

A simple command line utility to update netrc credentials.

License

Notifications You must be signed in to change notification settings

maerteijn/update-netrc

Repository files navigation

update-netrc

CI MIT License PyPI version Python 3.8 Python 3.9 Python 3.10 Python 3.11 Python 3.12 Ruff Code style: black Checked with mypy No Dependencies

A simple command line utility to update netrc credentials.

Usage

$  update-netrc --help
usage: update-netrc [-h] [--netrc-path NETRC_PATH] {update} ...

Default .netrc path: /Users/martijn/.netrc

positional arguments:
  {update}

options:
  -h, --help            show this help message and exit
  --netrc-path NETRC_PATH
                        Specify an alternative location for the used netrc file
$ update-netrc update --help
usage: update-netrc update [-h] [--login LOGIN] [--account ACCOUNT] [--password PASSWORD] host

positional arguments:
  host                 Selects the host (machine) you want to update

options:
  -h, --help           show this help message and exit
  --login LOGIN        Update the login of specified host
  --account ACCOUNT    Update the account of the specified host
  --password PASSWORD  Update the password of the specified host

Examples

To update the password of the localhost machine:

$ update-netrc update localhost --password my-secret-password

To update the login of the default machine

$ update-netrc update default --login my-login

You can also add new entries, --login and --password are then required:

$ update-netrc update my-new-host --login my-login --password my-password

Installation

pip install update-netrc

Development setup

First clone this repository

git clone https://github.com/maerteijn/update-netrc.git

Install the python project

pyenv virtualenv update-netrc  # or your alternative to create a venv
pyenv activate update-netrc
make install

Linting

black, ruff and mypy are installed and configured

make lint

Formatting

black and ruff are configured

make format

Test

Pytest with coverage is default enabled

make cov

About

A simple command line utility to update netrc credentials.

Resources

License

Stars

Watchers

Forks

Packages

No packages published