-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcme.1.html
More file actions
180 lines (180 loc) · 13 KB
/
Copy pathcme.1.html
File metadata and controls
180 lines (180 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>CMTools</title>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
<link rel="stylesheet" href="https://media.library.caltech.edu/cl-webcomponents/css/code-blocks.css">
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/copyToClipboard.js"></script>
<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/footer-global.js"></script>
</head>
<body>
<header>
<a href="https://library.caltech.edu"><img src="https://media.library.caltech.edu/assets/caltechlibrary-logo.png" alt="Caltech Library logo"></a>
</header>
<a href="#main-content" class="visually-hidden">skip to main content</a>
<nav>
<ul>
<li><a href="/">All Library Apps</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<li><a href="INSTALL.html">INSTALL</a></li>
<li><a href="user_manual.html">User Manual</a></li>
<li><a href="about.html">About</a></li>
<!-- <li><a href="search.html">Search</a></li> -->
<li><a href="https://github.com/caltechlibrary/CMTools">Code Repository</a></li>
</ul>
</nav>
<section id="main-content">
<h1 id="name">NAME</h1>
<p>cme</p>
<h1 id="synopsis">SYNOPSIS</h1>
<p>cme CODEMETA_JSON [OPTION …]</p>
<p>cme CODEMETA_JSON ATTRIBUTE_NAME [ATTRIBUTE_NAME …] [OPTION …]</p>
<p>cme CODEMETA_JSON ATTRIBUTE_NAME=ATTRIBUTE_VALUE
[ATTRIBUTE_NAME=ATTRIBUTE_VALUE …] [OPTION …]</p>
<h1 id="description">DESCRIPTION</h1>
<p>cme is a CodeMeta file editing tool. When called with only the
CODEMETA_JSON filename it will read in the CodeMeta file, report any
errors, extrapolate values if needed. It will then display a pretty
printed normalized version of your CodeMeta file.</p>
<p>cme will also let you modify specific attributes in a CodeMeta file.
It does this by reading the CodeMeta file and prompting you to type in
the value. If you use the editor option it’ll launch your editor use it
to set the value saving changes are saved back to the CodeMeta file.</p>
<p>For attributes like author, contributor, maintainer and keyword
should be typed in using YAML syntax. The YAML will be converted to JSON
and used to update your CodeMeta file.</p>
<p>If you provide one or more attribute names the attributes will be
available to edit in the order you’ve requested them to be edited.</p>
<p>Two date fields are set if they are not previously set, “dateCreated”
and “dateModified”. The “dateModified” is updated each time you change
something in the CodeMeta file unless you explicitly edit it.</p>
<p>For the simple fields like version, name, description, releaseNotes
you can set their values directly on the command line using an equal
sign between the attribute name and the value. If the value includes
spaces you need to wrap them in quotes. See the EXAMPLE below.</p>
<h1 id="option">OPTION</h1>
<dl>
<dt>-h, –help</dt>
<dd>
display help
</dd>
<dt>-v, –version</dt>
<dd>
display version
</dd>
<dt>-l, –license</dt>
<dd>
display license
</dd>
<dt>-e, –editor</dt>
<dd>
use the editor named in the EDITOR environment variable. If variable is
unset then use the default text editor. On Windows that is notepad.exe.
On Linux and macOS it is nano.
</dd>
<dt>-p, –profiles</dt>
<dd>
list the person and organization profiles available in the global
configuration file (<code>~/.cmtoolsrc</code> or the path given by
<code>--global-config</code>).
</dd>
<dt>-P, –person-lists</dt>
<dd>
list the pre-defined person/organization lists available in the global
configuration file.
</dd>
<dt>-A, –apply-license</dt>
<dd>
select a license from the global configuration, write its text to
<code>./LICENSE</code>, and update the <code>license</code> field in the
codemeta.json file with the license URL (if one is configured).
</dd>
<dt>-g, –global-config PATH</dt>
<dd>
load configuration from PATH, bypassing the directory walk-up search.
</dd>
</dl>
<h1 id="global-configuration">GLOBAL CONFIGURATION</h1>
<p>cme reads a configuration file that stores person/organization
profiles, pre-defined team lists, and license templates. When editing
person fields such as author, contributor, or maintainer, cme will offer
to populate the field from a configured profile or list rather than
requiring manual YAML entry. When editing the license field, cme will
offer to apply a configured license and write <code>./LICENSE</code>
automatically.</p>
<p>Configuration is found by walking up from the current directory to
the home directory, checking for <code>.cmtoolsrc</code> at each level
(first found wins), then falling back to
<code>~/.config/cmtools/config.yaml</code>. For example, from
<code>~/WorkLab/myproject</code>:</p>
<ol type="1">
<li><code>~/WorkLab/myproject/.cmtoolsrc</code></li>
<li><code>~/WorkLab/.cmtoolsrc</code></li>
<li><code>~/.cmtoolsrc</code></li>
<li><code>~/.config/cmtools/config.yaml</code></li>
</ol>
<p>This lets you keep a work config in <code>~/WorkLab/.cmtoolsrc</code>
and a personal config in <code>~/.cmtoolsrc</code> and have the right
one apply automatically based on where you are working.</p>
<p>Use <code>--global-config PATH</code> to bypass the walk and load a
specific file instead.</p>
<p>Example <code>~/.cmtoolsrc</code>:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode yaml"><code class="sourceCode yaml"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">default_profile</span><span class="kw">:</span><span class="at"> rdoiel</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="fu">default_license</span><span class="kw">:</span><span class="at"> caltech</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="fu">profiles</span><span class="kw">:</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">rdoiel</span><span class="kw">:</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">type</span><span class="kw">:</span><span class="at"> Person</span></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">givenName</span><span class="kw">:</span><span class="at"> R. S.</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">familyName</span><span class="kw">:</span><span class="at"> Doiel</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">email</span><span class="kw">:</span><span class="at"> rdoiel@caltech.edu</span></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">id</span><span class="kw">:</span><span class="at"> https://orcid.org/0000-0003-0900-6903</span></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">affiliation</span><span class="kw">:</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">type</span><span class="kw">:</span><span class="at"> Organization</span></span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">name</span><span class="kw">:</span><span class="at"> Caltech Library</span></span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">caltech-library</span><span class="kw">:</span></span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">type</span><span class="kw">:</span><span class="at"> Organization</span></span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">name</span><span class="kw">:</span><span class="at"> Caltech Library</span></span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">email</span><span class="kw">:</span><span class="at"> library@caltech.edu</span></span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a><span class="fu">licenses</span><span class="kw">:</span></span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">caltech</span><span class="kw">:</span></span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">name</span><span class="kw">:</span><span class="at"> Caltech License</span></span>
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">file</span><span class="kw">:</span><span class="at"> ~/.config/cmtools/licenses/caltech.txt</span></span>
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">agpl3</span><span class="kw">:</span></span>
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">name</span><span class="kw">:</span><span class="at"> GNU Affero General Public License v3.0 or later</span></span>
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">url</span><span class="kw">:</span><span class="at"> https://spdx.org/licenses/AGPL-3.0-or-later.html</span></span>
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a><span class="fu"> text</span><span class="kw">: </span><span class="ch">|</span></span>
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a> GNU AFFERO GENERAL PUBLIC LICENSE</span>
<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a> Version 3, 19 November 2007</span>
<span id="cb1-29"><a href="#cb1-29" aria-hidden="true" tabindex="-1"></a> ...</span>
<span id="cb1-30"><a href="#cb1-30" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-31"><a href="#cb1-31" aria-hidden="true" tabindex="-1"></a><span class="fu">person_lists</span><span class="kw">:</span></span>
<span id="cb1-32"><a href="#cb1-32" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">dld-team</span><span class="kw">:</span></span>
<span id="cb1-33"><a href="#cb1-33" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="kw">-</span><span class="at"> </span><span class="fu">type</span><span class="kw">:</span><span class="at"> Person</span></span>
<span id="cb1-34"><a href="#cb1-34" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">givenName</span><span class="kw">:</span><span class="at"> R. S.</span></span>
<span id="cb1-35"><a href="#cb1-35" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">familyName</span><span class="kw">:</span><span class="at"> Doiel</span></span>
<span id="cb1-36"><a href="#cb1-36" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">id</span><span class="kw">:</span><span class="at"> https://orcid.org/0000-0003-0900-6903</span></span>
<span id="cb1-37"><a href="#cb1-37" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="kw">-</span><span class="at"> </span><span class="fu">type</span><span class="kw">:</span><span class="at"> Person</span></span>
<span id="cb1-38"><a href="#cb1-38" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">givenName</span><span class="kw">:</span><span class="at"> Tom</span></span>
<span id="cb1-39"><a href="#cb1-39" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">familyName</span><span class="kw">:</span><span class="at"> Morrell</span></span>
<span id="cb1-40"><a href="#cb1-40" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">id</span><span class="kw">:</span><span class="at"> https://orcid.org/0000-0001-9266-5146</span></span></code></pre></div>
<h1 id="examples">EXAMPLES</h1>
<p>Create a new CodeMeta file. If no attribute names are included then
you will be prompt for each attribute.</p>
<pre><code>cme codemeta.json</code></pre>
<p>Set the version number in your codemeta.json file and add/replace the
<code>.releaseNotes</code>.</p>
<pre><code>cme codemeta.json version releaseNotes</code></pre>
<p>Set the version number to “0.0.1” and release notes to “Initial
Concept” without being prompted.</p>
<pre class="shell"><code>cme codemeta.json version=0.0.1 release='Initial Concept'</code></pre>
<p>If Micro Editor is installed you can edit the description in micro
using the “-e” option.</p>
<pre class="shell"><code>cme codemeta.json description -e</code></pre>
</section>
<footer-global></footer-global>
</body>
</html>