Giter Site home page Giter Site logo

zsh-config-sync's Introduction

Zsh Configuration Backup Tool

Welcome to the Zsh Configuration Backup Tool! This CLI tool is designed to make it easy for you to back up and restore your Zsh configuration files using GitHub. Whether you're moving to a new machine or just want to ensure your setup is safely backed up, this tool has got you covered.

Features

  • Easy Backup: Quickly compress and upload your Zsh configuration files to GitHub.
  • Seamless Restore: Download and decompress your configuration files from GitHub with a simple command.
  • Safe Updates: Automatically back up existing configuration files locally before overwriting them during restoration.
  • Flexible Configuration: Supports both environment variables and .env for your GitHub token.

Getting Started

Prerequisites

  • Python 3.6 or higher
  • Git (for cloning this repository)
  • A GitHub account and a personal access token with repo access

Installation

  1. Clone the Repository

    git clone https://github.com/yourusername/zsh-config-backup-tool.git
    cd zsh-config-backup-tool
    
  2. Set Up a Virtual Environment

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install the Required Packages

     pip install -r requirements.txt
    
  4. Set Up Your GitHub Token

    You can set your GitHub token using either environment variables or a .env file. The tool will look for environment variables first.

    • Environment Variables: Set the following environment variables with your GitHub token:

      export GITHUB_TOKEN=yourtoken
    • .env File: Create a .env file in the root directory of the repository with the following content:

      GITHUB_TOKEN=yourtoken

Usage

The Zsh Configuration Backup Tool supports the following commands:

  • init: Initializes the tool by creating a new repository on your GitHub account and adding the remote to the local repository.
  • backup: Compresses and uploads your Zsh configuration files to GitHub.
  • restore: Downloads and decompresses your Zsh configuration files from GitHub.
  • help: Displays the help message.

Init

Before you can use the backup and restore commands, you need to initialize the tool to authenticate with your GitHub account. You can do this by running the following command:

python main.py init

Backup

To back up your Zsh configuration files, run the following command:

python main.py backup

Restore

To restore your Zsh configuration files, run the following command:

python main.py restore

Take into account that if you already have a .zshrc file in your home directory, the tool will back it up renaming it to .zshrc-local_backup before restoring the new one.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any ideas, bug fixes, or changes you'd like to contribute.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About the Author

This tool was created with ❤️ by LuisJo. You can find me on GitHub and LinkedIn.

zsh-config-sync's People

Contributors

luisjorp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.