feat: add exec command and inline pipeline execution#7
Open
numman-ali wants to merge 2 commits intoshouc:masterfrom
Open
feat: add exec command and inline pipeline execution#7numman-ali wants to merge 2 commits intoshouc:masterfrom
numman-ali wants to merge 2 commits intoshouc:masterfrom
Conversation
Two new ways to run pipelines without creating files:
1. `agentflow exec <agent> <prompt>` — single agent call, raw output:
agentflow exec shell "echo hello"
agentflow exec gemini "Search the web" --model gemini-3-pro-preview
agentflow exec claude "Explain this" --tools read_only --output text
2. `agentflow run -e <json|python>` — inline pipeline:
agentflow run -e '{"name":"q","nodes":[...]}'
agentflow run -e 'from agentflow import ...; print(g.to_json())'
3. `agentflow run -` — pipeline from stdin:
echo '{"name":"q","nodes":[...]}' | agentflow run -
exec defaults to raw text output on TTY (just the agent response),
JSON when piped. Supports --model, --tools, --env, --provider,
--timeout, --extra-arg, and --output flags.
run -e auto-detects JSON (starts with {) vs Python code. Python
expressions are executed as subprocesses matching the existing
.py loader pattern.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update SKILL.md: add exec quick start, inline run examples, gemini agent, reference pointer to exec.md - Add skills/agentflow/references/exec.md: full reference for exec command (all flags, output formats, env vars, examples), inline pipeline via run -e, stdin via run -, and exec-vs-pipeline guidance - Improve exec command docstring with usage examples in --help Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agentflow exec— run a single agent with a prompt, get raw output back. No files needed.agentflow run -e— pass inline JSON or Python expression directlyagentflow run -— read pipeline from stdinUsage
Design
execbuilds a single-nodePipelineSpecin memory, runs through the standard orchestratorexec --output autodefaults to raw text on TTY, JSON when pipedrun -eauto-detects JSON (starts with{) vs Python (executed as subprocess, matching existing.pyloader)run -reads stdin, same JSON/Python detectionagentflow run <path>works unchangedTest plan
agentflow exec shell "echo hello"→helloagentflow exec shell "echo hello" --output text→helloagentflow run -e '{"name":"q","nodes":[...]}'→ pipeline runsagentflow run -e 'from agentflow import ...'→ Python inline worksecho '...' | agentflow run -→ stdin worksagentflow run pipeline.py→ backwards compatible🤖 Generated with Claude Code