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.
pip install aideclFor development:
git clone https://github.com/ai-declaration/cli.git
cd cli
pip install -e ".[dev]"# Create a new declaration file
aidecl init --format yaml
# Edit aidecl.yaml with your project details
# Validate it
aidecl validate aidecl.yamlCheck 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 outputSample 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 between YAML and JSON:
aidecl convert aidecl.yaml -f json
aidecl convert aidecl.json -f yaml -o output.yamlCreate a template declaration file:
aidecl init
aidecl init --format json
aidecl init --output my-project.yamlThe init command auto-detects your project name and git config for sensible defaults.
| Code | Meaning |
|---|---|
| 0 | All files valid |
| 1 | Semantic errors found |
| 2 | Schema validation errors |
| 3 | File errors (not found, binary, too large) |
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
Validates structure against JSON Schema Draft 2020-12: required fields, types, enum values, string formats, conditional requirements (e.g. summary required when used: true).
| # | 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 |
- name: Validate AI Declaration Format
run: |
pip install aidecl
aidecl validate --output-format github-actions aidecl.yamlAdd to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/ai-declaration/cli
rev: v0.1.0
hooks:
- id: aidecl#!/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 |
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.
The declared_by field identifies who made the declaration. For public repositories, consider using team names or roles instead of individual names.
| aidecl version | Supported schema versions |
|---|---|
| 0.1.x | 1.0.0 |
pip install -e ".[dev]"
pytest
pytest --covApache-2.0. The bundled schema.json is from schema (CC BY-SA 4.0).