
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@sap-cloud-sdk/cli
Advanced tools
A nifty command line interface (CLI) for the SAP Cloud SDK for JavaScript to initialize and package your SAP Cloud Platform application. It is also the launchpad when trying to set up the approuter or getting started with the SAP Cloud SDK for Continuous Delivery.
The SAP Cloud SDK supports you end-to-end when developing applications that communicate with SAP solutions and services such as SAP S/4HANA Cloud, SAP SuccessFactors, and many others.
Using the SDK, you can reduce your effort when developing an application on SAP Cloud Platform by building on best practices delivered by the SDK. The SDK provides Java libraries, JavaScript libraries, project templates and a continuous delivery toolkit.
To install the CLI globally, run:
$ npm install -g @sap-cloud-sdk/cli
As long as the CLI version is less than 1.0.0
, run the following to update to the latest version. Please keep in mind, that these updates can have breaking changes as per the semver spec.
$ npm install -g @sap-cloud-sdk/cli@latest
$ npm install -g @sap-cloud-sdk/cli
$ sap-cloud-sdk COMMAND
running command...
$ sap-cloud-sdk (-v|--version|version)
@sap-cloud-sdk/cli/0.0.7 linux-x64 node-v12.13.1
$ sap-cloud-sdk --help [COMMAND]
USAGE
$ sap-cloud-sdk COMMAND
...
The CLI can initialize an nest-based project or (the more common case) add everything you need to develop for SAP Cloud Platform to an existing project no matter what backend framework you use. If there are any incompatibilities, please let us know in the issues!
To get started run
$ sap-cloud-sdk init
in the project folder.
It will guide you through the initialization, create the necessary files and add necessary dependencies. If you run it in an empty folder, it will ask if you want to initialize a project using @nest/cli.
To deploy to and run on Cloud Foundry, you need to
sap-cloud-sdk package
cf push
)For productive use, your app should implement user authentication and authorization.
For SAP Cloud Foundry, this is usually done by using the approuter and xsuaa service.
Start by running sap-cloud-sdk add-approuter
and configure the xsuaa service accordingly.
sap-cloud-sdk add-approuter
sap-cloud-sdk add-cx-server
sap-cloud-sdk autocomplete [SHELL]
sap-cloud-sdk help [COMMAND]
sap-cloud-sdk help-page
sap-cloud-sdk init [PROJECTDIR]
sap-cloud-sdk package
sap-cloud-sdk add-approuter
Setup your Cloud Foundry app to authenticate through the app router
USAGE
$ sap-cloud-sdk add-approuter
OPTIONS
-h, --help show CLI help
--force Do not fail if a file already exist and overwrite it.
ALIASES
$ sap-cloud-sdk add-app-router
EXAMPLE
$ sap-cloud-sdk add-approuter
See code: src/commands/add-approuter.ts
sap-cloud-sdk add-cx-server
Add the scripts to set up a Jenkins master for CI/CD of your project
USAGE
$ sap-cloud-sdk add-cx-server
OPTIONS
-h, --help show CLI help
--force Do not fail if a file already exist and overwrite it.
EXAMPLE
$ sap-cloud-sdk add-cx-server
See code: src/commands/add-cx-server.ts
sap-cloud-sdk autocomplete [SHELL]
display autocomplete installation instructions
USAGE
$ sap-cloud-sdk autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ sap-cloud-sdk autocomplete
$ sap-cloud-sdk autocomplete bash
$ sap-cloud-sdk autocomplete zsh
$ sap-cloud-sdk autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
sap-cloud-sdk help [COMMAND]
display help for sap-cloud-sdk
USAGE
$ sap-cloud-sdk help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
sap-cloud-sdk help-page
Open the product page, which contains tutorials and links to all relevant resources
USAGE
$ sap-cloud-sdk help-page
OPTIONS
-h, --help show CLI help
See code: src/commands/help-page.ts
sap-cloud-sdk init [PROJECTDIR]
Initializes your project for the SAP Cloud SDK, SAP Cloud Platform Cloud Foundry and CI/CD using the SAP Cloud SDK toolkit
USAGE
$ sap-cloud-sdk init [PROJECTDIR]
ARGUMENTS
PROJECTDIR Path to the folder in which the project should be created.
OPTIONS
-h, --help Show help for the new command.
-v, --verbose Show more detailed output.
--force Do not fail if a file or npm script already exist and overwrite it.
--frontendScripts Add frontend-related npm scripts which are executed by our CI/CD toolkit.
--projectDir=projectDir Path to the folder in which the project should be created.
EXAMPLES
$ sap-cloud-sdk init
$ sap-cloud-sdk init --help
See code: src/commands/init.ts
sap-cloud-sdk package
Copies the specified files to the deployment folder
USAGE
$ sap-cloud-sdk package
OPTIONS
-e, --exclude=exclude Comma seperated list of files or globs to exclude
-h, --help show CLI help
-i, --include=include [default: package.json,package-lock.json,index.js,dist/**/*] Comma seperated list of files or
globs to include
-o, --output=output [default: deployment] Output and deployment folder
-v, --verbose Show more detailed output.
--skipInstall Skip `npm i --production` during packaging
EXAMPLES
$ sap-cloud-sdk package
$ sap-cloud-sdk package -i="index.html"
$ sap-cloud-sdk package --include="package.json,package-lock.json,index.js,dist/**/*" --exclude="**/*.java"
See code: src/commands/package.ts
The CLI is based on oclif and can be extended using plugins. If you think your plugin should be part of the CLI itself, feel free to open a pull request. If you have found a bug in our existing functionality, please open an issue.
The easiest way to create a new release is running
$ npx np
This will test the code, run any prepublish steps, increase the version as selected by the user and create a draft release in github. Afterwards fill in the release notes and press "Publish release". This will trigger the github action and a new release will be published on npm automatically.
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
Note: This license does not apply to the SAP Cloud SDK for JavaScript Logo referenced in this README.
FAQs
CLI for the SAP Cloud SDK for JavaScript
The npm package @sap-cloud-sdk/cli receives a total of 3 weekly downloads. As such, @sap-cloud-sdk/cli popularity was classified as not popular.
We found that @sap-cloud-sdk/cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.