ContentRX CLI
contentrx-cli is a thin command-line client for the ContentRX
content-standards checker. It posts your strings to the ContentRX API and
prints violations — the kind of thing you'd call from a pre-commit hook,
a CI job, or an ad-hoc terminal check while writing UI copy.
pip install contentrx-cli
export CONTENTRX_API_KEY=cx_... # mint at https://contentrx.io/dashboard
contentrx "Click here to learn more"
The CLI ships with no third-party dependencies — stdlib only. Install time is seconds, the attack surface is whatever Python itself already includes.
Authentication
All requests need an API key. Generate one in the dashboard:
https://contentrx.io/dashboard → Generate key (or Rotate)
The key is shown exactly once. Store it somewhere you trust. The CLI
reads it from the CONTENTRX_API_KEY environment variable — no global
config file, no per-directory .contentrxrc.
export CONTENTRX_API_KEY=cx_a1b2c3...
If the key is missing or expired the CLI prints a short, actionable error pointing back at the dashboard URL.
Pointing at a non-default backend
Self-hosted or test-deployment users can override the API URL:
export CONTENTRX_API_URL=https://contentrx-staging.example.com
Usage
Single check
contentrx "Save changes"
✓ PASS
Content type: button_cta
Active-voice verb. Specific action. Clean.
With hints:
contentrx --content-type error_message "Something went wrong."
contentrx --moment destructive_action "Delete forever?"
JSON output
For piping into other tools or inspecting the raw response:
contentrx --json "Save changes"
Batch check
Text file, one string per line:
cat > strings.txt <<'EOF'
Save changes
Click here to learn more
Something went wrong.
EOF
contentrx --batch strings.txt
JSON with per-string hints:
cat > strings.json <<'EOF'
[
{"text": "Save changes", "content_type": "button_cta"},
{"text": "Delete forever?", "moment": "destructive_action"}
]
EOF
contentrx --batch strings.json
Verbose mode
Adds latency + month-to-date usage from the API response:
contentrx -v "Save changes"
Scenarios
Three concrete things you can do with the CLI today.
1. Ad-hoc check while writing copy
You're writing a button label for a hero section. Is "Click here to learn more" actually good?
$ contentrx --content-type button_cta "Click here to learn more"
✗ FAIL
Moment: decision_point
2 violations:
ACT-02 [block] Vague CTA — "Click here" doesn't name the destination.
Suggestion: Lead with verb+object: "Learn more" or "Read the docs".
CLR-03 [warn] Redundant phrasing — "to learn more" duplicates the button's purpose.
$ contentrx --content-type button_cta "Read the docs"
✓ PASS
Moment: decision_point
Verb-first. Object named. Length appropriate for a CTA.
Takes <2 seconds per check. Free tier gives 10 checks/month for exactly this kind of exploration.
2. Linting an i18n catalog during CI
You have locales/en.json with every user-facing string. Lint it on
every PR that touches it:
# .github/workflows/copy-lint.yml
on:
pull_request:
paths: ['locales/en.json']
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install contentrx-cli
- name: Convert en.json → ContentRX batch format
run: |
jq -r 'to_entries | map({text: .value}) | tostring' locales/en.json > strings.json
- name: Lint
env:
CONTENTRX_API_KEY: ${{ secrets.CONTENTRX_API_KEY }}
run: contentrx --batch strings.json
Exit code 1 on any violation fails the job and blocks the PR. Engineers get a terminal output they can scan in 10 seconds.
3. Pre-commit hook on a specific file
You only care about the canonical strings file, not every edit. One hook, scoped to that file:
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: contentrx
name: ContentRX
entry: contentrx --batch
language: system
files: ^content/strings\.json$
pass_filenames: true
Runs only when content/strings.json changes. Catches violations
before they leave your laptop.
Exit codes
Stable across versions — safe to pin on in CI.
| Code | Meaning |
|---|---|
0 |
All checks passed |
1 |
At least one check failed (violations present) |
2 |
Usage error (argparse / invalid arguments / bad batch file) |
3 |
Missing or invalid CONTENTRX_API_KEY |
4 |
Monthly quota exhausted |
5 |
Rate limit exceeded |
6 |
Network / upstream error |
CI examples
GitHub Actions
name: Content lint
on:
pull_request:
paths: ['src/**/*.tsx', 'src/**/*.ts']
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install contentrx-cli
- name: Lint changed UI strings
env:
CONTENTRX_API_KEY: ${{ secrets.CONTENTRX_API_KEY }}
run: |
contentrx --batch strings.json
(For AST-based extraction of strings from TSX/JSX, use the
contentrx-action GitHub Action instead of rolling your own
extraction. Shipped separately in github-action/.)
pre-commit
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: contentrx
name: ContentRX
entry: contentrx --batch
language: system
files: ^content/strings\.json$
Development
cd cli-client
pip install -e ".[dev]"
pytest tests/
Tests mock the HTTP layer so they run offline without an API key.
License
In-monorepo source: Functional Source License, FSL-1.1-MIT (auto-converts to MIT after the FSL grant period). The published contentrx-cli package on PyPI ships under MIT. See LICENSE.
Metadata
Release files for contentrx-cli 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| contentrx_cli-0.4.2.tar.gz | 28.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| contentrx_cli-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.9 kB
Release files / contentrx_cli-0.4.2.tar.gz
| Download URL | contentrx_cli-0.4.2.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
322e1eecd7489e3b4e453f5166a4142679a2dabb3ef8429577911b268160a447
|
|
BLAKE2b-256 checksum How to use checksums |
5409542bf9d1e1b20f31d123957cb02e975729dae27b93a9fe7893947a836ab2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logRelease files / contentrx_cli-0.4.2-py3-none-any.whl
| Download URL | contentrx_cli-0.4.2-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6c73f84ee2f81a63b6cacb8408278152d44521b5ae5be0fe93c0465442cca8f
|
|
BLAKE2b-256 checksum How to use checksums |
ef453c3d0c1f089ecb9de5e79af07e95df94b1d3af2633622a667920e88d3114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logSecurity for contentrx-cli 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for contentrx_cli-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.