{"id":20691719,"url":"https://github.com/necraul/git-neko","last_synced_at":"2026-07-19T11:32:50.666Z","repository":{"id":216392391,"uuid":"740741212","full_name":"NecRaul/git-neko","owner":"NecRaul","description":"CLI for downloading all repositories from a specified user","archived":false,"fork":false,"pushed_at":"2026-06-20T05:13:20.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-20T07:09:33.987Z","etag":null,"topics":["downloader","git-api","git-cli","git-neko","kuroneko","python","repository","requests"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/git-neko/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NecRaul.png","metadata":{"files":{"readme":"README.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-09T01:02:46.000Z","updated_at":"2026-06-20T05:13:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cde687f-53ec-49e1-9d97-4be761522666","html_url":"https://github.com/NecRaul/git-neko","commit_stats":null,"previous_names":["necraul/git-neko"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NecRaul/git-neko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NecRaul%2Fgit-neko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NecRaul%2Fgit-neko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NecRaul%2Fgit-neko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NecRaul%2Fgit-neko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NecRaul","download_url":"https://codeload.github.com/NecRaul/git-neko/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NecRaul%2Fgit-neko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35651746,"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-07-19T02:00:06.923Z","response_time":112,"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":["downloader","git-api","git-cli","git-neko","kuroneko","python","repository","requests"],"created_at":"2024-11-16T23:17:40.984Z","updated_at":"2026-07-19T11:32:50.660Z","avatar_url":"https://github.com/NecRaul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-neko\n\nCLI for syncing repositories from a specified GitHub user.\n\n## Installation\n\n### Via PyPI (Recommended)\n\n#### With pip (Basic)\n\n```sh\npip install git-neko\n```\n\n#### With pipx (Isolated)\n\n```sh\npipx install git-neko\n```\n\n#### With uv (Best)\n\nThe most efficient way to install or run `git-neko`.\n\n```sh\n# Permanent isolated installation\nuv tool install git-neko\n\n# Run once without installing\nuvx git-neko -u \u003cgithub-username\u003e\n\n# Run in scripts or ad-hoc environments\nuv run --with git-neko git-neko -u \u003cgithub-username\u003e -t \u003cgithub-personal-access-token\u003e\n```\n\n### From Source (Development)\n\n```sh\n# Clone the repository and navigate to it\ngit clone git@github.com:NecRaul/git-neko.git\ncd git-neko\n\n# Install environment and all development dependencies (mandatory and optional)\nuv sync --dev\n\n# Install pre-commit hook\nuv run pre-commit install\n\n# Optional: Run all linters and type checkers manually\nuv run pre-commit run --all-files\n\n# Run the local version\nuv run git-neko -u \u003cgithub-username\u003e --git\n```\n\n## Usage\n\n`git-neko` acts as a sync tool. If a repo folder doesn't exist, it clones it, if it does, it updates it.\n\n```sh\n# Sync public repositories with `requests`\ngit-neko -u \u003cgithub-username\u003e\n\n# Sync public and private repositories with `requests` (using a personal access token)\ngit-neko -u \u003cgithub-username\u003e -t \u003cgithub-personal-access-token\u003e\n\n# Use 'git clone/pull' instead of 'requests' (preserves history, branches and submodules)\ngit-neko -u \u003cgithub-username\u003e -g\n\n# Use 'git' with a personal access token for private repository syncing\ngit-neko -u \u003cgithub-username\u003e -t \u003cgithub-personal-access-token\u003e --git\n\n# Sync repositories to a specific directory\ngit-neko -u \u003cgithub-username\u003e -d /path/to/repos\n\n# Include only repositories you own\ngit-neko -u \u003cgithub-username\u003e --access owner\n\n# Include repositories you own and ones you have read access to\ngit-neko -u \u003cgithub-username\u003e --access owner accessible\n\n# Include only public repositories\ngit-neko -u \u003cgithub-username\u003e --visibility public\n\n# Exclude forked repositories\ngit-neko -u \u003cgithub-username\u003e --fork no\n\n# Include only archived repositories\ngit-neko -u \u003cgithub-username\u003e --archived yes\n\n# Exclude template repositories\ngit-neko -u \u003cgithub-username\u003e --template no\n\n# Combine filters: own non-fork public repositories to a specific directory\ngit-neko -u \u003cgithub-username\u003e -d /path/to/repos --access owner --visibility public --fork no\n```\n\n### Options\n\n```sh\n-h, --help                             Display usage information and exit\n-v, --version                          Show program version and exit\n\n    --config          FILE             Load configuration from file\n    --no-config                        Ignore configuration file\n    --init-config     [FILE]           Create a default configuration file\n    --show-config                      Show effective configuration and exit\n\n-u, --username       USERNAME          GitHub username to fetch repositories from\n-t, --token          TOKEN             GitHub personal access token for private repositories\n\n-e, --environment                      Read username and token from environment variables\n    --no-environment                   Do not read username and token from environment variables\n\n-g, --git                              Download repositories using git instead of archive downloads\n    --no-git                           Download repositories using archive downloads instead of git\n\n    --access          ACCESS [...]     Access types to include:\n                                       owner, collaborator, accessible,\n                                       org-member, all\n\n    --visibility      VIS [...]        Visibility levels to include:\n                                       public, private, internal, all\n\n    --fork            {yes,no,both}    Filter fork repositories\n    --archived        {yes,no,both}    Filter archived repositories\n    --template        {yes,no,both}    Filter template repositories\n```\n\n### Configuration\n\n`git-neko` supports a JSON configuration file to set defaults for all options. You can create a default config, inspect the effective configuration, and override or ignore the config file at runtime.\n\n- Default path\n  - Linux/BSD: `$XDG_CONFIG_HOME/necraul/git-neko.json` or `~/.config/necraul/git-neko.json`\n  - MacOS: `~/Library/Application Support/necraul/git-neko.json`\n  - Windows: `%APPDATA%/necraul/git-neko.json`\n- Basic structure\n  - `github`: credentials and whether to read from environment variables.\n  - `download`: target directory and git engine settings including extra args for `clone` and `pull`.\n  - `filters`: control which repositories are included by access type, visibility, fork status, archive status, and template status.\n\n```json\n{\n  \"github\": {\n    \"username\": null,\n    \"token\": null,\n    \"environment\": false\n  },\n  \"download\": {\n    \"directory\": \".\",\n    \"git\": {\n      \"enabled\": true,\n      \"clone_args\": [\"--recursive\"],\n      \"pull_args\": [\"--recurse-submodules\"]\n    }\n  },\n  \"filters\": {\n    \"access\": [\"owner\"],\n    \"visibility\": [\"public\", \"private\"],\n    \"fork\": \"both\",\n    \"archived\": \"both\",\n    \"template\": \"both\"\n  }\n}\n```\n\n```sh\n# Create a default configuration file at the default path\ngit-neko --init-config\n\n# Create a default configuration file at a custom path\ngit-neko --init-config config.json\n\n# Show the effective configuration (defaults merged with the config file)\ngit-neko --show-config\n\n# Create a default configuration file at the default path and print it\ngit-neko --init-config --show-config\n\n# Create a default configuration file at a custom path and print it\ngit-neko --init-config /path/to/config.json --show-config\n\n# Show the effective configuration using a custom config file\ngit-neko --config config.json --show-config\n\n# Use a custom configuration file\ngit-neko --config /path/to/config.json\n\n# Ignore the configuration file and use only CLI flags\ngit-neko --no-config -u \u003cgithub-username\u003e\n\n# Override config's directory at runtime\ngit-neko -d /path/to/repos\n```\n\n### Environment Variables\n\nYou can save your credentials to environment variables to avoid passing them manually in every command.\n\nFor persistence, add these exports to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`, or `~/.bash_profile`).\n\n```sh\n# Set your credentials as environment variables\nexport GITHUB_USERNAME=\"NecRaul\"\nexport GITHUB_PERSONAL_ACCESS_TOKEN=\"ghp_necraul\"\nexport GITHUB_REPOS_DIRECTORY=\"/path/to/repos\"\n\n# Run using the stored environment variables\ngit-neko --environment\n\n# Run without using environment variables\ngit-neko --no-environment\n\n# Run using the git engine\ngit-neko --git\n\n# Run without using the git engine\ngit-neko --no-git\n\n# Run using environment variables with the git engine\ngit-neko -e --git\n\n# Run using environment variables without the git engine\ngit-neko -e --no-git\n\n# Run without environment variables with the git engine\ngit-neko --no-environment --git\n\n# Run without environment variables without the git engine\ngit-neko --no-environment --no-git\n\n# Pass the GitHub username and personal access token environment variables directly within the command\nGITHUB_USERNAME=\"NecRaul\" GITHUB_PERSONAL_ACCESS_TOKEN=\"ghp_necraul\" git-neko --environment\n\n# Pass the directory environment variable directly within the command\nGITHUB_REPOS_DIRECTORY=\"/path/to/repos\" git-neko --environment\n```\n\n\u003e [!TIP]\n\u003e `--environment` and `--git` enable a feature, while `--no-environment` and `--no-git` disable it.\n\n## Dependencies\n\n- [requests](https://github.com/psf/requests): fetch data from the GitHub API and handle downloads.\n\n## How it works\n\nThe tool determines the appropriate GitHub API endpoint based on your input: it queries `https://api.github.com/users/{username}/repos` for public profiles or `https://api.github.com/user/repos` when a token is provided to include private data.\n\nOnce the repo list is retrieved, `git-neko` automates the synchronization process using one of two engines:\n\n- Requests Engine (via `--no-git`): Fetches the repo as a compressed snapshot. This is fast but does not include **history**, **branches** or **submodules**.\n- Git Engine (via `-g` or `--git` flag): Uses your local **git** installation to perform a full **clone** or **pull**. This preserves the complete **history**, **branches** and **submodules**.\n\n### The Manual Way\n\nWithout this tool, you would need to manually parse JSON responses, manage authentication headers, and write logic to differentiate between new clones and existing updates:\n\n```sh\n# A simplified version of the logic git-neko automates\n# It fetches the name and ssh_url, then loops through them\ncurl -s -H \"Authorization: token $GITHUB_PERSONAL_ACCESS_TOKEN\" https://api.github.com/user/repos |\n    jq -r '.[] | \"\\(.name) \\(.ssh_url)\"' | while read -r name ssh_url; do\n    if [ ! -d \"$name\" ]; then\n        git clone --recursive \"$ssh_url\" \"$name\"\n    else\n        echo \"Pulling '$name'...\"\n        git -C \"$name\" pull --recurse-submodules\n    fi\ndone\n```\n\n### The git-neko way\n\n- Dynamic API Routing: Automatically identifies the correct GitHub endpoint. It uses `/users/{username}/repos` for public browsing or the authenticated `/user/repos` for private access, ensuring you get the full list of repos you have permission to view.\n- State-Aware Syncing: Instead of a simple download, it checks your local file system. If a repo already exists, it intelligently switches to an \"update\" mode (using `git pull` or overwriting via `requests`) to keep your local mirror current.\n- Hybrid Engine Support:\n  - Lightweight Mode: Uses `requests` to pull repo snapshots quickly without needing `git` installed or **SSH keys** configured.\n  - Developer Mode (`--git`): Interfaces directly with your local `git` binary to handle **full history**, **branch tracking**, and **submodule recursion**.\n- Repository Filtering: Supports fine-grained control over which repositories are synced, filtering by access level, visibility, fork status, archive status, and template status.\n- Subprocess Management: Uses Python's `subprocess` module to provide a robust bridge between the GitHub API and your local shell, handling directory navigation and command execution automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnecraul%2Fgit-neko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnecraul%2Fgit-neko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnecraul%2Fgit-neko/lists"}