Skip to main content

cikit

pybuild python ai assisted ruff pylint unittests systemtests coverage

cikit is a lightweight Python toolkit for implementing local development and CI workflows with reusable Python building blocks instead of large shell scripts or provider-specific pipeline logic.

It combines a CI command framework with CI environment abstraction, reusable macros, run data, artifact management, reports, timeline charts, and Sphinx integration.

Documentation · Repository

Highlights

Category Features
CI Framework Built-in and custom commands, installed command packages, lazy loading
CI Providers Local Git, GitLab, Azure DevOps
Builds CMake, CTest, PlatformIO, Python package builds and publishing, Tectonic
Code Quality Ruff, Pylint, clang-tidy/cloc, pytest, Python and C/C++ coverage
Documentation Sphinx, Doxygen
Repository Analysis Repomix repository packing, token and file statistics
Data and Artifacts Persistent run data, artifact registry, bundles, historical metrics
Reporting Badges, RST reports, interactive SVG timelines and Sphinx extensions

Installation

cikit requires Python 3.12 or newer.

pip install cikit

For projects using uv, add cikit as a development dependency:

uv add --dev cikit

Tool-specific dependencies must be provided by the project or CI environment. cikit does not install external tools automatically.

By default, cikit uses uv run as the execution prefix for tools configured to use it. When working without uv, set EXEC_TOOL to an empty string, for example in a POSIX shell:

export EXEC_TOOL=""

Quick Start

For a Python project with a pyproject.toml, source files under src/, and tests under tests/, a basic CI workflow looks like this:

uv add --dev cikit ruff pytest

uv run cikit init
uv run cikit ruff src tests
uv run cikit pytest tests

init removes the configured public output directory, including previously generated artifacts and cached run data. Subsequent commands can share their results within the same workflow.

List the available commands or inspect command-specific options with:

uv run cikit --help
uv run cikit ruff --help

When using pip without uv, invoke cikit directly. See the Getting Started guide for a complete introduction.

CI Command Framework

The cikit console command discovers three sources of commands, with increasing precedence:

Built-in commands < Installed command packages < Project-local commands

Installed command packages use the cikit.commands entry-point group. Project-local commands can be added in a root-level ci_commands package. Only the selected command implementation is loaded, keeping unrelated tool dependencies optional.

For example, add an empty ci_commands/__init__.py and the following ci_commands/check.py:

from cikit.ci import run_ci_script


def command(args):
    return run_ci_script("check", lambda env, status: print(env["PROJECT_ROOT"]), args=args)


def register(subparsers, name):
    parser = subparsers.add_parser(name, help="Show the project root.")
    parser.set_defaults(func=command)

The command is then available through the normal CLI:

uv run cikit check
uv run cikit --name custom-check check

The logical run name identifies run data and artifact metadata. The --name and --verbose options precede the command name. For command registration, discovery, overrides and orchestration, see the CI Commands guide.

Environment and Providers

cikit.env resolves configuration and provides a common environment API for commands and macros. The active provider is detected automatically. Local Git, GitLab and Azure DevOps supply pipeline and revision metadata through the same interface.

The Environment concept explains configuration and the CI lifecycle. The CI Provider Integration guides cover provider-specific setup and artifact handling.

Project Metadata

cikit combines project metadata from pyproject.toml with CI and Git information. Both static versions and optional PEP 517 dynamic version resolution are supported, as well as configurable version parsing and metadata templates.

See Project Metadata for configuration and dependency requirements.

Macros and Build Workflows

The cikit.macros package provides reusable Python building blocks for tool integration, metrics, artifacts and reports. Built-in and project-specific commands can use the same macros.

Examples of independent built-in workflows for projects with the corresponding tools and configuration:

cikit cbuild
cikit ctest
cikit platformio
cikit pybuild
cikit doxygen
cikit repomix
cikit sphinx

Build reports combine available build and compiler metadata, timings, diagnostics, memory usage, downloadable artifacts and logs. Python distributions can be published separately with pypublish.

Explore the Built-in CI Commands, Macros and Builds guides for tool requirements, command options and Python API examples.

Data and Artifacts

CiRunEnvironment associates metrics and registered artifacts with a logical run. Run data is stored locally and can optionally be synchronized with a remote cikit data service:

env.data_set("build_time", 4.2)
env.data_update({"warnings": 0, "errors": 0})

Registered artifacts include files, bundles and folders with optional entry points. The persistent artifact registry enables subsequent commands to discover generated outputs without hard-coded physical paths. Separate CI jobs must transfer the required artifacts and registry explicitly.

See cikit Data for the data model and Artifacts for the artifact API.

Timeline Charts

Historical run data can be queried from the optional remote data service and rendered as configurable SVG charts. In an active run environment with remote access configured:

from cikit.macros import chart_timeline

chart = chart_timeline(env, keys=["build_time"], title="Build duration", limit=20)
chart.create(env, "build-duration")

Registered timeline charts can be included in generated reports. See Timeline Charts for chart presets, configuration and standalone rendering.

Sphinx Integration

The Sphinx macro prepares registered reports, badges and other artifacts for a documentation build and registers the resulting HTML folder as an artifact.

The bundled extensions provide the following RST interfaces:

RST interface Purpose
.. cikit-chart:: Interactive SVG timeline charts
:cikit-hash: Compact and copyable hash values
.. cikit-log:: Collapsible command logs
:cikit-metric: Inline values from local run data

Enable all four extensions in the Sphinx configuration:

extensions = ["cikit.sphinx_ext"]

See the Sphinx Build and Sphinx Extensions guides for setup and usage examples.

Console Entry Points

Command Purpose
cikit Discover and execute CI commands
cikit-data Access cikit data operations
cikit-env Inspect, export, document and prepare the CI environment

Use --help on each command for available options.

License

GNU Lesser General Public License, version 3 or later (LGPL-3.0-or-later).

See the GNU LGPLv3 license text.

Metadata

Release files for cikit 0.4.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 cikit 0.4.0
File Size Uploaded Provenance Actions
cikit-0.4.0.tar.gz 137.6 kB Without provenance Details for cikit-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 324.8 kB

Release files / cikit-0.4.0.tar.gz

Download URL cikit-0.4.0.tar.gz
Size 137.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6a83f89c5044e3257b99366aac63e588c0339f38a4a65899d911f2bc7f3ea868
BLAKE2b-256 checksum
How to use checksums
1ad8aa8a53e0e2bea849b144bd979ff76784badebc05db5e0bd1143fd5be49d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Release files / cikit-0.4.0-py3-none-any.whl

Download URL cikit-0.4.0-py3-none-any.whl
Size 187.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73fe2e201d06bea056ae16c508229a6ae5ccbfceb4ef7f0055683eb79b830ee4
BLAKE2b-256 checksum
How to use checksums
8b69b07a549194f15645185e05c89889e4379913a5e43efc731ed6971b46bc68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Security for cikit 0.4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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