summaryrefslogtreecommitdiff
path: root/docs/getting_started_command_line.rst
blob: 2c79701ba8ba64898aef5962b9085c7f7473b52e (plain)
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
Getting Started (Command Line)
==============================

lesana can be used from the command line through the ``lesana`` command;
for more details run ``lesana help``.

Many commands will try to open some file in an editor: they will attempt
to use, in this order, ``$EDITOR``, ``sensible-editor`` or as a fallback
``vi``, which should be installed on any POSIX-like system.

To start a new collection, create a directory and run ``lesana
init`` into it::

    mkdir $DIRECTORY
    cd $DIRECTORY
    lesana init

It will create the basic file structure of a lesana collection,
including a ``settings.yaml`` skeleton and it will initialize a git
repository (use ``--no-git`` to skip this part and ignore all further
git commands).

It will then open ``settings.yaml`` in an editor: fill in your list of
fields and all other data, save and exit.
You are now ready to commit the configuration for your new collection::

    git commit -m 'Collection settings'

An empty collection is not very interesting: let us start adding new
entries::

   lesana new

It will again open an editor on a skeleton of entry where you can fill
in the values. When you close the editor it will print the entry id,
that you can use e.g. to edit again the same entry::

   lesana edit $ENTRY_ID

After you've added a few entries, you can now search for some word that
you entered in one of the indexed fields::

   lesana search some words

this will also print the entry ids of matching items, so that you can
open them with ``lesana edit``.

If you're using git, don't forget to add and commit the entries you've
added (i.e. the files under ``items``).