Skip to content

Add bundled binary for CLI using PyInstaller #796

Description

@luka-hash

It would be nice to have a binary file for the CLI tool available for download (in Releases section, next to the archive of the source code) for systems without python installed. I've used pyinstaller in my local fork, and it seems to work just fine for my use case, but 2 things arise:

  1. I think this would require another test harness; and
  2. I think this breaks runtime plugin support.

This might be a dealbreaker, so an alternative to bundling might be to just add instructions to the installation section of the docs. Here's what I've used:

% uv venv
% source .venv/bin/activate.fish
% uv pip install -e . pyinstaller

This creates the environment and installs dependencies. Then create cli.py with the following content:

from sqlite_utils.cli import cli

if __name__ == "__main__":
	cli()

And then bundle and do a quick sanity check:

% pyinstaller --onefile --name sqlite-utils --copy-metadata sqlite-utils cli.py
% cd dist/
% ./sqlite-utils --version
% ./sqlite-utils create-table my.db people id integer name text height float --pk id --strict

Thanks for sqlite-utils :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions