Add 'agentify-desktop cli' — one-shot shell commands (query/send/read/tabs/status/stop) - #56
Open
adossey wants to merge 2 commits into
Open
Add 'agentify-desktop cli' — one-shot shell commands (query/send/read/tabs/status/stop)#56adossey wants to merge 2 commits into
adossey wants to merge 2 commits into
Conversation
…/tabs/status/stop) A command-line client for the same operations the MCP server exposes, so shell scripts and coding agents can drive browser AI sessions without any MCP configuration: agentify-desktop cli query --prompt "Summarize this" --attach notes.md agentify-desktop cli query --key myproject --prompt-file q.md --out reply.md agentify-desktop cli read --key myproject Reusing --key continues the same tab and therefore the same conversation thread. Talks to the local desktop app's HTTP API and auto-launches it when needed (same ensureDesktopRunning path as the MCP server); --no-launch, --json, --timeout, and --out cover scripting needs; exit codes: 0 ok, 1 failed, 2 usage.
…n on query /status can return tab_not_found before any default tab exists; report server-level status from /tabs instead of failing. query passes a client-side timeout margin over the server budget (honored once requestJson supports timeoutMs).
Contributor
|
thanks been a while since i worked on this i'll review your PR soon |
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
A command-line client for the same operations the MCP server exposes, so shell scripts and coding agents can drive browser AI sessions without any MCP configuration:
--keycontinues the same tab and therefore the same conversation thread — handy for multi-round workflows (ask → integrate feedback → ask again in-thread).ensureDesktopRunningpath the MCP server uses);--no-launchfor strict mode.--jsonfor full response payloads,--outto write the reply text to a file (robust for scripting),--timeoutfor long reasoning runs.cli.mjsreusesmcp-lib.mjs(loadConnection/ensureDesktopRunning/requestJson). Wired as aclisubcommand in the existing bin.Independent of #55, though they pair well: with both, a coding agent can run ChatGPT-Pro rounds with file attachments purely via shell commands.
Test plan
cli status/cli tabsagainst a running desktop;cli query --key ... --attach <file> --out reply.txtuploads, sends, waits through an extended thinking phase, and writes the exact reply text (exit 0).node --checkclean;npm testunaffected (163/163 with Fix attachment uploads: accept-aware input selection, upload-settle wait, scoped stop detection, reply-baseline wait #55 applied).