Skip to content

feat(imports): generate executables from python scripts - #443

Merged
jahvon merged 1 commit into
feat/step-interpreterfrom
feat/py-script-imports
Aug 27, 2026
Merged

feat(imports): generate executables from python scripts#443
jahvon merged 1 commit into
feat/step-interpreterfrom
feat/py-script-imports

Conversation

@jahvon

@jahvon jahvon commented Aug 27, 2026

Copy link
Copy Markdown
Member

Part 5/5. Stacked on #442.

Summary

Adds .py to the script types imports: can turn into executables, so a repo's Python scripts become named, discoverable flow executables alongside its shell ones.

imports:
  - "scripts/analyze.py"
#!/usr/bin/env python3
# f:name=metrics f:verb=analyze
# f:description="Analyze project metrics"
# f:tag=reporting

flow analyze metrics

Notable Changes

  • Python uses # line comments, so the existing f:name= / f:verb= metadata syntax and its parser work unchanged — the new parser is the shell one with a different extension.
  • The generated executable leaves interpreter unset: the .py extension already routes it (Part 1), and setting the field would add noise to every generated definition.
  • Docs updated in both executables.md (import table + a Python tab in the metadata examples) and generated-config.md (supported types, comment-prefix note, and Python tabs in the params/args examples).

Testing

  • Parser tests mirroring the ps1 set (simple / complex / params), plus two cases the others do not have: metadata following a shebang line — idiomatic in Python scripts, and it must not shadow the comments beneath it — and that the generated executable leaves interpreter unset while still resolving to Python via its extension.
  • An import-dispatch test alongside the existing .sh/.bat/.ps1 ones.
  • Verified end-to-end outside the test suite: a scratch workspace importing a .py, synced, then run — metadata, tags, and description all landed, and flow analyze metrics executed it under Python.
  • flow validate passes; generate produces no diff.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/fileparser/py_file_parser.go 81.81% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Adds `.py` to the script types that `imports:` can turn into executables, so a
repo's Python scripts become named, discoverable flow executables alongside its
shell ones.

Python uses `#` line comments, so the existing `f:name=` / `f:verb=` metadata
syntax and its parser work unchanged — the new parser is the shell one with a
different extension. Metadata after a shebang is covered by a test, since a
shebang is idiomatic in python scripts.

The generated executable leaves `interpreter` unset: the `.py` extension already
routes it, and setting the field would add noise to every generated definition.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi
@jahvon
jahvon force-pushed the feat/py-script-imports branch from 45f9249 to 3a69fbc Compare August 27, 2026 06:50
@jahvon
jahvon merged commit d58829f into main Aug 27, 2026
23 checks passed
@jahvon
jahvon deleted the feat/py-script-imports branch August 27, 2026 13:52
jahvon added a commit that referenced this pull request Aug 27, 2026
# Summary

Reworks flowexec.io: a real design system instead of a 57-line override
file, a way to ask
questions the guides don't answer, and the SEO/social tags the site
never had.

Almost entirely docs and `tools/docsgen`. The one runtime change is a
second commit fixing three
flag usage strings that made `flow --help` print types that do not exist
— see the last section.

---

## Ask the codebase

`⌘K` local search is untouched and still instant. Alongside it, an **Ask
AI** button (`⌘I`) opens a
panel that queries DeepWiki's public MCP endpoint directly from the
browser — no proxy, no new
deploy surface, no secrets. The existing search modal also grows a
bridge row that hands the current
query across.

## Reference docs (`tools/docsgen`)

Cobra's markdown is a flat dump, and the **flag listings were the worst
of it** — fixed-width
columns that overflowed the content column and clipped their own
descriptions off the right edge.
A new post-processing pass rewrites them into tables, gives fences a
language, and turns the
command name into a real page title instead of an h2 with a section
rule.

The parser is deliberately conservative: anything it cannot parse falls
back to a verbatim code
block rather than a mangled table. It handles Cobra's backtick-derived
placeholders that contain
spaces and wrapped description lines.

## SEO

There were no Open Graph tags, no Twitter card, no canonical, and no
social image, so a link to
flowexec.io previewed as a bare URL.

## Guides

`integrations.md` split into **Containers** (the `exec.container` field
with its full option table,
plus running the CLI from the image) and **GitHub Actions** (inputs and
outputs read from
`action.yaml`). Both sit under a new Integrations group alongside AI
Tools. All inbound links and
`llms.txt` repointed.

Containers covers the Python support from #439#443 that landed while
this was in flight: the
interpreter-dependent `entrypoint` default, and the host Python env vars
that are dropped at the
container boundary regardless of `inheritEnv`.

Also: nav collapsed from five items to three (the two reference sections
became one menu), a
Dockery Labs footer, and `docs/public/demo.gif` deleted — 3 MB,
orphaned, nothing referenced it.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant