Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,26 @@ in memory — playback never writes to disk.

Requires [`uv`](https://docs.astral.sh/uv/). Everything else is handled by `uv`.

Run `aloud` directly from GitHub without installing it:

```sh
git clone https://github.com/wasim/aloud.git ~/aloud
cd ~/aloud
uvx --from git+https://github.com/wasim/aloud aloud https://example.com/article
```

# Create the environment and install dependencies (reproducible).
uv python install 3.13
uv venv --python 3.13
uv sync
Or install the `aloud` command permanently:

# Put the `aloud` command on your PATH.
mkdir -p ~/.local/bin
cat > ~/.local/bin/aloud <<'EOF'
#!/bin/sh
exec "$HOME/aloud/.venv/bin/python" "$HOME/aloud/aloud.py" "$@"
EOF
chmod +x ~/.local/bin/aloud
```sh
uv tool install git+https://github.com/wasim/aloud
aloud https://example.com/article
```

Make sure `~/.local/bin` is on your `PATH`. If not, add to `~/.zshrc`:
To work from a clone instead, create the environment and command with:

```sh
export PATH="$HOME/.local/bin:$PATH"
git clone https://github.com/wasim/aloud.git ~/aloud
cd ~/aloud
uv sync
uv run aloud https://example.com/article
```

The whole environment is reproducible from `pyproject.toml` + `uv.lock` with a
Expand Down Expand Up @@ -221,7 +219,7 @@ pkill -f aloud.py # force-kill, if ever needed

- `aloud.py` — the whole tool (one readable script)
- `pyproject.toml` / `uv.lock` — reproducible environment
- `~/.local/bin/aloud` — the command wrapper on your PATH
- `~/.local/bin/aloud` — the command installed by `uv tool install`

---

Expand Down
7 changes: 6 additions & 1 deletion aloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,16 @@ def main():
est_sec).run()


if __name__ == "__main__":
def cli():
"""Run the command-line interface."""
# Default SIGINT -> KeyboardInterrupt is what we rely on; keep it explicit.
signal.signal(signal.SIGINT, signal.default_int_handler)
try:
main()
except KeyboardInterrupt:
print("\nStopping…")
sys.exit(130)


if __name__ == "__main__":
cli()
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ dependencies = [
"pypdf",
]

[tool.uv]
package = false
[project.scripts]
aloud = "aloud:cli"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
py-modules = ["aloud"]

[tool.uv.sources]
en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" }
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.