@sasjs/cli

中文文档
6.8.0发布于 2026/11/02ISCCommonJS构建来源已验证

Command line interface for SASjs

原始使用文档
文档目录6 节
  1. Installation
  2. Documentation
  3. Notes
  4. Contributing
  5. Star Gazing
  6. Contributors ✨

SASjs CLI

npm package Github Workflow npm GitHub top language GitHub closed issues GitHub issues

@sasjs/cli is a Command-Line Interface to assist with creating, building, and deploying Data Science projects and HTML5 Web Applications on the SAS platform (both SAS 9 and Viya). Features include:

  • Scaffold a new SAS App in seconds (sasjs create myApp -t jobs)
  • Compile / Build SAS Jobs, Services & Macros locally and deploy / execute remotely, in isolation from other developers (sasjs cbd)
  • Build and deploy without recompiling - for when the services on disk are already the ones you want to ship (sasjs bd)
  • Compile a single Job, Service or Test without touching the rest of the build (sasjs compile identify --source sasjs/jobs/daily/load.sas)
  • Write the test coverage report to sasjsbuild/coverage.json on every compile, ready for a CI job to publish
  • No dependency on the server filesystem
  • Optionally synchronise a local folder onto the server filesystem using sasjs fs
  • Trigger Viya Jobs & Flows (sasjs job execute / sasjs flow execute)
  • Enforce code quality rules with sasjs lint
  • Check what SAS actually printed, and fail a pipeline on it, with sasjs logcheck - the same check reports the log of run, request, job execute and flow execute, and can fail those commands too via logCheck.autoCheck
  • Generate HTML5 documentation (requires doxygen) with sasjs doc
  • Create and execute SAS tests (sasjs test)

There is also a feature to let you deploy a frontend application as a set of streaming web services, bypassing the need to deploy to the SAS Web Server.

A quick demonstration of using it to compile, build and deploy a set of SAS Viya jobs is shown below.

IMAGE ALT TEXT HERE

Installation

  1. Install globally using npm as follows:
  npm i -g @sasjs/cli

You can also use the tool without deploying through NPX as follows:

npx @sasjs/cli <command>

Documentation

Additional documentation can be found on the SASjs CLI documentation site.

Notes

Running npm i -g @sasjs/cli@latest does not always upgrade properly. This is due to a known bug in npm, which is fixed in npm 7.

If you are running NPM in version 6 or below, you can try running npm update -g @sasjs/cli instead, or - the sledgehammer approach - delete the files from the NPM folder and then do a fresh install.

Contributing

See CONTRIBUTING.md for local setup.

Star Gazing

If you find this library useful, please leave a star and help us grow our star graph!

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Muhammad Saad
Muhammad Saad

💻 ⚠️ 👀 🧑‍🏫 📖
Yury Shkoda
Yury Shkoda

💻 📆 ⚠️ 📹 📖
Krishna Acondy
Krishna Acondy

💻 ⚠️ 🚇 🖋 🚧 📦 👀
Mihajlo Medjedovic
Mihajlo Medjedovic

💻 🚇 ⚠️ 👀
Allan Bowe
Allan Bowe

💻 👀 ⚠️ 📹 📖
Sabir Hassan
Sabir Hassan

💻 👀 ⚠️ 🤔
VladislavParhomchik
VladislavParhomchik

⚠️ 👀
Rud Faden
Rud Faden

🐛
Sead Mulahasanović
Sead Mulahasanović

💻
Trevor Moody
Trevor Moody

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

版本与发布记录

@sasjs/cli 共发布 470 个版本,首次发布于 2020/07/08;过去 12 个月发布了 66 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.8.0latest2026/11/021 天前
6.7.02026/11/021 天前
6.6.02026/11/011 天前
6.5.02026/11/012 天前
6.4.82026/11/012 天前
6.4.72026/11/012 天前

关于 @sasjs/cli 的常见问题

@sasjs/cli 是什么?

sasj的命令行接口

如何安装 @sasjs/cli?

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

@sasjs/cli 支持 TypeScript 吗?

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

@sasjs/cli 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@sasjs/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@sasjs/cli 可以商用吗?

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

@sasjs/cli 还在维护吗?

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