@remits/remits-cli
v0.1.79
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-cliOn each command run, remits-cli checks the npm latest version for @remits/remits-cli. If a newer version exists, it installs it globally with npm and re-runs the original command. To skip this check for one run, pass --no-auto-update; to disable it for a process environment, set REMITS_CLI_AUTO_UPDATE=0.
Common Commands
remits-cli auth --base-url https://your-remits-host --account-id 123
remits-cli start
remits-cli status
remits-cli stop
remits-cli install --skills
remits-cli tools
remits-cli tool --base-url http://localhost:8080 --name "My Tool" --input '{"foo":"bar"}'
remits-cli components stage
remits-cli components status
remits-cli components clear
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 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. It replaces the branch/user staging scope with the current manifest, so stale aliases from prior stages are removed.components statusshows the branch/user staging entries that can shadow DB components during CLI-scoped test-mode execution.components clearclears staged entries. Scope it with--component-typeand/or--component-id. Component ids are type-local, so an id alone clears that one component when the id is staged in only one family; if the same id is staged across multiple families it returns an ambiguity error asking you to add--component-type. With no filter it clears every staged entry for the current branch; pass--allto force the full-branch wipe explicitly.components stage,components status, andcomponents clearprint concise summaries by default. Add--jsonor--verboseto print the full server response.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. After a successful sync, the platform clears the branch/user staging scope so staged aliases cannot keep shadowing the newly synced DB rows.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.accountIdresolution for CLI commands: explicit--account-idflag wins, then the current repo'saccount-info.json, then the active session. Forremits-cli toolcalls the server applies a further precedence — explicit--account-id>input.accountId> session/repo default — so a tool can execute against a different account than the surrounding repo.- Auth sessions are stored per
accountId + dataMode + baseUrl, so the same account can stay authenticated against both localhost and production without overwriting the other session. --base-urland--data-modeare independent.--base-urlchooses the Remits host (http://localhost:8080vs deployed prod), while--data-modechooses the data segment on that host (testvsprod). Do not assume--data-mode prodmeans the deployed prod host, or that--data-mode testmeans localhost.remits-cli startscans the machine foraccount-info.jsonfiles and rebuilds~/.remits-cli/account-repos.jsonbefore bringing up the background service.- Front-stage guides are not bundled with the CLI npm package. For account-work commands (
components,test,token,tools,tool) and onauth,remits-clidownloads the latest guides from the authenticated/cli/guidesendpoint and writes them into the current account repo: rootplatform-overview.md/development-guide.md,guides/*.md,guides/features/*.md, and the agent-guidance filesCLAUDE.md/AGENTS.md/GEMINI.md(fromdocs/guides/remits-components-zip-readme.md). - Guide sync requires authentication. If no valid session exists and the terminal is interactive, the CLI auto-authenticates first; in non-interactive contexts (CI, agent sandboxes) it skips silently so guides are only ever delivered to users who can authenticate to the platform.
- During account-repo discovery,
remits-clialso overwrites the installed remits-cliSKILL.mdforclaude,codex, andgeminiso local agents stay on the latest packaged instructions. - The platform repo's
docs/guides/tree remains the single source of truth; the platform serves it from the classpath, so published CLI versions never carry guide content. - Authenticated users also get the core Remits platform repo locally. After guide sync (and on
auth/ discovery),remits-clifirst reuses any existing local copy it already knows about, can detect directly (REMITS_PLATFORM_DIR, the running CLI source in dev,~/remits), or can discover under the configured scan roots; only if none is found does it clone[email protected]:tmillhouse/remits.git(default~/remits, override withREMITS_PLATFORM_DIR; cloning only runs in an interactive terminal). On each authenticated run it also fast-forwards the repo (git pull --ff-only, once per process) so back-stage analysis runs against current code — skipped automatically if the working tree is dirty, so local work is never clobbered. The repo is tracked in~/.remits-cli/account-repos.jsonunder the reservedplatformentry so agents can analyze back-stage seams and open a fix PR when a front-stage failure turns out to be platform brittleness. - Branch defaults to the current local git branch.
- Data mode defaults to
test. Forremits-cli test run, that default is now enforced even if the most-recent authenticated session for the account isprod; a production test run therefore requires an explicit--data-mode prodon the command line. Useremits-cli data-mode set prodonly for production investigation. - If the same account is authenticated against more than one host and you omit
--base-url, the CLI auto-resolves the best matching session and now prints the resolved host. Pass--base-urlexplicitly whenever the target host matters. - Avoid commas in individual test names. The
--namesfilter is comma-delimited, so a single test case whose name contains commas cannot be targeted cleanly throughremits-cli test run --names .... - 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.
Service, Dashboard, WebSocket, and Tmux Lifecycle
- The primary lifecycle commands are
remits-cli start,remits-cli stop, andremits-cli status. remits-cli listen,remits-cli listen stop, andremits-cli listen statusstill work as compatibility aliases.- Most non-lifecycle commands auto-start the background service if authenticated sessions already exist and no service is running.
- Successful
remits-cli authalso attempts to auto-start the background service. remits-cli startstarts a detached background process by default. Useremits-cli start --foreground trueonly when you want to run the daemon in the current terminal.remits-cli statusreports whether the background service is alive and prints the dashboard URL when available.remits-cli stopstops the background service, kills the shared tmux session, and clears pane tracking state.- The service starts a localhost dashboard that acts as a control center for remits-cli integration state.
- The dashboard shows websocket connection health, topic subscriptions, tmux session/panes, the discovered account repo index, global state files, and per-repo remits-cli files.
- If websocket connections are disconnected or the tmux session is missing, the dashboard exposes actions to reconnect websockets or recreate the tmux session.
- The service 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.
- The daemon keeps STOMP heartbeats enabled and runs a maintenance watchdog that recreates unhealthy websocket connections and recreates the shared tmux session if it disappears.
- If the machine sleeps, the network drops, or auth sessions change while the daemon is already running, the service now attempts to reconnect and resubscribe automatically once connectivity returns.
- 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.
accountId/accountNameidentify the account that owns the ticket.- If present,
implementationAccountId/implementationAccountNameidentify the platform or product context that owns the shared implementation. - Listener repo dispatch prefers
implementationAccountIdwhen present, then falls back toaccountId. 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, base URL, and data mode so local and production sessions can coexist safely.~/.remits-cli/config.jsonCLI config such as the preferred agent.~/.remits-cli/listener.pidPID for the background remits-cli service process.~/.remits-cli/service-state.jsonDashboard URL, repo scan summary, and websocket state snapshot for the running service.~/.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, rebuilt byremits-cli startvia account-info discovery and also refreshed when commands run inside an account repo.~/.remits-cli/tmux-activity.logHuman-readable global activity log for listener and tmux lifecycle events.
Control Center
remits-cli startprints or records a localhost dashboard URL such ashttp://127.0.0.1:8787/.- Open that page in a browser to inspect the full local remits-cli integration state without manually opening JSON files.
- The page refreshes automatically and includes the latest global state files plus per-repo
account-info.json, local tools snapshot, and current session log tail for every indexed account repo.
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,EPERM, 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. - In sandboxed agent environments, local git writes may require a single approval step. If you want to minimize approval churn,
remits-cli components commitconsolidates the local git and sync phases into one CLI command. - 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 now refreshes its websocket clients automatically instead of requiring a manual restart.
- Session logs redact token fields and replace large component content fields with length summaries.
