Skip to content
ExtensionInstall guide

From nothing to your first findings.

Three steps, about five minutes. Start with preview — it needs no key and sends nothing, so you can see exactly what a scan would upload before you decide to run one.

Step 1 — Get a key

  • Sign in to your CodePulse portal and open Extensions.
  • Choose the stack, give the install a name you will recognise later (“Acme storefront”, “staging”), and press Create key.
  • Copy the key. It looks like cp_ext_… and is about 50 characters.
The key is shown once. We store only a hash of it, so we genuinely cannot show it to you again — if you lose it, revoke that install and create another. Create one key per project or environment, so revoking one never disturbs the rest.

Step 2 — Install the package

Pick your stack. Each package is self-contained: the Node and Python ones have no dependencies at all.

Node · React · Next.js

npm i -D codepulse-scan

export CODEPULSE_KEY=cp_ext_...
npx codepulse preview     # see what would be sent — sends nothing
npx codepulse scan

Python · Django · Flask · FastAPI

pip install codepulse-scan

export CODEPULSE_KEY=cp_ext_...
codepulse preview
codepulse scan

The distribution is codepulse-scan; the module you import is codepulse and the command is codepulse. Python 3.8 and newer.

Laravel · PHP

composer require code-pulse/laravel

# .env
CODEPULSE_KEY=cp_ext_...

php artisan codepulse:preview
php artisan codepulse:scan

Shopify

npm i -D codepulse-shopify

export CODEPULSE_KEY=cp_ext_...
npx codepulse-shopify preview
npx codepulse-shopify scan

It understands a Shopify project’s layout — Liquid templates, sections, snippets and app code — rather than treating it as a generic folder.

WordPress

  • Download the plugin zip (30 KB).
  • Plugins → Add New → Upload Plugin, choose that zip, activate it.
  • Open Tools → Code Pulse and paste the key.
  • Pick which themes and plugins to include, press Preview to see the file list, then Scan now.
The plugin is submitted to the wordpress.org directory and is waiting on their review, which takes weeks. Until it is listed, the zip above is how you install it — it is the same build we submitted.

To keep the key out of the database, define it in wp-config.php instead — the settings screen will use it and stop asking:

define( 'CODEPULSE_KEY', 'cp_ext_...' );

Step 3 — Read the findings

$ npx codepulse scan
Activating acme-shop against https://project-estimate.code-pulse.ai ...
  products: developer, engineering-intelligence
Collecting source from /srv/acme-shop ...
  7 files, 0.02 MB to upload
  skipped 3: excluded by policy
  redacted before upload: django-secret-key x1, stripe-key x1
Uploading ...
  scan 128 accepted (7 files)
  analysing ...

HIGH     shop/views.py:6
  SQL Injection Vulnerability
  The search function builds a SQL query by string concatenation, so user input
  reaches the query directly.
  -> Use parameterised queries: c.execute('SELECT * FROM products WHERE name LIKE %s', [q])
  [security]

4 findings in 7 files: 1 high, 3 medium

The same findings appear in your portal under the install, with their full history.

Where to keep the key

In order of preference: an environment variable, a CI secret, or codepulse.json with that file in .gitignore.

{
  "project": "acme-store",
  "exclude": ["docs/", "fixtures/"]
}

If you put the key in that file and it is not gitignored, every run warns you loudly.

There is deliberately no --key flag. A key passed on the command line ends up in your shell history and in the process list, where other users on the machine can read it.

Running it in CI

--fail-on turns findings into a build result. Progress goes to stderr, so --json on stdout stays pipeable.

# .github/workflows/codepulse.yml
- run: npm i -D codepulse-scan
- run: npx codepulse scan --fail-on high
  env:
    CODEPULSE_KEY: ${{ secrets.CODEPULSE_KEY }}
# GitLab CI
codepulse:
  script:
    - pip install codepulse-scan
    - codepulse scan --fail-on critical
  variables:
    CODEPULSE_KEY: $CODEPULSE_KEY

Start with --fail-on critical so the pipeline only stops for things nobody would argue about, then tighten it once the backlog is clear.

Commands and options

CommandWhat it does
scanCollect, upload, wait for findings
previewList what would be uploaded. Sends nothing, needs no key
activateCheck the key and show what the account can do
status <id>Fetch the findings of an earlier scan
OptionEffect
--path <dir>Project directory (default: the current one)
--project <name>Project name reported to CodePulse
--exclude <glob>Extra gitignore-syntax pattern to skip; repeatable
--truncateIf the project exceeds the limits, upload as much as fits
--no-waitUpload and exit without waiting for findings
--jsonMachine-readable JSON on stdout
--limit <n>Show at most n findings (0 = all, default 50)
--fail-on <sev>Exit 1 if any finding is this severity or worse
--no-colorPlain output, for logs

Exit codes

CodeMeaning
0Clean, or findings below your --fail-on threshold
1Findings at or above the threshold, or a usage problem
2Unknown command
3The key was refused — revoked, suspended, or no active subscription

When something goes wrong

What you seeWhat it means
No CodePulse key foundThe environment variable is not set in the shell that runs the command. In CI, check the secret name matches.
That does not look like a CodePulse keyUsually a truncated paste. A key is cp_ext_ plus 43 characters.
no_active_subscriptionThe key is valid but the plan has lapsed. Nothing was read and nothing was uploaded.
revokedThis install was revoked in the portal. Create a new key.
No source files to scanYou are probably not in the project root — use --path. Or a broad .gitignore is excluding everything; preview will show you.
Project over the limit2,000 files or 20 MB. Narrow it with --exclude, or pass --truncate to send what fits.
Refusing to send your key over http://A custom CODEPULSE_URL is set to a plain-http address. Use https://.
Too many requests30 calls a minute per key. Usually several CI jobs sharing one key — give each its own.

Before you run your first scan

Run preview and read the output. It is the one step that turns everything on the What we receive page from a claim into something you have checked yourself.