Skip to main content

specfill

An interactive TUI that fills the gaps in your project specification prompts.

specfill demo showing prompt analysis, interview questions, and the refined prompt

You paste a long project specification prompt that you intend to hand to a coding agent, or load it from a file. An LLM agent researches the topic with model-native web search and finds the aspects that are underspecified enough that the coding agent would have to guess. It then interviews you about them in plan-mode style: one question at a time, with concrete arrow-key options, multi-select where it makes sense, a free-text "Other" option, and skipping. Questions come in adaptive rounds and match the language of your prompt. The interview continues until the specification is complete, or until you press Finish now.

The result is your original prompt with the newly acquired information woven in, faithfully preserving your style and structure. If an answer contradicts the original prompt, the latest answer wins. Decisions you left unresolved stay exactly as ambiguous as you wrote them; nothing is invented.

How is this different from plan mode?

Plan modes, as implemented in common coding agent CLIs, are less thorough and don't explicitly look for gaps in your specification. They produce a plan for the task at hand, but that plan can hardly be used to define the original project specification, which can serve as a valuable documentation artifact on its own. specfill borrows the question UX from plan mode, but its output is the specification itself: complete, in your own words, and reusable.

Installation

Requires Python ≥ 3.12 on macOS or Linux. Install as a uv tool:

uv tool install specfill        # from a checkout: uv tool install .

On first launch, a configuration wizard collects your provider preset (OpenAI API, OpenAI subscription, OpenAI-compatible, Anthropic, or Google), model identifier, API key, and an optional custom base URL. The OpenAI subscription option reuses a Codex login from ~/.codex/auth.json; run codex login first. Other API keys are stored in the system keyring. If no keyring backend is available, they fall back to the config file (chmod 600).

Usage

specfill                  # paste your prompt into the editor
specfill my-prompt.md     # or prefill it from a file

Flow:

  1. Paste your project specification prompt and press Ctrl+S to analyze it. The agent researches with web search before asking questions, and the progress is shown live. If your model has no native search, or search fails during a session, specfill warns and continues without it.
  2. Answer the questions. Use the arrow keys plus Enter or Space to select, or type into Other / details… for a free-text answer. Ctrl+N answers, Ctrl+K skips, Ctrl+F finishes early.
  3. The result streams into a scrollable preview. Press c to copy it to the clipboard (with confirmation), r to regenerate it from the same answers, and p to quit and print the revised prompt, and only that, to stdout.

Skipped questions are treated as "implementer's discretion" and are never asked again.

Configuration

Settings live in ~/.config/specfill/config.toml (honors $XDG_CONFIG_HOME). They can be edited in three ways: the in-app settings screen (Ctrl+O on the paste screen), the CLI, or the file itself.

specfill config show                    # current configuration
specfill config path                    # config file location
specfill config set provider anthropic  # provider | model | base-url | web-search
specfill config set provider openai-subscription
specfill config set model claude-opus-5
specfill config set-key                 # store the API key (hidden prompt)

Every setting can also be overridden per invocation via SPECFILL_* environment variables, for example SPECFILL_MODEL or SPECFILL_WEB_SEARCH=false. API keys resolve from the keyring first, then the config file or $SPECFILL_API_KEY, then the provider's conventional variable (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY).

openai-subscription uses the OAuth credentials maintained by Codex and sends Responses requests to https://chatgpt.com/backend-api/codex. These requests count against the limits of the signed-in ChatGPT plan rather than API billing. This direct backend is not documented as a stable public API, so it may require maintenance when Codex authentication or request requirements change.

LLM inference is provider-agnostic via Pydantic AI (default model: OpenAI GPT-5.6 Sol). The UI is built with Textual.

Development

uv sync
uv run pytest    # offline tests (scripted models, no network)

Metadata

Release files for specfill 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for specfill 0.1.3
File Size Uploaded
specfill-0.1.3.tar.gz 617.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for specfill 0.1.3
File Interpreter ABI Platform
specfill-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 638.8 kB

Release files / specfill-0.1.3.tar.gz

Download URL specfill-0.1.3.tar.gz
Size 617.1 kB
Tags Source
SHA-256 checksum
How to use checksums
91dbd74942b8ac3579522562dd23187fe42667b6e29ab3a7d4d039327639d77e
BLAKE2b-256 checksum
How to use checksums
cde8acf2060dd1dabd480c5d0f16065e432936c98f6c3c22bb6359cbad886402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / specfill-0.1.3-py3-none-any.whl

Download URL specfill-0.1.3-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3684811e870667a9dde3b605b3ee776ebc96a9e4442f0578b0575827d679dbe7
BLAKE2b-256 checksum
How to use checksums
c13c24323e959b27b79edc78eebb3cbeb88241507e0ca089cac73d54db103546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.4

2 release files

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page