Skip to content

feat: add pull-only mode for machines that should never push - #104

Open
Rahulsharma0810 wants to merge 1 commit into
iHildy:mainfrom
Rahulsharma0810:feat/pull-only-mode
Open

Rahulsharma0810 wants to merge 1 commit into
iHildy:mainfrom
Rahulsharma0810:feat/pull-only-mode

Conversation

@Rahulsharma0810

Copy link
Copy Markdown

Closes #102

What

Adds "mode": "sync" | "pull-only" to opencode-synced.jsonc (default sync).

In pull-only mode:

  • startup and pull behave as before: fetch and apply remote changes;
  • the startup flow returns after the pull step, so it never stages local config into the clone and never commits or pushes;
  • push and secrets-push return Skipped: opencode-synced is in pull-only mode ... instead of committing;
  • status prints Mode: pull-only (and Mode: sync otherwise).

Why

There was no way to mark a machine as a consumer. A headless box, a shared machine or an appliance that happens to carry local edits, or a different layout, would push to the shared repo on its next startup.

Compatibility

Default is sync, so existing setups are unchanged. An unknown value falls back to sync.

Not included

#102 also suggested per-machine include/exclude lists for pulls (for example taking only skills/ and AGENTS.md). That is a separate piece of work and I left it out of this PR.

Tests

  • service.test.ts: two machines against a local bare remote. The pull-only machine edits its local config, push() and startupSync() leave the remote commit count unchanged, and a later pull() still applies a change pushed by the other machine.
  • config.test.ts: mode normalization (default, pull-only, invalid value).
  • bun run check, bun run test (208 passing) and bun run build pass.

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.

Feature: pull-only (consumer) mode for headless or read-only machines

1 participant