5 2. How to use
M Mahrous edited this page 2026-06-30 17:36:06 +02:00

OdooLS is a language server. You can use it in your IDE/Editor for real-time feedback, or as a CLI tool to lint your project in one shot.

Use OdooLS in your IDE/Editor

OdooLS implements the LSP protocol, so it can plug into any IDE or Editor that supports it.

We already have integrations for these editors:

Want support for another IDE/Editor? Open an issue to suggest it, or try building your own by following the custom integration guide.

Set up your extension

Check the wiki for your IDE or Editor:

Use OdooLS as a CLI

Even though OdooLS is designed for real-time use in your editor, you can also run it as a one-shot linter to get diagnostics on your codebase.

Setup

You need the executable (odoo_ls_server or odoo_ls_server.exe).

Place the typeshed directory next to it. If you built from source, it's already at server/typeshed. Otherwise, clone typeshed and place it next to your executable.

Usage

Run the server in one-shot mode with:

./odoo_ls_server --parse

The server will load your project and write all diagnostics to a JSON file.

You can provide project information via CLI flags, via an odools.toml config file, or a mix of both.

Option 1: Pass everything via CLI flags

You can pass all project information directly on the command line:

Flag Description
-c, --community-path /path/to/odoo Path to your Odoo community folder
-a, --addons /path/to/addons Additional addons folders (repeatable). Point to the folder containing your modules, just like you would with the odoo command line. In CLI mode, <odoo_path>/addons is not added automatically — you must include it explicitly if needed (e.g. -a /path/to/odoo/addons). This is handled automatically in IDE/Editor extensions.
-o, --output output.json Output file name (defaults to output.json)
-t, --tracked-folders /path Required. The directories you want diagnostics for. Only files under these paths will be analyzed. These also act as workspace folders for the session (needed to resolve ${workspaceFolder:N} variables in config files).
-s, --stubs /path/to/stubs Additional stubs directories (repeatable)
--stdlib /path/to/stdlib Alternative path to stdlib stubs
--no-typeshed-stubs Skip the bundled Typeshed third-party package stubs only. Stubs you provide yourself (via -s/--stubs) are still loaded, and stdlib stubs are always kept (they're required). Without the bundled stubs, types are read from the installed packages instead. Not recommended.
--python /path/to/python Python executable to use

Example:

./odoo_ls_server --parse \
  -c /data/sources/odoo \
  -a /data/sources/odoo/addons \
  -a /data/sources/enterprise \
  -a /data/build/design-themes \
  -o /data/output/odoo_lint.json \
  -s /data/build/typeshed/stubs \
  -s /data/sources/odoo-ls/server/additional_stubs \
  --tracked-folders /data/sources/enterprise \
  --stdlib /data/build/typeshed/stdlib

Option 2: Use an odools.toml config file

Instead of passing everything on the command line, you can put your project settings in an odools.toml file — the same format used by the IDE/Editor extensions. This is handy if you already have one set up, or if you want a reusable config.

Flag Description
--config-path /path/to/odools.toml Path to a config file. If not provided, OdooLS looks for one in the tracked folders.
--selected-config profile_name Which profile to use from the config file. Defaults to default.

The config file can define things like odoo_path, addons_paths, python_path, and more — see the configuration files page for all available options.

Note: --tracked-folders is always required in CLI mode — it tells OdooLS which directories to analyze. If your config file uses ${workspaceFolder:N} template variables, tracked folders are also what those variables resolve to.

Example:

Given this odools.toml:

[[config]]
name = "default"
odoo_path = "/data/sources/odoo"
addons_paths = ["/data/sources/odoo/addons", "/data/sources/enterprise", "/data/build/design-themes"]
python_path = "/usr/bin/python3"

You can run:

./odoo_ls_server --parse \
  --config-path /path/to/odools.toml \
  --tracked-folders /data/sources/enterprise \
  -o /data/output/odoo_lint.json

Mixing both

You can combine a config file with CLI flags. CLI flags extend or override the config file values:

  • -c, --python, --stdliboverride the config file value
  • -a, -sadd to the config file's lists (addons and stubs are merged)
  • --no-typeshed-stubsoverrides if set on the CLI (logical OR)

This is useful when you have a base config but want to tweak it for a specific run. For example, to add an extra addons folder on top of what's in your config:

./odoo_ls_server --parse \
  --config-path /path/to/odools.toml \
  -a /data/sources/extra-modules \
  --tracked-folders /data/sources/enterprise \
  -o output.json

Run ./odoo_ls_server --help for the full list of options.