Set Up with an AI Agent
Set up Currents with Claude Code, Cursor, Codex or another coding agent, locally and in CI
Paste this prompt into your coding agent, in the repository with your tests:
Set up this repository to report test results to Currents. Read https://docs.currents.dev/getting-started/setup-with-an-agent.md and follow it.To add Currents to CI in a repository that already reports from a local machine:
Add Currents to this repository's CI. Read https://docs.currents.dev/getting-started/setup-with-an-agent.md and follow the "Add Currents to CI" section.The rest of this page is written for the agent. It points to the setup guide for each framework and adds the steps those guides leave to the reader.
1. Ask for the Project ID and Record Key
Ask the user for both values. Currents shows them right after the user creates a project. Later, the Project ID is in Project Settings and the Record Key is under Record Keys in the organization menu (Record Key).
Read both from environment variables: CURRENTS_PROJECT_ID and CURRENTS_RECORD_KEY. Where a guide writes a project ID or key into a file, use the environment variable instead. Never commit the Record Key.
2. Follow the guide for the framework
Anything that writes JUnit XML: WebdriverIO, Postman (Newman)
A JUnit reporter in the test configuration
Make every change the guide lists, using the repository's package manager. If the repository has more than one test suite, for example Playwright end-to-end tests and Jest unit tests, set up each one and run each one in step 3.
For Cypress, check the version first. Currents doesn't support Cypress 13 and later; see Compatibility. Tell the user instead of changing their Cypress version.
3. Run the tests once
Run the tests with both variables set, for example:
The run reached Currents when the output has a link to it:
Playwright prints
Run URL: https://app.currents.dev/run/...when the run starts.Jest, Vitest and JUnit print the link when
currents run uploadfinishes.
Give the user the link. If there is none, follow Missing Runs.
Add Currents to CI
Find the CI provider from the repository files, such as
.github/workflows/,.gitlab-ci.yml,.circleci/config.yml,Jenkinsfile,azure-pipelines.yml,.buildkite/,buildspec.yml(AWS CodeBuild) or.harness/.Follow its guide from CI Setup. For Jest and Vitest, use the CI Setup page under that framework.
Ask the user to store
CURRENTS_RECORD_KEYas a CI secret andCURRENTS_PROJECT_IDas a CI variable or secret. Reference them by those names in the CI configuration.If a guide's container image shows as an expression such as
space.vars.PW_IMAGE_ROUTE, usemcr.microsoft.com/playwright:v<version>-noble, where<version>is the@playwright/testversion in the repository.After the user pushes the change, check that the CI log has the run link from step 3.
Secrets are not available to every job. In GitHub Actions, pull requests from forks get no secrets, so their runs don't reach Currents. Missing Runs lists the same limit for other providers.
Last updated
Was this helpful?