@adobe/helix-onedrive-cli

中文文档
1.11.443发布于 2026/10/27Apache-2.0ES Module构建来源已验证近 30 天下载 2777

Helix OneDrive CLI

原始使用文档
文档目录10 节
  1. Status
  2. Installation
  3. Usage
  4. Setup
  5. Login with device token
  6. Login with username / password
  7. Development
  8. Build
  9. Test
  10. Lint

Helix OneDrive CLI

Project Helix OneDrive Command Line Interface Utility

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript semantic-release

Installation

$ npm install @adobe/helix-onedrive-cli

Usage

Usage: 1d <command>

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 <link>       Resolves a share link to the respective drive item.
  1d ls [path]            Lists the contents of the [path]
  1d get <path> [local]   downloads the file at path
  1d put <local> [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.

# 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:

$ 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:

$ 1d me
Logged in as: John Doe ([email protected])

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:

$ 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 ([email protected])

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.

$ 1d login [email protected]
password: ****
updated .auth.json file.
Logged in as: John Doe ([email protected])

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint

版本与发布记录

@adobe/helix-onedrive-cli 共发布 557 个版本,首次发布于 2020/02/05;过去 12 个月发布了 72 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.11.443latest2026/10/2711 天前
1.11.4422026/10/2514 天前
1.11.4412026/10/2216 天前
1.11.4402026/10/2117 天前
1.11.4392026/10/1325 天前
1.11.4382026/10/1325 天前

关于 @adobe/helix-onedrive-cli 的常见问题

@adobe/helix-onedrive-cli 是什么?

Helix OneDrive CLI

如何安装 @adobe/helix-onedrive-cli?

在项目目录运行 npm install @adobe/helix-onedrive-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 1d,可以用 npx 1d 直接运行。

@adobe/helix-onedrive-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adobe__helix-onedrive-cli 是否存在。

@adobe/helix-onedrive-cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adobe/helix-onedrive-cli 可以商用吗?

@adobe/helix-onedrive-cli 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/helix-onedrive-cli 的下载量有多少?

根据 npm 官方下载统计,@adobe/helix-onedrive-cli 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,777 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/helix-onedrive-cli 还在维护吗?

最新版本 1.11.443 发布于 2026/10/27(11 天前);至今共发布 557 个版本,其中过去 12 个月发布了 72 个;首次发布于 2020/02/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。