e0713410981c1d6d0ce86072203447a3dc6a1ff3
[odoo/odoo.git] / doc / reference / cmdline.rst
1 .. _reference/cmdline:
2
3 ===============================
4 Command-line interface: odoo.py
5 ===============================
6
7 .. _reference/cmdline/server:
8
9 Running the server
10 ==================
11
12 .. program:: odoo.py
13
14 .. option:: -d <database>, --database=<database>
15
16     database used when installing or updating modules.
17
18 .. option:: --db-filter=<filter>
19
20     hides databases that do not match ``<filter>``. The filter is a
21     `regular expression`_, with the additions that:
22
23     - ``%h`` is replaced by the whole hostname the request is made on.
24     - ``%d`` is replaced by the subdomain the request is made on, with the
25       exception of ``www`` (so domain ``odoo.com`` and ``www.odoo.com`` both
26       match the database ``odoo``)
27
28 .. option:: -i <modules>, --init=<modules>
29
30     comma-separated list of modules to install before running the server
31     (requires :option:`-d`).
32
33 .. option:: -u <modules>, --update=<modules>
34
35     comma-separated list of modules to update before running the server
36     (requires :option:`-d`).
37
38 .. option:: --addons-path=<directories>
39
40     comma-separated list of directories in which modules are stored. These
41     directories are scanned for modules (nb: when and why?)
42
43 .. option:: -c <config>, --config=<config>
44
45     provide an alternate configuration file
46
47 .. option:: -s, --save
48
49     saves the server configuration to the current configuration file
50     (:file:`{$HOME}/.openerp_serverrc` by default, overridable using
51     :option:`-c`)
52
53 .. option:: --test-enable
54
55     runs tests after installing modules
56
57 .. option:: --debug
58
59     when an unexpected error is raised (not a warning or an access error),
60     automatically starts :mod:`python:pdb` before logging and returning the
61     error
62
63 .. _reference/cmdline/scaffold:
64
65 Scaffolding
66 ===========
67
68 .. program:: odoo.py scaffold
69
70 Scaffolding is the automated creation of a skeleton structure to simplify
71 bootstrapping (of new modules, in the case of Odoo). While not necessary it
72 avoids the tedium of setting up basic structures and looking up what all
73 starting requirements are.
74
75 Scaffolding is available via the :command:`odoo.py scaffold` subcommand.
76
77 .. option:: -t <template>
78
79     a template directory, files are passed through jinja2_ then copied to
80     the ``destination`` directory
81
82 .. option:: name
83
84     the name of the module to create, may munged in various manners to
85     generate programmatic names (e.g. module directory name, model names, …)
86
87 .. option:: destination
88
89     directory in which to create the new module, defaults to the current
90     directory
91
92 .. _reference/cmdline/config:
93
94 Configuration file
95 ==================
96
97 Most of the command-line options can also be specified via a configuration
98 file.
99
100 The default configuration file is :file:`{$HOME}/.openerp_serverrc` which
101 can be overridden using :option:`--config <odoo.py -c>`. Specifying
102 :option:`--save <odoo.py -s>` will save the current configuration state back
103 to that file.
104
105 .. _jinja2: http://jinja.pocoo.org
106 .. _regular expression: https://docs.python.org/2/library/re.html