Skip to main content

Cassis CLI — run Cassis actions (ontology validation, upload and publish) from your CI pipelines

Project description

Cassis CLI

Run Cassis actions from your CI pipelines:

  • cassis ontology check validates the ontology files in your repository with the exact same checks as the Cassis GitHub PR check (YAML parsing, round-trip, import validation) — so you can gate merges in any CI system, not just GitHub.
  • cassis ontology upload uploads the ontology files to a Cassis project (full replace) and, by default, publishes them immediately as a new version — so a merge to your main branch can go live in one CI step.

Install

pip install cassis-cli

Setup

  1. Create an API key in Cassis under Organization settings → API keys (keys start with sk-k6-).
  2. Store it as a CI secret and expose it as CASSIS_API_KEY.
  3. For upload: find the project ID (UUID) in the project's URL and expose it as CASSIS_PROJECT_ID (or pass --project).

Usage

# From the root of a repository synced with Cassis (contains the ontology export directory, cassis/ by default):
cassis ontology check

# Or point at the checkout explicitly:
cassis ontology check /path/to/checkout

# Upload the ontology to a project and publish it immediately:
cassis ontology upload --project 019f0000-0000-7000-8000-000000000000

# Upload without publishing (the tree becomes the project's unpublished ontology, to review in Cassis):
cassis ontology upload --project ... --no-publish

# Label the published version:
cassis ontology upload --project ... --label "release 1.2"

# Machine-readable output:
cassis ontology check --json
cassis ontology upload --project ... --json

Configuration (flags take precedence over env vars):

Flag Env var Default
--api-key CASSIS_API_KEY — (required)
--api-url CASSIS_API_URL https://app.getcassis.com
--base-path CASSIS_BASE_PATH cassis — must match the project's git-sync "Path" setting
--project (upload only) CASSIS_PROJECT_ID — (required)

Exit codes

Code Meaning
0 Ontology is valid (check) / uploaded (upload)
1 Validation failed (check: findings printed; upload: nothing imported)
2 Usage error (missing API key or project, no ontology directory, unreadable file, tree over the size limits)
3 Transport/API error (unreachable API, invalid key, inaccessible project, unexpected response)

Both commands accept up to 2000 YAML files / 5 MB total — far above real ontologies (a few hundred small files). Beyond that the CLI fails fast with exit 2 before uploading anything; double-check --base-path if you hit it.

upload replaces the project's entire ontology with the uploaded tree. A never-published project always goes live immediately on first upload (even with --no-publish), matching imports from the Cassis app. Publishing is idempotent: re-uploading content identical to the published version reports that version instead of creating a new one, so re-running the CI job on unchanged files is a no-op.

GitHub Actions example

jobs:
  ontology-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install cassis-cli
      - run: cassis ontology check
        env:
          CASSIS_API_KEY: ${{ secrets.CASSIS_API_KEY }}

  ontology-publish:
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install cassis-cli
      - run: cassis ontology upload
        env:
          CASSIS_API_KEY: ${{ secrets.CASSIS_API_KEY }}
          CASSIS_PROJECT_ID: ${{ vars.CASSIS_PROJECT_ID }}

GitLab CI example

ontology-check:
  image: python:3.12-slim
  script:
    - pip install cassis-cli
    - cassis ontology check
  variables:
    CASSIS_API_KEY: $CASSIS_API_KEY

ontology-publish:
  image: python:3.12-slim
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  script:
    - pip install cassis-cli
    - cassis ontology upload
  variables:
    CASSIS_API_KEY: $CASSIS_API_KEY
    CASSIS_PROJECT_ID: $CASSIS_PROJECT_ID

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

cassis_cli-0.2.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

cassis_cli-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file cassis_cli-0.2.0.tar.gz.

File metadata

  • Download URL: cassis_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/25.5.0

File hashes

Hashes for cassis_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5222e5072eb6cfd149a784814a4db8234721fb6b1e586a04c94b6e7899f965f1
MD5 04e6ff98ef5ceb425d9fba791ee671b3
BLAKE2b-256 cd75d05cdc4b9070a86267767aecfc87dac0b6cd1be59b84f06be5938e148f04

See more details on using hashes here.

File details

Details for the file cassis_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cassis_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Darwin/25.5.0

File hashes

Hashes for cassis_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac7b64a6a9acf0d1cb9a150e14ca53cd37055c891561eff4f091aacb33042d38
MD5 7fc10ef4b5439f015a2aecf7c54853e5
BLAKE2b-256 5c9d68ecab85e5e28f5e0eced62f7eb584ae3e77cbf3a4113de7b12173f1a5d2

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