Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@currents/cmd

Package Overview
Dependencies
Maintainers
0
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@currents/cmd

Currents CLI tools

  • 1.6.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@currents/cmd

CLI tool for Currents - a cloud platform for debugging, troubleshooting, and analyzing CI tests.

Installation

npm install @currents/cmd --save-dev

Upload test results

  • Generate test results with one of the supported reporters
  • Upload the results
npx currents upload --project-id=xxx --key=yyy

ℹ️ Get familiar with CI Build ID 📖 before using currents in CI. It is important to set the CI Build ID explicitly using --ci-build-id option, if you are using CI sharding or multiple CI machines to parallelize your tests. If not set explicitly, the CI Build ID will be set to a random value.

Notes

Obtain --project-id and --key from https://app.currents.dev to identify the project and associate the results with your organization.

currents will upload the results, as follows:

  • use process.env.CURRENTS_REPORT_DIR or --reportDir to read the results previously generated by one of supported reporters, otherwise
  • use the most recently created directory named as .currents/[timestamp]-[uuidv4()] in the current working directory

Configuration

Please note that all options apart from --project-id and --key are optional.

PropertyTypeDescriptionEnvironment variableDefault
-k, --keystringThe record key to record the results to Currents. Read more: https://currents.dev/readme/guides/record-keyCURRENTS_RECORD_KEY-
-p, --project-idstringThe id of the project for reportingCURRENTS_PROJECT_ID-
--machine-idstringUnique identifier of the machine running the tests. If not provided, it will be generated automatically. See: https://currents.dev/readme/readme?q=machineIdCURRENTS_MACHINE_ID[random-string]
--report-dirstringThe directory containing the test results created with one of the supported reportersCURRENTS_REPORT_DIR.currents/*
--ci-build-idstringThe id of the build to record the test run. Read more: https://currents.dev/readme/guides/ci-build-idCURRENTS_CI_BUILD_IDauto:[random-string]
--debugbooleanEnable debug logsDEBUG="currents,currents:*"false
-t, --tagstringComma-separated tag(s) for recorded runs in CurrentsCURRENTS_TAG-
--disable-title-tagsbooleanDisable extracting tags from test title, e.g. Test name @smoke would not be tagged with smokeCURRENTS_DISABLE_TITLE_TAGSfalse
--remove-title-tagsbooleanRemove tags from test names in Currents, e.g. Test name @smoke becomes Test name in the dashboardCURRENTS_REMOVE_TITLE_TAGSfalse

The configuration is also available by running the CLI command with the --help argument.

Use Currents API

  • Retrieve information about Currents resources in JSON format

ℹ️ Please note that the command is experimental and was primarily built to obtain test run data in CI. Its functionality might be extended in the future.

ℹ️ The command requires the --project-id and --api-key from Currents to authenticate the request and provide the required data. Alternatively, you can set the CURRENTS_PROJECT_ID and CURRENTS_API_KEY environment variables.

Supported operations:

  • Obtain run data using the CI Build ID 📖 by running the following command:

    npx currents api get-run --ci-build-id <ci-build-id> --output path/to/save/run.json
    
  • Obtain the last completed run data, filtered by --branch and/or --tag, by running the following command:

    npx currents api get-run --branch <branch> --tag <tag-1,tag-2,...tag-n>
    

For more examples and usage options, run npx currents api --help.

Cache test artifacts

The currents cache command allows you to archive files from specified locations and save them under an ID in Currents storage. It also stores a meta file with configuration data. You can provide the ID manually or it can be generated based on CI environment variables (only GitHub, GitLab, and Circle CI are supported).

To cache files, use the following command:

npx currents cache set --key <record-key> --id <id> --path <path-1,path-2,...path-n>

To download files, use the following command:

npx currents cache get --key <record-key> --id <id>

For more examples and usage options, run npx currents cache --help.

Troubleshooting

Run the CLI command with the --debug argument or prefix it with DEBUG="currents,currents:*" to obtain detailed information about the command execution process.

Keywords

FAQs

Package last updated on 06 Jan 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc