Skip to main content

AI-powered API validation tool - never fear API updates again

Project description

Strayl Lint

AI-powered API validation tool - never fear API updates again.

Strayl Lint automatically checks if your API integrations match their latest documentation, catching breaking changes before they hit production.

Quick Start

1. Install

pip install strayl-lint

2. Get API Key

Visit strayl.dev/dashboard and generate your API key.

3. Annotate Your Code

Add strayl:doc comments above API calls:

# strayl:doc https://api.stripe.com/v1/openapi.json
response = requests.post(
    "https://api.stripe.com/v1/charges",
    json={"amount": 2000, "currency": "usd"}
)
// strayl:doc https://api.github.com/openapi.json
fetch('https://api.github.com/repos/owner/repo', {
  method: 'GET'
})

4. Run Check

export STRAYL_API_KEY=sk_live_xxxxx
strayl-lint check

Features

  • Always Up-to-Date - Checks against live documentation
  • 🤖 AI-Powered - Understands APIs like a human developer
  • 🚀 CI/CD Ready - Perfect for pre-commit hooks and pipelines
  • 📝 Multiple Languages - Python, JavaScript, TypeScript, Go, and more
  • 🔒 Secure - Only sends API endpoints, never your code

Usage

Check Current Directory

strayl-lint check

Check Specific Path

strayl-lint check src/

Filter by File Extension

strayl-lint check --ext .py,.js

Initialize Config File

strayl-lint init sk_live_xxxxx
# Creates .strayl config file

Configuration

Environment Variable

export STRAYL_API_KEY=sk_live_xxxxx

Config File

Create .strayl in your project root:

api_key=sk_live_xxxxx

Important: Add .strayl to your .gitignore!

CI/CD Integration

GitHub Actions

name: API Check

on: [push, pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - run: pip install strayl-lint
      - run: strayl-lint check
        env:
          STRAYL_API_KEY: ${{ secrets.STRAYL_API_KEY }}

Pre-commit Hook

Add to .pre-commit-config.yaml:

repos:
  - repo: local
    hooks:
      - id: strayl-lint
        name: Strayl API Check
        entry: strayl-lint check
        language: system
        pass_filenames: false

How It Works

  1. Scan - Finds strayl:doc annotations in your codebase
  2. Extract - Identifies HTTP methods, endpoints, and parameters
  3. Validate - Sends to Strayl Cloud for AI-powered validation
  4. Report - Shows you exactly what changed in the API

Supported Documentation Formats

  • OpenAPI / Swagger (JSON, YAML)
  • HTML documentation pages
  • Markdown docs
  • API reference sites

Privacy & Security

  • ✅ Only API endpoints and HTTP methods are sent
  • ✅ No source code is transmitted
  • ✅ No sensitive data leaves your machine
  • ✅ Documentation URLs must be publicly accessible

Examples

Yookassa Integration

# strayl:doc https://yookassa.ru/developers/api
import requests

# Watchdog will detect if 'sum' was renamed to 'amount'
response = requests.post(
    "https://api.yookassa.ru/v3/payments",
    json={"sum": 1000}  # ⚠️  Warning: field 'sum' renamed to 'amount'
)

Stripe Integration

// strayl:doc https://stripe.com/docs/api
const payment = await stripe.paymentIntents.create({
  amount: 2000,
  currency: 'usd',
  // ✅ All fields match current API
});

Commands

check

Check API calls against documentation.

strayl-lint check [PATH] [OPTIONS]

Options:

  • --api-key, -k TEXT - API key (or use STRAYL_API_KEY env var)
  • --ext, -e TEXT - Comma-separated file extensions
  • --verbose, -v - Show detailed output
  • --help - Show help message

init

Initialize configuration file.

strayl-lint init <API_KEY>

version

Show version information.

strayl-lint version

Troubleshooting

"No API key found"

Make sure you've set your API key via:

  • Environment: export STRAYL_API_KEY=sk_live_xxx
  • Config file: echo 'api_key=sk_live_xxx' > .strayl
  • CLI flag: strayl-lint check --api-key sk_live_xxx

"No API calls found"

Make sure you've added strayl:doc annotations:

# strayl:doc https://api.example.com/docs
requests.post(url, json=data)

Contributing

We welcome contributions! Please see CONTRIBUTING.md.

License

MIT License - see LICENSE for details.

Links


Never fear API updates again. 🐕

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strayl_lint-0.1.3.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strayl_lint-0.1.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file strayl_lint-0.1.3.tar.gz.

File metadata

  • Download URL: strayl_lint-0.1.3.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for strayl_lint-0.1.3.tar.gz
Algorithm Hash digest
SHA256 636b6aed6d39101450c221ed814b18be70e98f0a3a0c981e3dda9667370a3234
MD5 9b2e25d105eea8237dafc25c5569e44d
BLAKE2b-256 1aee30d56b0d3a6c4a5da930d1a9d979c9e02005717b4c4815dbe235ac0444db

See more details on using hashes here.

File details

Details for the file strayl_lint-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: strayl_lint-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for strayl_lint-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f179a255b787d2369628f6feb53ef03ccd9d651627b9517785a510794b80ede
MD5 e025797cc909761240c2dc4653388ef2
BLAKE2b-256 8128315d162bcdf48a290bdc21e724a7774406c8c230b4f5ce115a42dcac4310

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page