utils¶
utils is the grouped entrypoint for StackOps helper workflows.
Usage¶
Top-level sub-apps:
| Sub-app | Purpose |
|---|---|
machine |
Process, environment, hardware, and local device helpers |
pyproject |
Project bootstrap, dependency maintenance, and typing workflows |
file |
File editing, downloading, PDF tools, and database viewing |
Hidden one-letter aliases exist, but this page uses canonical names.
machine¶
| Command | Summary |
|---|---|
kill-process |
Interactive process picker with configurable filter field |
environment |
Inspect ENV or PATH using the default fuzzy picker or a Textual TUI |
get-machine-specs |
Print machine specifications |
list-devices |
List available devices for mounting |
mount |
Mount a device by query or through an interactive picker |
Key behavior:
kill-processdefaults to interactive mode and supports--filter-by command|ports|name|pid|username|status|memory|cpu.environmentdefaults toENV; passPATHas the positional argument to browsePATHentries instead.environment --tuiuses the full-screen Textual UI instead of the default fuzzy picker.get-machine-specs --hardwareincludes compute capability details; without--hardware, it prints specs and writesmachine_specs.jsonunder the StackOps config root.mountrequires--deviceunless--interactiveis set, and requires--mount-pointunless--interactiveis set or--backend udisksctlis used.mount --backendacceptsmount,dislocker, orudisksctl.
Examples:
utils machine environment PATH
utils machine environment ENV --tui
utils machine get-machine-specs --hardware
utils machine mount --interactive
utils machine mount --device sdb1 --mount-point /mnt/data --read-only
pyproject¶
| Command | Summary |
|---|---|
init-project |
Initialize a project with a uv virtual environment and dev packages |
upgrade-packages |
Regenerate package-add commands for a project, optionally clearing groups first |
type-hint |
Type-hint a file or project directory |
type-check |
Run the lint-and-type-check suite for a repository |
check-deps |
Check Python import dependencies and cycles with pyan3 or pydeps |
test-reference |
Validate _PATH_REFERENCE targets in a repository |
type-fix |
Create and optionally launch an agent layout from ./.ai/linters/issues_<checker>.md |
test-runtime |
Create and optionally launch an agent layout for runtime-test generation |
Key behavior:
init-projectdefaults to Python3.13and package groupsp,t,l,i,d;--tmp-dircreates a temporary project,--librariesadds extra packages, and--groupaccepts comma-separated group keys.upgrade-packages [ROOT]can repeat--clean-group, use--clean-all-groupsto clear every dependency group and extra, and use--delete-venvto remove the project's.venvbefore regeneratingpyproject_init.sh.type-hint [PATH]validates a file or project root and defaults to--dependency self-contained, but type-hint generation currently exits with an error because the generator implementation is missing.type-check [REPO]resolves the repository root from the nearestpyproject.tomland passes exclusions through the lint/type-check script.- If
--excludeis omitted,type-checkcurrently defaults to excludingtests,.github,.codex,.ai,.links, and.venv. check-deps [TARGET]runs eitherpyan3orpydepsthroughuv run --with, emits JSON/JSONIC by default, can write interactive HTML under./.ai/check_deps, and highlights direct mutual dependencies plus larger cycle groups.test-reference [REPO]supports--search-rootand--verbose.type-fixis a nested app whose callback runs when invoked with no subcommand. It accepts--agent,--agent-load,--which-checker/--which, and--max-agents, generates a layout under./.ai/agents/fix_<checker>_issues/, then prompts to run it.test-runtimeruns from the current directory, writes context to.ai/agents/test_runtime/context.md, skips hidden paths,.venv, and existing repo test files, then prompts to run the generated layout.
Examples:
utils pyproject init-project --name sample --python 3.14
utils pyproject upgrade-packages . --clean-group dev
utils pyproject upgrade-packages . --clean-all-groups --delete-venv
utils pyproject type-hint src/my_module.py
utils pyproject type-check . --exclude tests --exclude .venv
utils pyproject check-deps . --backend pyan --output html
utils pyproject check-deps src/my_package --backend pydeps --focus my_package --edge-filter dual
utils pyproject test-reference . --verbose
utils pyproject type-fix --which-checker pyright --agent codex
utils pyproject test-runtime --agent codex --agent-load 5
file¶
| Command | Summary |
|---|---|
edit |
Open a file or project path in the default editor |
download |
Download a file and optionally decompress it |
scrape |
Scrape a page to Markdown with Scrapling |
pdf-merge |
Merge two or more PDF files |
pdf-compress |
Compress a PDF file |
ocr |
Run Surya OCR, layout, detection, or table recognition |
read-db |
Launch a terminal database client |
Key behavior:
download [URL]supports--decompress,--output, and--output-dir.scrape [URL] [OUTPUT_PATH]wrapsuvx "scrapling[shell]" extract stealthy-fetch, defaulting tof.md,articleselectors,--wait 2000,--timeout 60000, and--enable-resources. Additional options:--output/-o(alternative to positional output path),--selector/-s(CSS selector),--wait-selector/-W(CSS selector to wait for),--enable-resources/-e/-E(toggle browser resources),--package-spec/-p(uvx package spec).pdf-merge PDFS...requires at least two distinct input files, defaults tomerged.pdf, refuses to overwrite an existing output, and can--compressthe merged output.pdf-compress PDF_INPUTdefaults to<input>_compressed.pdfand supports--qualityand--image-dpi. The current CLI accepts--no-compress-streams/-Cand--no-object-streams/-S, but those flags leave stream and object-stream compression enabled.ocr DATA_PATHruns thesurya-ocrpackage throughuv run --with ... --no-projectwithout importing Surya during CLI startup. Use--taskwithocr,detect,layout, ortable; common Surya flags include--output-dir,--page-range,--images,--debug,--keep-server, and--skip-table-detection(table task only).--package-spec/-Poverrides the uv package spec. Extra Surya flags can be passed after--.read-db [PATH]defaults to theharlequinbackend. Provide only one of positionalPATH,--url/-u, or--find/-f;--find-rootand--recursiverefine file discovery.read-dbsupports backendsrainfrog,lazysql,dblab,usql,harlequin, andsqlitplus their one-letter aliases. The current--read-write/-wflag is accepted but still leaves read-only mode enabled.--theme/-tsets the TUI theme when supported by the backend.--limit/-lcaps the number of rows loaded when supported by the backend.
Examples:
utils file edit .
utils file download https://example.com/archive.tar.gz --decompress --output-dir ./downloads
utils file scrape https://example.com/article article.md
utils f s https://example.com/article
utils file pdf-merge a.pdf b.pdf c.pdf --output merged.pdf
utils file pdf-compress report.pdf --output report-small.pdf --quality 75 --image-dpi 144
utils file ocr report.pdf --task ocr --output-dir ./surya-results --page-range 0,5-10 --images
utils f o table.png --task table --skip-table-detection -- --debug
utils file read-db ./local.db --backend harlequin
utils file read-db --find "*.duckdb" --recursive
utils file read-db --url postgres://postgres:1234@192.168.20.4:5432/binance
Typical Flow¶
Use live help to drill into the subgroup you need: