Skip to content

Add the proxy command line for agents in a terminal - #77

Draft
luisKisters wants to merge 2 commits into
personalagentproxy:mainfrom
luisKisters:proxy-cli
Draft

luisKisters wants to merge 2 commits into
personalagentproxy:mainfrom
luisKisters:proxy-cli

Conversation

@luisKisters

Copy link
Copy Markdown

Stacked on #76. This is opened from a fork, so it targets main and includes #76's commit. Review only the top commit, d28990e.

Adds proxy, a command line for agents with a terminal (Claude Code, Codex, Hermes). It works with every integration and goes through the same access checks and activity log as /mcp.

proxy login --url https://app.example.com --username <agent-login>   # hidden prompt or --password-stdin
proxy connections
proxy tools <connectionId>
proxy run <connectionId> <tool> --params '{"…":"…"}'
proxy logout
# --json on any command for raw JSON
  • packages/cli (@proxy/cli) calls the existing /agent-auth/login and /api/agent/* routes.
    • The agent cookie, its expiry and the origin are kept in ~/.config/proxy/session.json, with the folder at 0700 and the file at 0600.
    • Writes send the app's Origin, so CSRF checks stay on. Redirects are refused. Plain HTTP is allowed only for a server on the same machine.
  • Activity log: migration v013_add_audit_via_cli adds cli to AuditVia. The CLI sends X-Proxy-Client: cli, and the activity log shows "from the command line". This only records where a request came from; it never affects access.
  • Also: a docs page, AGENTS.md, a bun run proxy script, and the Dockerfile copying the CLI's package.json so the frozen lockfile matches. The Docker image build hasn't been tested.

Checks: typecheck, test, lint and build pass. The migration applies, and db:migrate:diff is clean.

ci added 2 commits October 13, 2026 20:54
TickTick's tasks through its Open API v1, signed in with a personal API
token pasted on a form like the mailbox's, with Test connection. The
token is checked by listing the account's lists and stored encrypted;
a new connection gives agents Read tasks only.

One nested collection: the Inbox and the lists at the top, the open
tasks inside each (project:<list>, task:<list>:<task>). Title, notes
and priority are written, an edit sending only what changed; dates,
tags and checklists are shown only. Completing is a command of its own
on open tasks, needing Complete tasks, so editing never completes a
task. Tasks are never deleted.

The Open API client maps 401 to credentials_rejected without keeping
TickTick's answer (it repeats the token), 404 to not_found and 429 to
a new rate_limited error, and never retries. Docs page, catalog logo,
LogoDock tile and AGENTS.md updated.
packages/cli (@proxy/cli, bin proxy, on Bun): login, logout,
connections, tools <connectionId>, run <connectionId> <tool> --params,
help, each with --json. It signs in at /agent-auth/login like the
agent pages and calls /api/agent/* with the agent cookie, kept in
~/.config/proxy/session.json (folder 0700, file 0600) with the origin
and when it ends. Writes carry the server's own Origin so the CSRF
guard stays on, redirects aren't followed, and a password only goes
over HTTPS or plain HTTP to this machine. A refusal exits 1 with the
api's message; a command used wrongly exits 2.

Each request sends X-Proxy-Client: cli, and the agent side logs runs
with it as via cli (migration v013_add_audit_via_cli), provenance
only. The activity log says "from the command line". Docs page, root
`bun run proxy` script, Dockerfile and AGENTS.md updated.

This branch has not been deployed

No deployments
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.

1 participant