Skip to content

Miscellaneous

Miscellaneous project utilities.

Modules:

Name Description
build_global

oops misc build-kb — build the global Odoo KB (once per version).

create_workspace

Generate a VSCode workspace file for the current Odoo project.

edit_config

Open an oops configuration file in the default editor.

new_project

Create a new GitHub repository from a template and clone it locally.

usage

Show oops command usage counters from the local stats file.

view_doc

Open the oops documentation in the default browser.


oops misc create-workspace

Generate a VSCode workspace file for the current Odoo project.

Reads the Odoo version from odoo_version.txt at the repository root, falling back to manifest.odoo_version in config, then writes a .code-workspace file at the repository root configured with Python analysis paths pointing to the local Odoo sources.

The sources directory is read from odoo.sources_dir in ~/.oops.yaml.

Usage:

oops misc create-workspace [OPTIONS]

Options:

Name Type Description Default
--output file Workspace file path. Defaults to .code-workspace at repo root. None
--without-download boolean Don't download Odoo sources if missing. False
--include-sources boolean Include the Odoo sources as folders in the workspace. False
--help boolean Show this message and exit. False

Examples:

Generate a workspace file for the current project:

oops misc create-workspace

Write the workspace file to a specific path:

oops misc create-workspace --output /tmp/review.code-workspace

Include the Odoo sources as folders in the workspace (useful for navigation and go-to-definition):

oops misc create-workspace --include-sources

Example output file (my-project.code-workspace):

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "python.analysis.extraPaths": [
            "~/odoo-sources/17.0/community",
            "~/odoo-sources/17.0/enterprise"
        ],
        "python.autoComplete.extraPaths": [
            "~/odoo-sources/17.0/community",
            "~/odoo-sources/17.0/enterprise"
        ]
    }
}

With --include-sources, the Odoo source directories are added as workspace folders:

{
    "folders": [
        {"path": "."},
        {"path": "~/odoo-sources/17.0/community"},
        {"path": "~/odoo-sources/17.0/enterprise"}
    ],
    "settings": { "..." }
}

oops misc edit-config

Open an oops configuration file in the default editor.

Opens ~/.oops.yaml (global) by default, or .oops.yaml in the current directory (local) when --local is passed. Creates the file with a starter template if it does not exist yet.

Usage:

oops misc edit-config [OPTIONS]

Options:

Name Type Description Default
--local text Edit the local config (.oops.yaml in the current directory) False
--global text Edit the global config (~/.oops.yaml) [default] True
--help boolean Show this message and exit. False

Examples:

Open the global config in the default editor:

oops misc edit-config

Open the local project config instead:

oops misc edit-config --local

oops misc new-project

Create a new GitHub repository from a template and clone it locally.

Prompts for a project name, slugifies it, asks for confirmation, then delegates to the gh CLI to create the repository and optionally trigger a workflow_dispatch event on a separate "action repository".

Reads default template, owner, visibility, and action settings from github in ~/.oops.yaml. All values can be overridden with CLI options.

Requires gh to be authenticated (run 'gh auth login' if needed).

Usage:

oops misc new-project [OPTIONS]

Options:

Name Type Description Default
--no-clone boolean Create the repo but do not clone it False
--help boolean Show this message and exit. False

Experimental

This command requires gh to be authenticated (gh auth login) and a github section in ~/.oops.yaml. Behaviour may change in future releases.

Configuration (~/.oops.yaml):

github:
  template: "apikcloud/odoo-repository-template"
  owner: "apikcloud"
  visibility: "private"
  prefix: "odoo"
  team: "developers"
  action_repo: "apikcloud/workflows"
  action_workflow: "update.yml"
  action_inputs:
    branch: "main"
    update: false

Examples:

Create a new project (prompts for name, slugifies, confirms):

oops misc new-project

Create without cloning locally:

oops misc new-project --no-clone

oops misc usage

Show oops command usage counters from the local stats file.

Reads ~/.local/share/oops/stats.jsonl and prints a table of invocation counts per command, sorted from most to least used.

Usage:

oops misc usage [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Examples:

Show per-command invocation counts:

oops misc usage

oops misc view-doc

Open the oops documentation in the default browser.

Usage:

oops misc view-doc [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

oops misc build-kb

oops misc build-kb — build the global Odoo KB (once per version).

EXPERIMENTAL — This command is part of the KB pipeline. Its interface may change without notice between releases.

Scans Odoo community (addons/ + odoo/addons/) and enterprise sources from the standard oops source directories (config.odoo.sources_dir//), and produces a SQLite database stored at:

<cache_dir>/<version>.db

where defaults to ~/.cache/oops/kb/.

The global KB is version-specific and shared across all projects on the same Odoo version — it should never be stored inside a project repository. Run this once per Odoo version. The resulting database is shared across all projects on the same version.

Usage:

oops misc build-kb [OPTIONS]

Options:

Name Type Description Default
--version text Odoo version string (e.g. 17.0). Defaults to the version declared in the current project's odoo_version.txt. None
--cache-dir directory Directory where .db is written. Defaults to ~/.cache/oops/kb/. None
--verbose, -v boolean N/A False
--help boolean Show this message and exit. False

Experimental

This command is part of the KB pipeline. Its interface may change without notice between releases. The same warning is printed at runtime.

Examples:

Build the global KB for the current project's Odoo version (auto-detected from odoo_version.txt):

oops misc build-kb

Build for a specific Odoo version:

oops misc build-kb --version 18.0

Write the database to a custom cache directory (default is ~/.cache/oops/kb/):

oops misc build-kb --version 17.0 --cache-dir /tmp/kb

Show the addons roots being scanned in detail:

oops misc build-kb --verbose