Omni CLI

website·Indexed 31 days ago

https://omnicli.dev

A tool for managing development environments, dependencies, and custom commands. Omni supports automated tool installation via mise, nix, and various package managers (apt, dnf), handles repository-specific configurations, and allows the definition of custom commands through Makefiles or executable paths with integrated argument parsing and autocompletion.

Tokens
42.3K
Snippets
208
Records
294
Agent score
60%

What's inside Omni

  1. Overview of Omnipotent (omni) CLI wrapper

    Omnipotent (omni) is a tool designed to wrap sets of commands and provide a consistent interface for interacting with them. It allows developers to make commands available within a git repository and execute them from anywhere in the system by adding omni to the system path, regardless of the current working directory. Key features include dynamic environment loading and discoverability of up-to-date commands.
  2. Overview of Omni command-line tool

    Omni is a tool designed to standardize and simplify the developer experience by wrapping sets of commands and providing a consistent interface to interact with them. It addresses common pain points such as incompatible dependencies, disparate toolsets, and poor command discoverability in growing organizations. Key capabilities include:

    • Simplifying dependency definitions and enabling single-command repository setups.
    • Automating global command updates.
    • Providing a centralized entry point via a single repository to streamline onboarding.
    • Dynamically loading environments to reduce manual setup time when switching between repositories.
  3. Omni CLI built-in command precedence and behavior

    Omni provides a set of built-in commands that are available wherever omni can be called and execute from the current working directory. Built-in commands take precedence over custom commands, makefile commands, and configuration commands; they cannot be overridden. However, users can still define 'subcommands' that will be executed when the specific built-in command is called.
  4. Validate configuration and command metadata using `omni config check`

    The omni config check command validates configuration files and commands within the omnipath for errors. It is used for debugging, ensuring configuration correctness, and linting omni command metadata.
  5. Understand the execution environment for OMNI custom commands

    Configuration commands in OMNI are executed from the directory where the configuration file defining them is located. This ensures that relative paths used within the command remain valid regardless of where the user invokes the CLI.

    Commands are scoped based on where they are defined:

    • Repository-scoped: Defined in the repository's omni configuration.
    • Global: Defined in a global configuration file and available everywhere.
    • To access a repository-scoped command from elsewhere, use the omni scope command.
  6. Manage Homebrew installations with Omni

    Use the homebrew (or brew) step to tap Homebrew repositories and install formulae or casks. Omni tracks the repositories and packages it installs; when running omni down, any dependencies installed by Omni that are no longer required by active omni up repositories are automatically uninstalled. If brew is not available on the system, this step is ignored.
  7. Understand and use omni shims for IDE integration

    Omni provides shims (fake binaries) to manage tool versions for IDEs that do not load the full shell environment before running tools. Shims resolve to the expected version of a tool based on the current working directory. By default, omni loads shims but removes them from the path in interactive shells to favor direct path entries. The shims are typically located in ~/.local/share/omni/shims, but this follows OMNI_DATA_HOME or XDG_DATA_HOME if set.
  8. Install tools from GitHub releases using omni

    Omni can install tools from GitHub releases by downloading assets that match the current operating system and architecture. For a release to be compatible, assets must meet the following criteria:

    • Be provided as a .tar.gz archive, a .zip archive, or a binary file (no extension).
    • The filename must contain hints about the target OS (e.g., linux, darwin).
    • The filename must contain hints about the target architecture (e.g., amd64, arm64).

    Omni downloads matching assets, verifies checksums, extracts them, and moves binary files to the repository environment. On ARM Macs (M1, M2, etc.) with Rosetta installed, Omni will fallback to downloading amd64 assets if arm64 versions are unavailable.

  9. Custom operation parameters reference

    The following parameters are available for custom operation steps:

    • name (string): The display name of the step shown during omni up or omni down.
    • meet (multiline string): The command executed to satisfy the requirement during setup.
    • met? (multiline string): The command executed to determine if the requirement is currently met (prevents meet from running if this returns success).
    • unmeet (multiline string): The command executed to reverse the requirement during teardown.
    • dir (path): The relative path to the directory where the operation should run. The dynamic environment of this directory is loaded before execution. Defaults to the work directory root.
  10. Manage Python dependencies with the pip parameter

    The pip parameter controls how dependencies are installed using uv.

    • true or auto (default): Omni automatically installs dependencies from recognized requirement files in the specified directories.
    • false: Disables dependency installation.
    • path (string or list): Specifies relative paths to specific requirements files to be used with pip install -r.

    When pip: auto is used, Omni detects files in this priority order: poetry.lock, Pipfile.lock, pyproject.toml, requirements.txt, and Pipfile.

    up:
      - python:
          version: 3.11.4
          pip: auto # Auto-detects requirements files
          # OR
          pip: req.txt # Installs specific file
  11. Integrate omni with JetBrains IDEs

    JetBrains IDEs (IntelliJ, PyCharm, WebStorm, GoLand, RubyMine, RustRover) support asdf integration. Since omni uses a compatible backend, you can symlink omni's mise directory to the .asdf directory in your home folder. After symlinking, select the desired asdf SDK version in Project Settings > Project > SDK (or under Languages & Frameworks for specific tools like Node.js).
    ln -s ~/.local/share/omni/mise ~/.asdf