{"id":15701101,"url":"https://github.com/wxh16144/backup-cli","last_synced_at":"2025-05-07T22:45:47.242Z","repository":{"id":145028783,"uuid":"616768579","full_name":"Wxh16144/backup-cli","owner":"Wxh16144","description":"一键备份你的生产力工具配置","archived":false,"fork":false,"pushed_at":"2025-04-17T08:01:55.000Z","size":108,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T22:45:40.641Z","etag":null,"topics":["application","backup","cli","macos","profile"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@wuxh/backup-cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wxh16144.png","metadata":{"files":{"readme":"README.en_US.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-03-21T03:18:31.000Z","updated_at":"2025-05-01T02:45:49.000Z","dependencies_parsed_at":"2025-04-17T09:41:27.320Z","dependency_job_id":"80d0088c-97f1-4f91-821e-afe46dcadecd","html_url":"https://github.com/Wxh16144/backup-cli","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":"template-pro/start-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wxh16144%2Fbackup-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wxh16144%2Fbackup-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wxh16144%2Fbackup-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wxh16144%2Fbackup-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wxh16144","download_url":"https://codeload.github.com/Wxh16144/backup-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252967975,"owners_count":21833247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["application","backup","cli","macos","profile"],"created_at":"2024-10-03T19:59:42.241Z","updated_at":"2025-05-07T22:45:47.219Z","avatar_url":"https://github.com/Wxh16144.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @wuxh/backup-cli\n\n\u003e Backup your configuration files and directories [Why?](https://github.com/lra/mackup/issues/1849#issuecomment-1369963734), [lra/mackup#1969](https://github.com/lra/mackup/discussions/1969).\n\n[![npm](https://img.shields.io/npm/v/@wuxh/backup-cli.svg?style=for-the-badge)](https://www.npmjs.com/package/@wuxh/backup-cli)\n[![npm](https://img.shields.io/npm/dt/@wuxh/backup-cli.svg?style=for-the-badge)](https://www.npmjs.com/package/@wuxh/backup-cli)\n\n[简体中文](./README.md) | English\n\n## Installation\n\n```bash\nnpm i @wuxh/backup-cli -g\n```\n\n## Usage\n\n### Backup\n\n```bash\nbackup-cli\n```\n\n### Restore\n\n```bash\nbackup-cli -r\n```\n\n### Support Apps\n\n```bash\nbackup-cli -l\n```\n\n### View Configuration\n\n```bash\nbackup-cli -c\n```\n\n### CLI Options\n\nUse `backup-cli -h` to see the latest usage instructions:\n\n```bash\n    npx @wuxh/backup-cli [options]\n    ----------------------------------------\n    -l, --list: list all apps.\n    -f, --force: force to backup (overwrite files).\n    -c, --config: view config.\n    -r, --restore: restore backup.\n    -h, --help: show help.\n    -d, --debug: show debug info.\n    -v, --version: show version. vx.x.x\n    ----------------------------------------\n    e.g. backup-cli -h\n```\n\n## Config\n\n\u003e By default, `$HOME/.backuprc` is used as the configuration file, and you can also customize other locations by setting the `BACKUP_CONFIG_FILE` environment variable.\n\n```ini\n[storage]\n; Backup path, default: current directory where the command is executed.\npath = $PWD\n; Backup directory, default: backup\ndirectory = backup\n\n; Synchronized applications, default: synchronize all\n[applications_to_sync]\nzsh\n\n; Ignore a certain application, default: empty\n[applications_to_ignore]\ngit\n\n```\n\n## Custom Application\n\n\u003e Define the `[application name].cfg` configuration file and place it in the `$HOME/.backup` directory. You can customize other directories by setting the `BACKUP_CUSTOM_APP_DIR` environment variable.\n\n```ini\n[application]\nname = Git\n\n; Directories or files to be synchronized, concatenated from $HOME\n[configuration_files]\n.gitconfig_work\n\n; XDG configuration file, concatenated from $XDG_CONFIG_HOME\n; see: https://specifications.freedesktop.org/basedir-spec/latest\n[xdg_configuration_files]\ngit/config\n```\n\n## Advanced\n\n### Forced Restore\n\nWhen using `backup-cli -r` to restore backups, the `--force` option does not bypass confirmation prompts even when set to force overwriting files. This is due to security and data integrity considerations; by default, backups are not overwritten without user consent.\n\n- **Tip**: You can enforce a restore operation by setting the environment variable `BACKUP_FORCE_RESTORE = true`. However, it's important to note that this still requires using the `--force` argument in your command.\n\n### Restoring Another's Backup\n\nWhen attempting to restore files from backup directories into your `$HOME` directory, the issue might arise because their `$HOME` directories may differ from yours. Direct restoration would fail due to these differences.\n\n- **Tip**: To successfully restore another person's backups, you can set the environment variable `BACKUP_UPSTREAM_HOME={theirs HOME directory}` in your command. This specifies where each file should be placed upon restoration, ensuring they are correctly located on your system.\n\n## Who is Using\n\n- [Wxh16144's Dotfiles](https://github.com/Wxh16144/dotfiles)\n- Welcome PR: [New pull request](https://github.com/Wxh16144/backup-cli/pulls)\n\n## Contribution\n\n1. Clone the project and install dependencies using `pnpm`\n\n```bash\ngit clone git@github.com:Wxh16144/backup-cli.git \u0026\u0026 cd backup-cli \\\n    \u0026\u0026 pnpm install\n```\n\nYou can then press F5 in VSCode to start the debugger, [launch.json](./.vscode/launch.json)\n\n## LICENSE\n\n[MIT](./LICENSE)\n\n## Reference\n\n- [mackup](https://github.com/lra/mackup)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwxh16144%2Fbackup-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwxh16144%2Fbackup-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwxh16144%2Fbackup-cli/lists"}