[ADD] oe: provides sane (unfucked) command-line interface.
[odoo/odoo.git] / doc / openerp-command.rst
1 .. _openerp-command:
2
3 OpenERP Command
4 ===============
5
6 The ``oe`` script provides a set of command-line tools around the OpenERP
7 framework.
8
9 Using OpenERP Command
10 ---------------------
11
12 In contrast to the previous ``openerp-server`` script, ``oe`` defines a few
13 sub-commands, each with its own set of flags and options. You can get some
14 information for any of them with
15
16 ::
17
18   > oe <sub-command> --help
19
20 For instance::
21
22   > oe run-tests --help
23
24 Some ``oe`` options can be provided via environment variables. For instance::
25
26   > export OPENERP_DATABASE=trunk
27   > export OPENERP_HOST=127.0.0.1
28   > export OPENERP_PORT=8069
29
30 Depending on your needs, you can group all of the above in one single script;
31 for instance here is a, say, ``test-trunk-view-validation.sh`` file::
32
33   COMMAND_REPO=/home/thu/repos/command/trunk/
34   SERVER_REPO=/home/thu/repos/server/trunk
35
36   export PYTHONPATH=$SERVER_REPO:$COMMAND_REPO
37   export PATH=$SERVER_REPO:$COMMAND_REPO:$PATH
38   export OPENERP_DATABASE=trunk
39   export OPENERP_HOST=127.0.0.1
40   export OPENERP_PORT=8069
41
42   # The -d ignored is actually needed by `oe` even though `test_view_validation`
43   # itself does not need it.
44   oe run-tests -d ignored -m openerp.test_view_validation
45
46 Adding new commands
47 -------------------
48
49 See the :doc:`adding-command` page.
50
51 Bash completion
52 ---------------
53
54 A preliminary ``oe-bash-completion`` file is provided. After sourcing it,
55
56 ::
57
58   > . oe-bash-completion
59
60 completion (using the TAB character) in Bash should be working.