{"id":50409632,"url":"https://github.com/jel1yspot/closde-sync","last_synced_at":"2026-05-31T03:02:12.214Z","repository":{"id":356364866,"uuid":"1218028501","full_name":"Jel1ySpot/closde-sync","owner":"Jel1ySpot","description":"Sync claude setting and OAuth token between machines","archived":false,"fork":false,"pushed_at":"2026-05-15T11:00:21.000Z","size":95,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T13:05:20.891Z","etag":null,"topics":["ai","ai-agent","ai-agents","aigc","anthropic","claude","claude-code","cli","coding-harness","golang","typescript"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jel1ySpot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T13:11:53.000Z","updated_at":"2026-05-15T11:00:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Jel1ySpot/closde-sync","commit_stats":null,"previous_names":["jel1yspot/closde-sync"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Jel1ySpot/closde-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jel1ySpot%2Fclosde-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jel1ySpot%2Fclosde-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jel1ySpot%2Fclosde-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jel1ySpot%2Fclosde-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jel1ySpot","download_url":"https://codeload.github.com/Jel1ySpot/closde-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jel1ySpot%2Fclosde-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33717419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agent","ai-agents","aigc","anthropic","claude","claude-code","cli","coding-harness","golang","typescript"],"created_at":"2026-05-31T03:02:06.590Z","updated_at":"2026-05-31T03:02:12.205Z","avatar_url":"https://github.com/Jel1ySpot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# closde-sync\n\n`closde-sync` is a Go + Node preload wrapper around Claude Code with optional Xray-based proxying and a lightweight sync server.\n\n## What it does\n\n- Builds a cross-platform `closde` binary into `build/closde` or `build/closde.exe`.\n- Runs in **client mode** by default and forwards all received flags to the downstream Node-based Claude CLI.\n- Runs in **server mode** when the executable filename contains `server`.\n- Injects a preload bundle into the Claude CLI process.\n- Optionally starts an in-process Xray proxy from `CLOSDE_PROXY` instead of using an external Xray binary.\n\n## Usage\n\n1. Download the `closde` binary and `preload.js` for your platform from [Release](https://github.com/Jel1ySpot/closde-sync/releases/latest).\n2. Create `.closed` folder in home directory.\n3. Move `preload.js` into `.closde`.\n4. Create `.env` file in `.closde`, edit it according to [this instructions](#client-environment) in the README.\n5. Move the binary to directory like `~/.loacl/bin` or `/usr/local/bin`, and use it.\n\n## Project layout\n\n```text\n.\n├── build/            # built binaries\n├── dist/             # built preload bundle\n├── internal/         # client/runtime/build/xray internals\n├── preload/          # preload TypeScript source\n├── server/           # sync server implementation\n├── main.go           # root binary entry\n└── package.json      # JS build scripts\n```\n\n## Requirements\n\n- Node.js\n- npm\n- Go (Development)\n\nThe client expects either a Claude Code installation managed under `~/.closde/claude/\u003cversion\u003e`, `CLOSDE_CLAUDE_VERSION=local` to use the system `claude` command, or `CLOSDE_CLAUDE_VERSION=file:\u003cabs-path\u003e` to run a specific binary. If `CLOSDE_CLAUDE_VERSION` is unset, closde automatically resolves and downloads the latest Claude Code version from npm.\n\n## Build\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nBuild everything:\n\n```bash\nnpm run build\n```\n\nUseful scripts:\n\n```bash\nnpm run build         # build preload + binary\nnpm run build:preload # build dist/preload.js\nnpm run build:cmd     # build build/closde(.exe)\nnpm run check         # TypeScript check + go test ./...\n```\n\n## Client\n\n### Client environment\n\n`closde` loads `~/.closde/.env` automatically. If the file does not exist, it is created and the first run exits so you can fill in the required values.\n\n```env\nCLOSDE_CLAUDE_VERSION=\u003cinstalled-claude-version\u003e # optional: set to local to use system claude\n```\n\nSupport environment flags:\n\n| Name | Required | Default | Describe |\n| --- | --- | --- | --- |\n| `CLOSDE_CLAUDE_VERSION` | N | / | Claude Code version to use. `local` uses the system `claude` command, and `file:\u003cabs-path\u003e` runs a specific binary — both skip the npm download and `NODE_OPTIONS` injection. If omitted, the latest npm release is used. |\n| `CLOSDE_PROXY` | N | / | The proxy URI provided to Xray to drive claude. When set, Xray binds a local HTTP proxy starting at port 11808, shifting to the next free port if it is in use. |\n| `CLOSDE_SERVER_URL` | N | / | Closde server URL. |\n| `CLOSDE_AUTH_TOKEN` | N | / | The token used to connect to the Cloude server. |\n| `HTTPS_PROXY` | N | / | The HTTPS proxy URL provided to claude. |\n| `HTTP_PROXY` | N | / | The HTTP proxy URL provided to claude. |\n| `CLOSDE_PLATFORM` | N | / | Platform name injected into `process.platform` |\n| `CLOSDE_ARCH` | N | / | Arch information injected into `process.arch` |\n| `CLOSDE_NODE_VERSION` | N | / | NodeJS version injected into `process.version`. |\n| `CLOSDE_CLAUDE_SETTINGS` | N | `$HOME/.claude.json` | `.claude.json` file path. |\n| `CLOSDE_CLAUDE_CREDENTIALS` | N | `$HOME/.claude/.credentials.json` | `.credentials.json` file path. |\n\n## Server\n\nRename the binary like `xxx-server` to enable server mode.\n\nExamples:\n\n```bash\ncp ./build/closde ./build/closde-server\n./build/closde-server --help\n./build/closde-server serve --addr :8080\n```\n\nServer commands:\n\n```bash\n./build/closde-server serve\n./build/closde-server create-token [name]\n./build/closde-server get-config\n```\n\n### Server flags\n\n`serve` supports:\n\n```bash\n--addr                 HTTP listen address\n--config-file          server config file path\n--watch-local-state    watch Claude local state files and broadcast updates\n--claude-settings      Claude settings file path\n--claude-credentials   Claude credentials file path\n```\n\nDefaults:\n\n- listen address: `:8080`\n- config file: `\u003crepo\u003e/config.json`\n- Claude settings: `~/.claude.json`\n- Claude credentials: `~/.claude/.credentials.json`\n\n## Proxy / Xray\n\nIf `CLOSDE_PROXY` is set, the client starts an embedded Xray instance and points Node traffic to the local HTTP proxy.\n\nSupported proxy URI styles are implemented under `internal/xray/`.\n\n## Verification\n\nRun the standard validation steps:\n\n```bash\nnpm run check\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjel1yspot%2Fclosde-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjel1yspot%2Fclosde-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjel1yspot%2Fclosde-sync/lists"}