Skip to content

Add 'agentify-desktop cli' — one-shot shell commands (query/send/read/tabs/status/stop) - #56

Open
adossey wants to merge 2 commits into
agentify-sh:mainfrom
adossey:feat/cli
Open

Add 'agentify-desktop cli' — one-shot shell commands (query/send/read/tabs/status/stop)#56
adossey wants to merge 2 commits into
agentify-sh:mainfrom
adossey:feat/cli

Conversation

@adossey

@adossey adossey commented Jul 22, 2026

Copy link
Copy Markdown

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:

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
agentify-desktop cli tabs | status | stop
  • Reusing --key continues the same tab and therefore the same conversation thread — handy for multi-round workflows (ask → integrate feedback → ask again in-thread).
  • Talks to the local desktop app's HTTP API and auto-launches it when needed (same ensureDesktopRunning path the MCP server uses); --no-launch for strict mode.
  • --json for full response payloads, --out to write the reply text to a file (robust for scripting), --timeout for long reasoning runs.
  • Exit codes: 0 success · 1 command failed · 2 usage error.
  • Zero new dependencies; cli.mjs reuses mcp-lib.mjs (loadConnection/ensureDesktopRunning/requestJson). Wired as a cli subcommand 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

adossey added 2 commits July 22, 2026 15:47
…/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).
@waml

waml commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

thanks been a while since i worked on this

i'll review your PR soon

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