@remits/remits-cli
v0.1.23
Published
Local CLI for auth, component sync, and live test execution against Remits
Maintainers
Readme
remits-cli
Local CLI for rapid Remits component testing without push/sync cycles.
Install
npm install -g @remits/remits-cliCommon Commands
remits-cli auth --base-url https://your-remits-host --account-id 123
remits-cli install --skills
remits-cli tools
remits-cli tool --name "My Tool" --input '{"foo":"bar"}'
remits-cli components stage
remits-cli test run --test 45
remits-cli test run --test "My New Test" --names "test case 1,test case 2"
git add -A
git commit -m "sync passing changes"
git push
remits-cli components sync
remits-cli token --path page/my-embeddable
remits-cli listen
remits-cli listen status
remits-cli listen stop
remits-cli data-mode
remits-cli data-mode set prod
remits-cli sessions list
remits-cli config set --agent codexSkill Install
remits-cli install --skillsOptional:
remits-cli install --skills --target codex
remits-cli install --skills --target claude
remits-cli install --skills --target gemini
remits-cli install --skills --overwrite trueHow It Works
components stageuploads the current working tree into the staging cache used by test-mode execution.components syncperforms a server-side sync from the git remote into the Remits platform for the selected branch. It does not run local git commands.components commitis a convenience wrapper that performs local git commit/push, thencomponents sync, then localgit fetch/git pull --ff-only.components syncreturns the post-sync branch SHA produced by the platform.components commitverifies thatorigin/<branch>and localHEADboth match that exact SHA after the final pull.components pushis deprecated and currently behaves the same ascomponents stage.account-info.jsonis used to inferaccountIdwhen not supplied.- Branch defaults to the current local git branch.
- Data mode defaults to
test. Useremits-cli data-mode set prodonly for production investigation. - Test activity is streamed from websocket
TestSuiteevents while final status is also polled from/cli/test. - Tool execution writes the full response to a separate file so large payloads do not bloat the session log.
Listener, WebSocket, and Tmux Lifecycle
- The listener is a persistent background process started with
remits-cli listen. - Most non-
listencommands will auto-start the listener in the background if authenticated sessions already exist and no listener is running. - Successful
remits-cli authalso attempts to auto-start the listener in the background. remits-cli listenstarts a detached background process by default. Useremits-cli listen --foreground trueonly when you want to run the daemon in the current terminal.remits-cli listen statusreports whether the background listener process is still alive.remits-cli listen stopstops the background listener, kills the shared tmux session, and clears pane tracking state.- The listener groups sessions by
baseUrlso one websocket connection can service multiple authenticated accounts on the same Remits environment. - Websocket subscriptions are deduplicated by user topic. If multiple authenticated accounts share the same websocket topic, the listener subscribes once and maps that topic back to all related accounts.
- Incoming websocket messages of type
remits-cliare dispatched into dedicated tmux windows so the selected agent can continue working interactively with a full terminal view. - The listener creates a shared tmux session named
remits-listener. - Support tickets are the primary unit of dispatched work. Each ticket gets its own tmux window/workstream.
- The listener enables tmux mouse support, increases scrollback history, and keeps exited panes visible for inspection.
- Follow-up messages with the same
ticketIdare routed back to the existing pane when it is still alive. - Legacy payloads that only include
taskIdare still supported as a fallback routing key. - If a pane for a tracked ticket has exited or is dead, the listener removes that mapping and creates a replacement pane.
- Pane commands are launched through the user's login shell so the pane inherits the normal interactive
PATH. - The preferred agent comes from
remits-cli config set --agent claude|codex|gemini. The default isclaude.
Support Tickets
- Support tickets are stored as documents in the
support_ticketscollection. - New tickets and ticket updates are delivered over the
remits-cliwebsocket channel and appear as local tmux workstreams. - Think of this as a lightweight local support queue: the platform creates and updates tickets centrally, and local agents receive those tickets to investigate and resolve.
targetAccountId/targetAccountNameidentify the directly affected account. If present,targetAccountPlatformId/targetAccountPlatformNameidentify the platform or product context that owns the shared implementation.- Listener repo dispatch prefers
targetAccountPlatformIdwhen present, then falls back totargetAccountId, then the payload account ID. If one of those repos is indexed locally in~/.remits-cli/account-repos.json, it will be preferred as the tmux working directory. - Agents must resolve account
type(PLATFORM,PRODUCT,CLIENT) before deciding which local repo to use. ACLIENTticket may still require code changes in a parentPLATFORMorPRODUCTrepo. - Use
mcp_support_ticketto manage ticket state:
remits-cli tool --name "mcp_support_ticket" --input '{"action":"read","ticketId":"123"}' --data-mode prod
remits-cli tool --name "mcp_support_ticket" --input '{"action":"accept","ticketId":"123","assignee":"codex"}' --data-mode prod
remits-cli tool --name "mcp_support_ticket" --input '{"action":"update_status","ticketId":"123","status":"in_progress","notes":"Investigating logs"}' --data-mode prod
remits-cli tool --name "mcp_support_ticket" --input '{"action":"complete","ticketId":"123","resolution":"Fixed and verified"}' --data-mode prod- Recommended ticket flow:
readfirst, thenaccept, thenupdate_statusas work progresses, thencompleteorrelease.
Logging and State Files
There are two separate state areas:
- Repo-local state in
./.remits-cli/for request/response artifacts tied to the current working tree. - Global state in
~/.remits-cli/for authentication, listener lifecycle, and cross-repo account mapping.
Repo-local state
./.remits-cli/sessions/<current-session>.jsonlRecords all/cli/*HTTP requests made from the current repo session../.remits-cli/tool-responses/<callId>.jsonStores full tool responses forremits-cli tool../.remits-cli/tools/tools.jsonCached tool definitions for the current repo../.remits-cli/current-session.txtTracks the active local session log name.
Global state
~/.remits-cli/sessions.jsonAuth sessions keyed by account ID.~/.remits-cli/config.jsonCLI config such as the preferred agent.~/.remits-cli/listener.pidPID for the background websocket listener process.~/.remits-cli/dispatch-panes.jsonPersistent map of support ticket routing key to the active tmux pane id for that ticket's dedicated window.ticketIdis preferred, with legacytaskIdfallback.~/.remits-cli/account-repos.jsonIndex of known account repositories on this machine.~/.remits-cli/tmux-activity.logHuman-readable global activity log for listener and tmux lifecycle events.
Tmux Activity Log
~/.remits-cli/tmux-activity.logis the quickest way to understand what the listener is doing.- It records timestamped lifecycle events such as listener start/stop, websocket connect/disconnect, topic subscription, dispatch receipt, pane creation, follow-up delivery, pane replacement, and dispatch failures.
- Prompt bodies are not written verbatim to this log. The log stores summarized metadata such as
accountId,ticketId, any legacytaskId, available keys, and prompt length. - Typical inspection commands:
tail -f ~/.remits-cli/tmux-activity.log
tail -n 200 ~/.remits-cli/tmux-activity.logOperational Notes
tmuxmust be installed for agent dispatch to work. Without it, websocket dispatch is received but agent panes cannot be created.- In sandboxed local agent environments,
remits-clinetwork calls may fail withENOTFOUND,EAI_AGAIN,ECONNREFUSED, or similar errors even when dispatch worked correctly. That means the command needs escalated permissions or must be run outside the sandbox. - If the platform returns a 500 or other unexpected server-side failure, stop normal task execution and escalate to a Remits system admin. Agents should not invent workarounds for platform faults.
- Recommended durable update flow for agents:
components stagefor testing, thengit add/commit/push, thenremits-cli components sync, thengit pull --ff-onlyto confirm platform-generated files likeaccount-info.json. - If account repo discovery fails for a websocket message, dispatch is skipped because the listener does not know which local directory to open for that account.
- If you authenticate a new account while the listener is already running, the listener will log that new sessions were detected and should be restarted to pick up new websocket topics.
- Session logs redact token fields and replace large component content fields with length summaries.
