https://github.com/adobe/helix-onedrive-cli
Command-line tools for onedrive integration
https://github.com/adobe/helix-onedrive-cli
cli helix helix2 helix3
Last synced: 3 months ago
JSON representation
Command-line tools for onedrive integration
- Host: GitHub
- URL: https://github.com/adobe/helix-onedrive-cli
- Owner: adobe
- License: apache-2.0
- Created: 2020-02-04T05:51:38.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2026-03-02T22:46:22.000Z (4 months ago)
- Last Synced: 2026-03-02T22:59:42.818Z (4 months ago)
- Topics: cli, helix, helix2, helix3
- Language: JavaScript
- Homepage:
- Size: 10.4 MB
- Stars: 13
- Watchers: 33
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Helix OneDrive CLI
> Project Helix OneDrive Command Line Interface Utility
## Status
[](https://codecov.io/gh/adobe/helix-onedrive-cli)
[](https://circleci.com/gh/adobe/helix-onedrive-cli)
[](https://github.com/adobe/helix-onedrive-cli/blob/main/LICENSE.txt)
[](https://github.com/adobe/helix-onedrive-cli/issues)
[](https://lgtm.com/projects/g/adobe/helix-onedrive-cli)
[](https://github.com/semantic-release/semantic-release)
## Installation
```bash
$ npm install @adobe/helix-onedrive-cli
```
## Usage
```
Usage: 1d
Commands:
1d me Show information about the logged in user.
1d login Start the login interactive flow or ROPC flow with username / password.
1d logout Logout be removing the authorization file.
1d resolve Resolves a share link to the respective drive item.
1d ls [path] Lists the contents of the [path]
1d get [local] downloads the file at path
1d put [path]] upload the local file.
Options:
--version Show version number
--verbose, -v Run with verbose logging
--help Show help
```
## Setup
The 1d client runs with a default client id which supports interactive login. Just run
`1d login`, copy paste the authorization code in the browser and sing into microsoft.
If you want to run the client with different parameters, you can provide
a `.env` file containing the azure client-id and client-secret of your app.
```dotenv
# azure app oauth secrets
AZURE_APP_CLIENT_ID="11111111-1111-1111-1111-11111111111"
AZURE_APP_CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```
After the `.env` is setup, start the _dev server_ with:
```console
$ npm start
```
and open a browser at: http://localhost:4502/.
click on the link to login. after successful login to microsoft, the server writes a `.auth.json` on disk.
After that you can stop the server, and use the cli, eg:
```console
$ 1d me
Logged in as: John Doe (john@example.com)
```
To reset authentication, just delete the `.auth.json` file and open the browser in private mode.
### Login with device token
In order to login with a device token, run:
```console
$ 1d login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code HNGP5CAF8 to authenticate.
updated .auth.json file.
$ 1d me
Logged in as: John Doe (john@doe.com)
```
### Login with username / password
Some accounts and apps allow login with username and password (ROPC flow). Usually federated accounts require MFA,
which disallow using ROPC.
```console
$ 1d login --username=john@doe.com
password: ****
updated .auth.json file.
Logged in as: John Doe (john@doe.com)
```
## Development
### Build
```bash
$ npm install
```
### Test
```bash
$ npm test
```
### Lint
```bash
$ npm run lint
```