Skip to content

Unify shell/run into a single plain python command#75

Open
davegaeddert wants to merge 1 commit into
masterfrom
claude/plain-run-shell-ux-wdcwrh
Open

Unify shell/run into a single plain python command#75
davegaeddert wants to merge 1 commit into
masterfrom
claude/plain-run-shell-ux-wdcwrh

Conversation

@davegaeddert

Copy link
Copy Markdown
Member

Collapse plain shell (interactive REPL + -c + piped stdin) and
plain run <script> into one command that mirrors the python
interpreter, but always runs plain.runtime.setup() first:

plain python              # interactive REPL (banner + SHELL_IMPORT)
plain python -c "..."     # execute a string, then exit
plain python script.py    # run a file as __main__
plain python -            # execute stdin, then exit
echo ... | plain python   # execute piped input

Enrichment (banner + SHELL_IMPORT auto-imports) stays confined to the
interactive REPL via PYTHONSTARTUP, matching how the interpreter only
honors PYTHONSTARTUP for interactive sessions — -c, file, and stdin
modes run code as-is. Args are a flat positional vector like the
interpreter's own argv, so plain python script.py -c foo forwards
-c foo to the script rather than capturing plain's own option, and
Plain's startup file wins over any user-exported PYTHONSTARTUP. All
interpreter modes run under sys.executable.

plain shell is kept as a thin shortcut to the interactive REPL (and,
like plain python, runs piped stdin with the app configured).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_014Ln7AFVxkkJTY78DfRfqWV

Collapse `plain shell` (interactive REPL + `-c` + piped stdin) and
`plain run <script>` into one command that mirrors the `python`
interpreter, but always runs `plain.runtime.setup()` first:

    plain python              # interactive REPL (banner + SHELL_IMPORT)
    plain python -c "..."     # execute a string, then exit
    plain python script.py    # run a file as __main__
    plain python -            # execute stdin, then exit
    echo ... | plain python   # execute piped input

Enrichment (banner + SHELL_IMPORT auto-imports) stays confined to the
interactive REPL via PYTHONSTARTUP, matching how the interpreter only
honors PYTHONSTARTUP for interactive sessions — `-c`, file, and stdin
modes run code as-is. Args are a flat positional vector like the
interpreter's own argv, so `plain python script.py -c foo` forwards
`-c foo` to the script rather than capturing plain's own option, and
Plain's startup file wins over any user-exported PYTHONSTARTUP. All
interpreter modes run under `sys.executable`.

`plain shell` is kept as a thin shortcut to the interactive REPL (and,
like `plain python`, runs piped stdin with the app configured).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Ln7AFVxkkJTY78DfRfqWV
@davegaeddert davegaeddert force-pushed the claude/plain-run-shell-ux-wdcwrh branch from c9c1c56 to 4d6767b Compare July 11, 2026 02:30
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.

2 participants