Skip to main content

aidecl

Command-line tool for validating, converting, and creating AI Declaration (aidecl) files.

AI Declaration files describe how AI tools were used in the creation of software, datasets, documents, and other digital work. This CLI validates them against the schema with both structural (JSON Schema) and semantic checks.

Installation

pip install aidecl

For development:

git clone https://github.com/ai-declaration/cli.git
cd cli
pip install -e ".[dev]"

Quick Start

# Create a new declaration file
aidecl init --format yaml

# Edit aidecl.yaml with your project details

# Validate it
aidecl validate aidecl.yaml

Usage

validate

Check one or more declaration files against the schema:

aidecl validate aidecl.yaml
aidecl validate aidecl.json another.yaml
aidecl validate --verbose aidecl.yaml
aidecl validate --output-format json aidecl.yaml
aidecl validate --strict aidecl.yaml  # warnings become errors
aidecl validate --quiet aidecl.yaml    # only exit code, no output

Sample output:

PASS [yaml]: aidecl.yaml
FAIL [yaml]: aidecl.yaml
    Schema error at 'ai_usage.level': 'high' is not valid. Allowed values: 'none', 'minimal', 'moderate', 'significant', 'extensive'

convert

Convert between YAML and JSON:

aidecl convert aidecl.yaml -f json
aidecl convert aidecl.json -f yaml -o output.yaml

init

Create a template declaration file:

aidecl init
aidecl init --format json
aidecl init --output my-project.yaml

The init command auto-detects your project name and git config for sensible defaults.

Exit Codes

Code Meaning
0 All files valid
1 Semantic errors found
2 Schema validation errors
3 File errors (not found, binary, too large)

Output Formats

text (default): Human-readable colored output.

json: Machine-readable output per file:

{
  "file": "aidecl.yaml",
  "passed": true,
  "schema_errors": [],
  "semantic_errors": [],
  "warnings": ["declaration date is in the future: 2099-01-01"]
}

github-actions: Annotation format for CI:

::error file=aidecl.yaml::used is false but tools are listed
::warning file=aidecl.yaml::declaration date is in the future

Validation Rules

Schema checks

Validates structure against JSON Schema Draft 2020-12: required fields, types, enum values, string formats, conditional requirements (e.g. summary required when used: true).

Semantic checks

# Level Rule
1 warn AI usage declared but no tools listed
2 error used: false but tools present
3 error used: false but level is not none
4 warn code_proportion percentages don't sum to ~100
5 warn Declaration date is in the future
6 warn Review date is after declaration date
7 warn Security review performed but no review type
8 warn Personal data sent without DPA
9 warn Level is extensive but no proportion data
10 warn Component references tool not in tools list
11 warn Schema version newer than supported
12 error Tool period end before start
13 warn Tool trains on data but no data handling section
14 warn Next review date is in the past

Integration

GitHub Actions

- name: Validate AI Declaration Format
  run: |
    pip install aidecl
    aidecl validate --output-format github-actions aidecl.yaml

Pre-commit framework

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/ai-declaration/cli
    rev: v0.1.0
    hooks:
      - id: aidecl

Git pre-commit hook

#!/bin/sh
aidecl validate aidecl.yaml --quiet
Standard Relationship
codemeta.json Project metadata; aidecl adds AI transparency
CITATION.cff Citation metadata; complementary
SPDX 3.0 AI Profile License + AI BOM; aidecl is lighter for declarations
CycloneDX ML-BOM ML component inventory; different scope
C2PA Content authenticity; media-focused
W3C PROV Provenance ontology; aidecl JSON-LD maps to PROV-O
  • schema: schema definition and examples
  • web: web-based generator and validator

Shell Completions

Bash:

eval "$(register-python-argcomplete aidecl)"

Or add to your .bashrc for persistent completions.

Fish and Zsh: use argcomplete or generate completions manually from the --help output.

Privacy Note

The declared_by field identifies who made the declaration. For public repositories, consider using team names or roles instead of individual names.

Compatibility

aidecl version Supported schema versions
0.1.x 1.0.0

Development

pip install -e ".[dev]"
pytest
pytest --cov

License

Apache-2.0. The bundled schema.json is from schema (CC BY-SA 4.0).

Metadata

Release files for aidecl 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aidecl 0.3.0
File Size Uploaded Provenance
aidecl-0.3.0.tar.gz 21.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aidecl 0.3.0
File Interpreter ABI Platform
aidecl-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.6 kB

Release files / aidecl-0.3.0.tar.gz

Download URL aidecl-0.3.0.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c2e89fb81fc7b323060c75672d391fa2177aa47c74adb4cf0486f73618120f89
BLAKE2b-256 checksum
How to use checksums
9e1c4fa6cbaeb139ab0cf4ed00cf687290e51ad584998d09ab2b5abd02c73962
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Release files / aidecl-0.3.0-py3-none-any.whl

Download URL aidecl-0.3.0-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d4bd9a7954e5157041b8ca4270650156cdbe6b4240cda58a20d0376d0b86cea
BLAKE2b-256 checksum
How to use checksums
16ac74669f283860994579908324ee7286d05407cd130823f2822cce0e8aecf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 23, 2026.

Transparency log

Security for aidecl 0.3.0

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.

Select from 2 files

Attestation for aidecl-0.3.0.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 Sep 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page