Main entry point and loop.
Build the plain-text output for the --version CLI flag.
Includes the CLI and SDK versions and any installed optional dependencies. For editable installs it also reports the source path and the resolved versions of the core LangChain-ecosystem dependencies.
Reports the same version facts as the /version slash command, in the
same section order (versions, editable path, core dependencies, optional
dependencies), but omits its network-dependent release-age suffixes and
update-available hint so --version stays offline.
Check if optional dependencies are installed.
Check for recommended external tools and return missing tool names.
Skips tools that the user has suppressed via
[warnings].suppress in config.toml.
Build a PendingNotification for a missing optional tool.
The returned entry carries the install hint (or URL) in a typed payload so the notification center action handler can copy it / open it without re-running platform detection.
Format a missing-tool warning for non-interactive console output.
Parse command line arguments.
Run the Textual TUI interface (async version).
Starts a LangGraph server in a subprocess and connects the TUI to it via the
langgraph-sdk client.
Entry point for console script.
Result from running the Textual application.
Metadata for a configured MCP server and its tools.
A single notice waiting for user action.
Immutable value object: the registry owns the
key-to-toast-identity binding (see NotificationRegistry) so
external callers cannot corrupt click-routing indices by mutating
notifications after construction.
Read piped stdin and merge it into the parsed CLI arguments.
When stdin is not a TTY (i.e. input is piped), reads all available text
and applies it to the argument namespace. If stdin is a TTY or the piped
input is empty/whitespace-only, the function returns without modifying
args. Leading and trailing whitespace is stripped from piped input.
non_interactive_message is already set (-n), prepends the
piped text to it (the CLI still runs non-interactively):cat context.txt | dcode -n "summarize this"
# non_interactive_message = "{contents of context.txt}\n\nsummarize this"
initial_prompt is already set (-m, but not -n), prepends
the piped text to it (the CLI still runs interactively):cat error.log | dcode -m "explain this"
# initial_prompt = "{contents of error.log}\n\nexplain this"
initial_skill is already set (--skill, but not -n), stores the
piped text in initial_prompt so the skill receives it as the
startup request:cat diff.txt | dcode --skill code-review
# initial_prompt = "{contents of diff.txt}"
non_interactive_message to the piped text, causing
the CLI to run non-interactively with it as the prompt:echo "fix the typo in README.md" | dcode
# non_interactive_message = "fix the typo in README.md"