blob: c79c7f9df1383ac0d3732fa3ae376c87b3ce36a7 (
plain) (
blame)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " vocab="http://ogp.me/ns" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>User Manual | ck - the config keeper</title>
<link href="../assets/css/rst.css" rel="stylesheet" type="text/css">
<link href="../assets/css/code.css" rel="stylesheet" type="text/css">
<link href="../assets/css/dark.css" rel="stylesheet" type="text/css">
<link href="../assets/css/theme.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css">
<meta name="theme-color" content="#5670d4">
<meta name="generator" content="Nikola (getnikola.com)">
<link rel="canonical" href="https://gramanas.github.io/ck/manual/">
<!--[if lt IE 9]><script src="../assets/js/html5.js"></script><![endif]--><meta name="author" content="gramanas">
<meta property="og:site_name" content="ck - the config keeper">
<meta property="og:title" content="User Manual">
<meta property="og:url" content="https://gramanas.github.io/ck/manual/">
<meta property="og:description" content="Disclaimer: this is WIP
ck's goal is to assist with the config file management.
To that end it tries to provides a cli interface that is pretty straight-forward
and intuitive.
Example usage:
# ">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2018-05-03T03:01:35+03:00">
</head>
<body class="hack dark">
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
<div id="container">
<header id="header"><h1 id="brand"><a href="https://gramanas.github.io/ck/" title="ck - the config keeper" rel="home">
<span id="blog-title">ck - the config keeper</span>
</a></h1>
<nav id="menu"><ul>
<li class="active"><a href=".">user manual<span class="sr-only"> (active)</span></a></li>
<li><a href="../ck-mode/">ck-mode</a></li>
</ul></nav></header><main id="content"><article class="post-text storypage" itemscope="itemscope" itemtype="http://schema.org/Article"><header><h1 class="p-name entry-title" itemprop="headline name"><a href="." class="u-url">User Manual</a></h1>
</header><div class="e-content entry-content" itemprop="articleBody text">
<p>
Disclaimer: this is WIP
</p>
<p>
ck's goal is to assist with the config file management.
To that end it tries to provides a cli interface that is pretty straight-forward
and intuitive.
</p>
<p>
Example usage:
</p>
<div class="highlight"><pre><span></span><span class="c1"># initialize new ck</span>
$ ck init /path_to/where_you_want/your_configs/to_be <span class="se">\</span>
/path_to/the_secret/directory
<span class="c1"># add emacs configs</span>
<span class="c1">## primary config</span>
$ ck add emacs ~/.emacs.d/orgconf.org -p
<span class="c1">## secret config, with passwords and naughty words</span>
$ ck add emacs ~/.emacs.d/accounts.org -s
<span class="c1">## and another one for emacs</span>
$ ck add emacs ~/.emacs.d/init.el
<span class="c1"># add tmux config</span>
$ ck add tmux ~/.tmux.conf -p
</pre></div>
<p>
The first command after typing <b>ck</b> is the action you wish to perform. Actions are
a very important concept of ck. With an action you can initialize <b>ck</b>, add/move/delete
configuration files to it, edit them, list them in various ways and search in their content.
</p>
<p>
Actions expect their arguments in the order specified below. This is done to reduce the amount
of flags one has to pass to ck.
</p>
<p>
Not all of the above are implemented yet.
</p>
<p>
Below I document everything that is available.
</p>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">ck configuration</h2>
<div class="outline-text-2" id="text-1">
<p>
ck uses sqlite to index the configuration files. The init
action creates a <b>.ck</b> directory (by default under $HOME)
in witch the <b>ckrc</b> and the <b>ckdb</b> reside. The first one contains
the two directories described above while the other one is the
sqlite db.
</p>
<p>
One can have multiple <b>.ck</b> directories with different configurations
each.
</p>
<p>
Using the special keyword <b>config</b> (or <b>conf</b> or <b>c</b> or <b>-c</b>) you can set the path
in which ck will search for the <b>.ck</b> directory.
</p>
<p>
You can prefix every action below with this and ck will use the <b>.ck</b>
directory of your choice.
</p>
<p>
Usage:
</p>
<div class="highlight"><pre><span></span>$ ck config ~/ ... <span class="c1"># the default behaviour</span>
<span class="c1"># /someplace/else/.ck must exist or</span>
<span class="c1"># the action following it must be init</span>
$ ck conf /someplace/else ...
<span class="c1"># same thing</span>
$ ck c /someplace/else ...
$ ck -c /someplace/else ...
</pre></div>
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">Actions</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-sec-2-1" class="outline-3">
<h3 id="sec-2-1">init</h3>
<div class="outline-text-3" id="text-2-1">
<p>
or i or -i
</p>
<p>
init takes up to exactly 2 arguments.
</p>
<ul class="org-ul">
<li>
<b>config_dir</b>: where all the configs will live
</li>
<li>
<b>secret_dir</b>: where all the secret configs will live
</li>
</ul>
<p>
Use init once to initialize a new ck instance.
</p>
<p>
Usage:
</p>
<div class="highlight"><pre><span></span><span class="c1"># initialize new ck</span>
$ ck init /path_to/where_you_want/your_configs/to_be <span class="se">\</span>
/path_to/the_secret/directory
</pre></div>
</div>
</div>
<div id="outline-container-sec-2-2" class="outline-3">
<h3 id="sec-2-2">add</h3>
<div class="outline-text-3" id="text-2-2">
<p>
or a or -a
</p>
<p>
add takes 2 to 4 arguments.
</p>
<ul class="org-ul">
<li>
<b>program_name</b>: the name of the program you add a config to
</li>
<li>
<b>config_path</b>: the path to the config
</li>
<li>Optional (order doesn't matter):
<ul class="org-ul">
<li>
<b>-p</b>: the config will be the primary (relevant on edit below)
</li>
<li>
<b>-s</b>: the config will be stored in the secret_dir
</li>
</ul>
</li>
</ul>
<p>
Use add to add a new config for ck to keep track of.
</p>
<p>
Keep in mind:
</p>
<ul class="org-ul">
<li>The config has to exist
</li>
<li>If you are adding a config to an existing program be sure to use the same name
</li>
<li>Each program can have only one primary config
</li>
</ul>
<p>
Usage:
</p>
<div class="highlight"><pre><span></span><span class="c1"># add config to ck</span>
$ ck add program_name config_path <span class="o">[</span>-s<span class="o">]</span> <span class="o">[</span>-p<span class="o">]</span>
</pre></div>
</div>
</div>
<div id="outline-container-sec-2-3" class="outline-3">
<h3 id="sec-2-3">edit</h3>
<div class="outline-text-3" id="text-2-3">
<p>
or e or -e
</p>
<p>
Currently edit can only edit the primary config of a program.
</p>
<p>
To do it use:
</p>
<div class="highlight"><pre><span></span>$ ck edit program_name
</pre></div>
</div>
</div>
</div>
</div>
</article></main><footer id="footer"><p>Contents © 2018 <a href="mailto:anastasis.gramm2@gmail.com">gramanas</a> - Powered by <a href="https://getnikola.com" rel="nofollow">Nikola</a> </p>
</footer>
</div>
</body>
</html>
|