Crates.io | github-device-flow |
lib.rs | github-device-flow |
version | 0.2.0 |
source | src |
created_at | 2022-08-19 22:04:16.55535 |
updated_at | 2024-01-26 03:01:31.112729 |
description | Binary and library for performing the GitHub Device Flow |
homepage | |
repository | https://github.com/jakewilkins/gh-device-flow |
max_upload_size | |
id | 648923 |
size | 58,352 |
Crate that implements the GitHub Device Flow for authenticating with GitHub Apps.
It also implements the refresh mechanism for GitHub Apps that use GitHub's token expiration feature.
To use the CLI, download the binary for your architecture/OS from the latest release.
Once extracted, execute the command providing the Client ID for your App:
github-device-flow --client-id Iv1.8675309ABCDEFGH
This will prompt you to open a browser window and provide the generated device code. Once completed, your access token will be printed to STDOUT as a JSON object. If your App requests refresh tokens one will also be printed.
To refresh your OAuth Access using a Refresh Token, pass it as a --refresh
flag:
github-device-flow --client-id Iv1.8675309ABCDEFGH --refresh thisisnotarefreshtoken
To view the full help, pass the --help
flag:
$ github-device-flow --help
github-device-flow 0.1.2
Binary and library for performing the GitHub Device Flow
USAGE:
github-device-flow [OPTIONS] --client-id <CLIENT_ID>
OPTIONS:
-c, --client-id <CLIENT_ID> Client ID
-h, --host <HOST> The host to authenticate with
--help Print help information
-r, --refresh <REFRESH> A Refresh Token to exchange
-V, --version Print version information