Crates.io | codr |
lib.rs | codr |
version | 1.1.3 |
source | src |
created_at | 2023-10-18 10:25:01.315633 |
updated_at | 2023-11-28 12:15:36.047257 |
description | A CLI tool for interacting with OneDrive. |
homepage | https://github.com/PromH/codr |
repository | https://github.com/PromH/codr |
max_upload_size | |
id | 1006582 |
size | 60,886 |
codr
Client for OneDrive in Rust or (codr
) - A Rust Command line tool for interacting with OneDrive.
codr
is a simple client that requires your own Microsoft OAuth2 credentials (see here for official instructions.) in order to function properly.
Once the credentials have been obtained, they can then be supplied to codr
through a variety of means (see the Example Commands).
# Via Cargo
cargo install codr
The following steps outline how these credentials can be obtained.
Web
application with:
Redirect URI
of http://localhost:<REDIRECT_PORT><REDIRECT_ENDPOINT>
8080
/redirect
Overview
. Copy the Application (client) ID
as the MSGRAPH_CLIENT_ID.Certificates & secrets
and add a new client secret. Copy the secret value
as MSGRAPH_CLIENT_SECRET.API permissions
and add a permission then select Microsoft Graph
and
Delegated permissions
. Now add the Files.Read
permission (and other permissions as necessary).# Help commands
codr -h
codr get -h
codr get drive-item -h
codr get drive-item-children -h
codr create sharing-links -h
# Example commands (using command options)
codr -i my-msgraph-client-id -s my-msgraph-client-secret get drive-item path/to/folder
codr -i my-msgraph-client-id -s my-msgraph-client-secret get drive-item-children path/to/folder
codr -i my-msgraph-client-id -s my-msgraph-client-secret create sharing-links path/to/folder/file embed
# Example commands (using config.yaml file)
codr -c config.yaml get drive-item path/to/folder
codr -c config.yaml get drive-item-children path/to/folder
codr -c config.yaml create sharing-links path/to/folder/file embed
# Example commands (using environment variable)
MSGRAPH_CLIENT_ID=my-msgraph-client-id
MSGRAPH_CLIENT_SECRET=my-msgraph-client-secret
codr get drive-item path/to/folder
codr get drive-item-children path/to/folder
codr create sharing-links path/to/folder/file embed
msgraph_client_id: insert-client-id-here
msgraph_client_secret: insert-client-secret-here
[!WARNING] This is my first Rust project so use with caution...