{"id":17383173,"url":"https://github.com/benchesh/sourcefr","last_synced_at":"2026-05-05T20:32:09.009Z","repository":{"id":218084553,"uuid":"745504746","full_name":"benchesh/sourceFR","owner":"benchesh","description":"Source from Repo: Execute a script from a remote git repo in the current shell","archived":false,"fork":false,"pushed_at":"2024-01-19T17:56:13.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T20:49:32.026Z","etag":null,"topics":["bash","bashrc","shell","shell-script","shellscript","zsh","zshrc"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/benchesh.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}},"created_at":"2024-01-19T13:33:32.000Z","updated_at":"2024-01-19T17:54:27.000Z","dependencies_parsed_at":"2024-01-19T16:57:55.932Z","dependency_job_id":"245c987a-6cf6-4a65-bfe5-b2f6d64db1da","html_url":"https://github.com/benchesh/sourceFR","commit_stats":null,"previous_names":["benchesh/sourcefr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benchesh%2FsourceFR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benchesh%2FsourceFR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benchesh%2FsourceFR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benchesh%2FsourceFR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benchesh","download_url":"https://codeload.github.com/benchesh/sourceFR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924493,"owners_count":20694728,"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":["bash","bashrc","shell","shell-script","shellscript","zsh","zshrc"],"created_at":"2024-10-16T07:40:50.470Z","updated_at":"2026-05-05T20:32:08.765Z","avatar_url":"https://github.com/benchesh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sourceFR\n\nSource from Repo: Execute a script from a remote git repo in the current shell\n\n## What's sourceFR?\n\nIn Zsh and Bash, you can read and execute commands from a file in the current shell by making use of the `source` command. For example:\n\n```bash\nsource \"myScript.sh\"\n```\n\nThis is useful if you want to load functions and instantiate variables in one script and reuse them in another.\n\nBut what if you wish to run `source` on a script that lives in a remote git repository? Introducing `sourceFR`!\n\n## Dependencies\n\n- Zsh or Bash as your shell\n- [git](https://git-scm.com/downloads)\n\n## Install\n\nThere's no need to download or clone this repo to install sourceFR.\n\nIn your Zsh or Bash terminal run:\n\n```bash\neval \"$(curl -fsSL \"https://raw.githubusercontent.com/benchesh/sourceFR/main/install.sh\")\"\n```\n\nThis will run the install script, which will:\n\n- Add an invisible `.shell_sourceFR` directory to your home directory. The `sourceFR` function will then be written to `src.sh` within this directory\n- Make a single line modification to your `.zshrc` and `.bashrc` files which will load the sourceFR function every time Zsh or Bash are loaded\n  - These files will be created if they don't exist\n\n## Usage\n\nYou can use the `sourceFR` command in much the same way as you'd use `source`, but two arguments must be provided. The first argument must be the URL for the git repo, and the second must be the relative path to the script within that repo.\n\nsourceFR works by cloning its own copy of repos you request using standard git commands. Every time you run `sourceFR`, it'll run `git pull` on the repo if it's already been cloned.\n\n### Example\n\nGive sourceFR a go with the `test.sh` script provided by this repository!\n\n```bash\nsourceFR https://github.com/benchesh/sourceFR example/test.sh\n```\n\n### Switching branches\n\nOnly default branches on sourceFR repos are supported out of the box. If you wish to retrieve a file from a different branch, you can navigate to sourceFR's copy of the repo and manually switch branch yourself using `git checkout`. sourceFR won't switch the branch back again, so proceed with caution!\n\nYou can navigate to sourceFR's copies of repos with this command:\n\n```bash\ncd \"$HOME/.shell_sourceFR/cache\"\n```\n\n### Troubleshooting\n\n- Make sure you can access the repo within your shell (ie. use `git ls-remote \u003crepo-url-here\u003e`), or sourceFR won't work!\n- If you wish to delete sourceFR's copies of repos, you can find them at `\"$HOME/.shell_sourceFR/cache\"`. sourceFR will clone a fresh copy if it's been deleted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenchesh%2Fsourcefr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenchesh%2Fsourcefr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenchesh%2Fsourcefr/lists"}