CMTools: cme and cmt

R. S. Doiel,

Caltech Library, Digital Library Development

2025-02-11

What is CMTools?

CMTools provides a means of generating and maintain various software artifacts based on the contents of your CodeMeta file.

cme
A proof of concept CodeMeta editor
cmt
A CodeMeta transformer tool

Quick tutorial

You can follow along using Terminal (macOS, Linux) or Powershell (Windows).

Getting prepared

NOTE: requires curl or irm.

Installing CMTools

macOS, Linux

curl -L https://caltechlibrary.github.io/CMTools/installer.sh | sh

Windows

irm https://caltechlibrary.github.io/CMTools/installer.ps1 | iex

After install

In your Terminal or Powershell session skim the docs.

cme --help | more
cmt --help | more

Create a new CMTools driven project

create a directory and change into it

Our project is going to be called “foo”.

mkdir foo
cd foo

Create a “LICENSE” file

Example uses Caltech Library’s software license.

macOS and Linux

curl -L -O https://raw.githubusercontent.com/caltechlibrary/template/refs/heads/main/LICENSE

Windows

irm https://raw.githubusercontent.com/caltechlibrary/template/refs/heads/main/LICENSE -OutFile LICENSE

NOTE: license is required to create “version.ts”.

Create a new codemeta.json file

Use cme.

cme codemeta.json

Follow the prompts. Complex attributes will require YAML notation.

Complex attributes

Some attributes need to be entered as YAML.

Create initial project files

cmt supports an --init option identifying projects by their primary programming language. Currently supported are Python, Go, JavaScript and TypeScript. In our example we’re setting up for a Deno+TypeScript project.

cmt codemeta.json --init typescript

Create initial project files

cmt codemeta.json --init typescript yields the following files.

Updating CodeMeta attributes

version, dateModified, datePublished and releaseNotes

cme codemeta.json version dateModified datePublished releaseNotes

Update a CodeMeta attributes without prompts.

Set version to “1.0.1” and releaseNotes to “Bug fixes”.

cme codemeta.json version=1.0.1 releaseNotes='Bug fixes'

Updating other files

Update the artifacts by explicitly passing their names on the command line.

cmt codemeta.json version.ts CITATION.cff \\
  INSTALL.md installer.sh installer.ps1 about.md

Something to consider

Software lives longer than expected, long lived software requires maintenance.

CMTools helps with maintenance.