@flowscripter/flowscripter-io-cli

中文文档
3.0.15发布于 2026/11/12MITES Module构建来源已验证近 30 天下载 2262
原始使用文档
文档目录9 节
  1. Installation
  2. Locations
  3. Commands
  4. Provider Plugins
  5. Usage
  6. Development
  7. Functional Tests
  8. Documentation
  9. License

flowscripter-io-cli

version build license: MIT

CLI for the pluggable-io-framework, built on dynamic-cli-framework

Installation

NOTE: The binaries are 10's of megabytes in size as the entire Bun runtime is included.

MacOS

Via Homebrew:

brew install flowscripter/tap/flowscripter-io-cli

Linux

In a terminal:

curl -fsSL https://raw.githubusercontent.com/flowscripter/flowscripter-io-cli/main/script/install.sh | sh

Windows

Via Winget:

winget install Flowscripter.flowscripter-io-cli

Manual Install

You can download and extract the binary zip files from the releases page.

Locations

Every command addresses data through a location argument: --source and --dest for copy/move, and --location for the other commands. A location has a protocol and one group of fields per installed protocol:

  • --location.protocol=file selects the protocol. The allowed values are the protocols of the installed provider plugins.
  • --location.file.path=/data and the other fields of the selected protocol are taken from that protocol's provider plugin, and are validated against it.
  • For file (and other protocols with folders), a location with a filename addresses one file, one with a pattern (a glob such as *.txt) addresses the matching files in path, and one with neither addresses the whole path folder.

flowscripter-io-cli <command> --help lists the fields of every installed protocol.

Commands

  • list --location [--recursive] [--regex] - list a folder, or the files matching a pattern location, one JSON line per item
  • get-properties --location - print a file or folder's properties as JSON
  • set-properties --location [--last-modified] [--content-type] [--properties.<protocol>.<name>] - set properties: last modified time and content type apply to every protocol, and --properties holds one group per protocol for its own settable properties (e.g. --properties.file.mode=384)
  • delete --location - delete a file or folder
  • copy --source --dest [--payload-kind] - copy a file, a folder, or the files matching a pattern, using a direct provider copy when possible, with a progress bar for a single file. Prints the negotiated transfer path, e.g. path: file/js -> file/js, direct
  • move --source --dest [--payload-kind] - move, with the same behaviour as copy
  • hash --location [--algorithm] [--payload-kind] - hash a file by reading its stream directly, outside the framework's transfer path. --algorithm is one of sha1, sha256 (the default, using a native hasher), sha384, sha512 or md5

Common behaviour:

  • --payload-kind is auto (the default, letting the registry choose), js or native. An unavailable kind fails with the kinds that are installed.
  • During list, copy, move or hash, the first Ctrl-C stops gracefully and reports the result as stopped, and a second Ctrl-C cancels.
  • Operations a protocol does not support (e.g. list over https) fail with a "not supported by protocol" error.
  • Any required argument omitted on the command line is prompted for interactively, via dynamic-cli-framework's ArgumentPrompterService.

Provider Plugins

This package has no dependency on any provider plugin. Install one or more through the CLI's own plugin management (provided by dynamic-cli-framework's plugin commands). They are discovered at startup through dynamic-plugin-framework's NpmPluginRepository, and several protocols, or several implementations of one protocol, can be installed side by side:

flowscripter-io-cli plugin:add @flowscripter/io-plugin-filesystem

Usage

Once installed (see Installation):

flowscripter-io-cli plugin:add @flowscripter/io-plugin-filesystem
flowscripter-io-cli list --location.protocol=file --location.file.path=.
flowscripter-io-cli copy \
  --source.protocol=file --source.file.path=. --source.file.filename=a.txt \
  --dest.protocol=file --dest.file.path=. --dest.file.filename=b.txt
flowscripter-io-cli copy \
  --source.protocol=file --source.file.path=. --source.file.pattern='*.txt' \
  --dest.protocol=file --dest.file.path=backup
flowscripter-io-cli hash --location.protocol=file --location.file.path=. \
  --location.file.filename=a.txt --algorithm sha256

Development

Install dependencies:

bun install

Test:

bun test

Format:

bunx oxfmt

Lint:

bunx oxlint index.ts src/ tests/

Functional Tests

Refer to functional_tests/README.md

Documentation

Refer to pluggable-io-framework, pluggable-io-framework-api and io-plugin-filesystem for the contracts and orchestration this CLI is built on.

License

MIT © Flowscripter

版本与发布记录

@flowscripter/flowscripter-io-cli 共发布 39 个版本,首次发布于 2026/08/17;过去 12 个月发布了 39 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.15latest2026/11/123 天前
3.0.142026/11/0510 天前
3.0.132026/11/0213 天前
3.0.122026/10/2917 天前
3.0.112026/10/2620 天前
3.0.102026/10/2423 天前

关于 @flowscripter/flowscripter-io-cli 的常见问题

@flowscripter/flowscripter-io-cli 是什么?

CLI for https://github.com/flowscripter/pluggable-io-framework

如何安装 @flowscripter/flowscripter-io-cli?

在项目目录运行 npm install @flowscripter/flowscripter-io-cli,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(^7.0.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@flowscripter/flowscripter-io-cli 支持 TypeScript 吗?

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

@flowscripter/flowscripter-io-cli 支持 ESM 还是 CommonJS?

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

@flowscripter/flowscripter-io-cli 可以商用吗?

@flowscripter/flowscripter-io-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@flowscripter/flowscripter-io-cli 的下载量有多少?

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

@flowscripter/flowscripter-io-cli 还在维护吗?

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