https://github.com/r-lib/credentials
  
  
    Tools for Managing SSH and Git Credentials 
    https://github.com/r-lib/credentials
  
git password r rstats ssh
        Last synced: 7 months ago 
        JSON representation
    
Tools for Managing SSH and Git Credentials
- Host: GitHub
 - URL: https://github.com/r-lib/credentials
 - Owner: r-lib
 - License: other
 - Created: 2018-11-06T19:40:03.000Z (almost 7 years ago)
 - Default Branch: main
 - Last Pushed: 2024-10-03T18:19:02.000Z (about 1 year ago)
 - Last Synced: 2025-03-31T15:25:36.268Z (7 months ago)
 - Topics: git, password, r, rstats, ssh
 - Language: R
 - Homepage: https://docs.ropensci.org/credentials
 - Size: 286 KB
 - Stars: 72
 - Watchers: 3
 - Forks: 5
 - Open Issues: 11
 - 
            Metadata Files:
            
- Readme: README.md
 - Changelog: NEWS
 - License: LICENSE
 
 
Awesome Lists containing this project
- jimsghstars - r-lib/credentials - Tools for Managing SSH and Git Credentials (R)
 
README
          # credentials 
*This package is a joint effort from [rOpenSci](https://ropensci.org/) and the [Tidyverse](https://www.tidyverse.org/) team.*
> Tools for Managing SSH and Git Credentials
[](https://www.repostatus.org/#active)
[](https://ci.appveyor.com/project/jeroen/credentials)
[](http://cran.r-project.org/package=credentials)
[](http://cran.r-project.org/web/packages/credentials/index.html)
Setup and retrieve HTTPS and SSH credentials for use with 'git' and 
other services. For HTTPS remotes the package interfaces the 'git-credential' 
utility which 'git' uses to store HTTP usernames and passwords. For SSH 
remotes we provide convenient functions to find or generate appropriate SSH 
keys. The package both helps the user to setup a local git installation, and
also provides a back-end for git/ssh client libraries to authenticate with 
existing user credentials.
### Setting your GITHUB_PAT
Automatically populate your `GITHUB_PAT` environment variable from the native git credential store. The credential manager will safely prompt the user for credentials when needed.
```r
credentials::set_github_pat()
```
Use this function in your `.Rprofile` if you want to automatically set `GITHUB_PAT` for each R session, without hardcoding your secret in plain text.
### Manage HTTPS credentials
Load or prompt the user for GitHub username and password:
```r
library(credentials)
git_credential_ask('https://github.com')
```
See which credential helper back-end your `git-credential` store is using:
```r
credentials::credential_helper_get()
```
### Manage SSH keys
Lookup the appropriate key, or prompt the user to generate one:
```r
library(credentials)
ssh_key_info()
```
You can copy-paste the public key directly to your [GitHub profile](https://github.com/settings/ssh/new)!
## For developers
Use the openssl package to read the user private key in R for encryption / signatures: 
```r
user <- ssh_key_info()
key <- ssh_read_key(user$key)
openssl::write_pem(key)
```