▸ scripy
Generate small, single-file scripts using locally hosted LLMs. Ideal when presented with repetitive terminal tasks. Available in the command line when you need it.
scripy -p "rename all my jpegs by date taken"
scripy runs an agentic loop: generate, validate, self-correct, and write entirely on your machine via Ollama or LM Studio.
Install
Requires Python 3.11+ and a running Ollama or LM Studio instance.
pip install scripy-cli
Or for development:
pip install -e .
Quick start
Note: This assumes you're running Ollama on the same machine with
qwen2.5-coder:7binstalled. See Configuration below for more detailed configuration steps.
# Generate a Python script
scripy -p "find duplicate files in a directory"
# Specify output file
scripy -p "find duplicate files in a directory" -o dedup.py
# Generate Bash
scripy -p "backup my home directory to /tmp" --lang bash
# Modify an existing script
scripy -p "add a --dry-run flag" --input dedup.py
# Skip all confirmation prompts (for scripting)
scripy -p "..." -y
Confirmation gates
scripy prompts for user input before any side-effectful action.
Before writing to disk:
? write to disk as dedup.py? [y/n/v] ›
Before sandboxed execution:
? run script to validate? [y/n/e/v/a] ›
| Key | Action |
|---|---|
y |
Yes |
n |
No |
e |
Open in $EDITOR to manually edit |
v |
Print script to terminal, then re-prompt |
a |
Always yes - skip gate for all remaining iterations |
Use -y / --yes to bypass all gates non-interactively.
Configuration
Default config works with a local Ollama instance. Override via ~/.config/scripy/config.toml:
[model]
base_url = "http://192.168.1.10:11434/v1" # remote Ollama
model = "llama3.1:8b"
api_key = "ollama" # use "lm-studio" for LM Studio
temperature = 0.2
max_tokens = 4096
[agent]
force_tools = true
max_iterations = 3
default_lang = "python"
sandbox_timeout = 10
CLI flags override config for a single run:
scripy --model qwen2.5-coder:7b -p "..."
Model recommendations
scripy targets models that run on small consumer hardware (~4–8GB RAM) but will obviously excel on more powerful machines. That being said, here are some recommendations for small machines.
| Model | Size | Tool calling | Code quality | Notes |
|---|---|---|---|---|
llama3.1:8b |
~4.7GB | Native | Good | Recommended default |
llama3.2:3b |
~2.0GB | Native | Fair | Best ultra-low-resource option |
qwen2.5-coder:7b |
~4.4GB | Inline only | Excellent | Best code quality; see note below |
deepseek-coder:6.7b |
~4.0GB | Inline only | Excellent | Same trade-off as qwen-coder |
Tool calling
scripy uses the OpenAI function-calling API to let the model invoke tools
(write_file, run_script, read_file, list_directory). Models generally fall into
two categories:
Native tool calling (llama3.1, llama3.2) - the model returns structured
tool_calls in the API response. The agentic loop runs cleanly; run_script
validation and multi-turn self-correction work as intended.
Inline tool calling (qwen2.5-coder, deepseek-coder) - these models sometimes
ignore the tool-calling API and instead append a JSON blob to their text
response. scripy tries to detect and strip these automatically, but the behavior is
less reliable and the self-correction loop may not fire. You may see:
~ inline tool call detected - model is not using structured tool calling
--force-tools (tool_choice=required) is on by default. This works well
with native tool-calling models and is generally the right choice. If you see
errors or garbled output, which can happen with certain qwen-coder or
deepseek-coder models on older Ollama versions, disable it via config:
# ~/.config/scripy/config.toml
[agent]
force_tools = false
With force_tools off, scripy falls back to inline tool-call detection automatically.
I've personally had better results using LM Studio for smaller models on small hardware
(think M2 mac mini 8GB RAM). Sometimes using Ollama the model kept appending tool calls
to the script output.
CLI reference
Usage: scripy [OPTIONS]
scripy - generate scripts with local LLMs.
Options:
-p, --prompt TEXT What script to generate.
-o, --output TEXT Output file path.
-l, --lang TEXT Language override (python, bash, etc.).
--model TEXT Model name override.
--input TEXT Existing script to modify.
--tui Launch Textual TUI.
-y, --yes Skip all confirmation gates.
--force-tools Override config and set tool_choice=required for this run.
--version Show version and exit.
--help Show this message and exit.
Development
pip install -e ".[dev]"
pytest
Metadata
Release files for scripy-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| scripy_cli-0.2.0.tar.gz | 36.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scripy_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.3 kB
Release files / scripy_cli-0.2.0.tar.gz
| Download URL | scripy_cli-0.2.0.tar.gz |
|---|---|
| Size | 36.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
008d2379e482f24c2cd3226b1591282832ed403a6ae34554c28e8f905d054727
|
|
BLAKE2b-256 checksum How to use checksums |
52d0c5fcaa37a29c4cf4d93f7bb1914e6f0f580fee831daf310680ec6aaf1ad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / scripy_cli-0.2.0-py3-none-any.whl
| Download URL | scripy_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4eaf19cbd628b2bd5d6995e1bad00c0723399dc91658989b004ff63b212a9b9b
|
|
BLAKE2b-256 checksum How to use checksums |
c410fb0a0a0709cc8a3f0b71e0b260ac8baee6d671a7ae8052002980d6231955
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for scripy-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.