{"id":16666695,"url":"https://github.com/nerdo/fido","last_synced_at":"2026-04-16T09:04:35.890Z","repository":{"id":9111080,"uuid":"10893338","full_name":"nerdo/fido","owner":"nerdo","description":"Run commands when files within a Sublime Text (v2 or v3) project are saved.","archived":false,"fork":false,"pushed_at":"2013-07-17T14:56:15.000Z","size":128,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T16:35:30.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/nerdo.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}},"created_at":"2013-06-23T22:33:03.000Z","updated_at":"2020-01-28T16:27:14.000Z","dependencies_parsed_at":"2022-08-25T02:01:08.474Z","dependency_job_id":null,"html_url":"https://github.com/nerdo/fido","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdo%2Ffido","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdo%2Ffido/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdo%2Ffido/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdo%2Ffido/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerdo","download_url":"https://codeload.github.com/nerdo/fido/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243310627,"owners_count":20270821,"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":[],"created_at":"2024-10-12T11:11:49.833Z","updated_at":"2025-12-25T09:41:02.438Z","avatar_url":"https://github.com/nerdo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fido\n\nFido is a plugin for Sublime Text (versions 2 and 3) for running commands when files within a project are saved.\n\n## Installation\nThe easy way is to use [Package Control](http://wbond.net/sublime_packages/package_control).\n\nThe \"hard\" way is to install Fido manually using git. First, go to your `Packages` subdirectory under Sublime Text's data directory:\n* Windows `%APPDATA%\\Sublime Text 2` or `%APPDATA%\\Sublime Text`\n* OS X: `~/Library/Application Support/Sublime Text 2` or `~/Library/Application Support/Sublime Text`\n* Linux `~/.config/sublime-text-2` or `~/.config/sublime-text`\n* Portable Installation: `Sublime Text 2/Data` or `Sublime Text/Data`\n\nThen clone this repository:\n\n```git clone git://github.com/nerdo/fido.git```\n\n## Usage\n\nFido works by looking for things to do in your project whenever a file is saved. The simplest setup is to have a top-level fido command that is run whenever a file is saved on any of the paths defined within your project. For example, your project file may look like this:\n\n```javascript\n{\n    \"folders\":\n\t[\n\t\t{\n\t\t\t\"follow_symlinks\": true,\n\t\t\t\"path\": \"/my/sublime/project\"\n\t\t},\n        {\n            \"path\": \"/another/path\"\n        }\n\t],\n    \"fido\": \"cake build\"\n}\n```\n\nThis configuration runs `cake build` when a file is saved on one of the project paths defined by `folders`. The command sets the working directory to the folder the saved file was found on, so if you saved a file in `/another/path/scripts/file.coffee`, the `cake build` is run from `/another/path`.\n\nYou can see Fido at work if you open your console.\n\n```\nfido$ cake build\nThis is the output of cake build!\n```\n\nYou can also set separate commands for each folder:\n\n```javascript\n{\n    \"folders\":\n    [\n\t\t{\n\t\t\t\"follow_symlinks\": true,\n\t\t\t\"path\": \"/my/sublime/project\",\n            \"fido\": \"cake build\"\n\t\t},\n        {\n            \"path\": \"/another/path\",\n            \"fido\": \"rm -f ./tmp/generated-output.txt\"\n        }\n\t]\n}\n```\n\nIn this example, `cake build` is only run when a file in `/my/sublime/project` is saved. When a file is saved. When a file is saved on the path `/another/path`, the file `/another/path/tmp/generated-output.txt` is deleted with the command `rm -f ./tmp/generated-output.txt`.\n\nWhat if you wanted to run `cake build` on all paths, but only remove that temp file when files within `/another/path` is saved? No problem. Define your settings like this:\n\n```javascript\n{\n    \"folders\":\n    [\n    \t{\n\t\t\t\"follow_symlinks\": true,\n\t\t\t\"path\": \"/my/sublime/project\"\n\t\t},\n        {\n            \"path\": \"/another/path\",\n            \"fido\": \"rm -f ./tmp/generated-output.txt\"\n        }\n\t],\n    \"fido\": {\n        \"command\": \"cake build\",\n        \"alwaysRun\": true\n    }\n}\n```\n\nIn this scenario, the Fido command is defined as an object with the properties `command` and `alwaysRun`.\n\nIf `alwaysRun` was set to false (the default), the command would not run when a more specific command is found (like the removal of the temp file).\n\nMost projects are set up with a single folder, but you may want to run different commands for files saved in different parts of the project. That can be accomplished by setting up fido as an array. A more real-world project might look something like this:\n\n```javascript\n{\n    \"folders\":\n    [\n        {\n\t\t\t\"follow_symlinks\": true,\n\t\t\t\"path\": \"/my/sublime/project\"\n\t\t},\n\t],\n    \"fido\": [\n        {\n            \"follow_symlinks\": true,\n            \"path\": \"/my/sublime/project/scripts/coffee\",\n            \"command\": \"cake build\"\n        },\n        {\n            \"path\": \"/my/sublmime/project/scss\",\n            \"command\": \"sass --style compressed site.scss ../css/site.css\"\n        },\n        {\n            \"command\": \"growlnotify -m'Insanely annoying message every time a file is saved' -t'Annoying Notification'\",\n            'alwaysRun': true\n        }\n    ]\n}\n```\n\nThis sets up Fido to run a few commands. First, `cake build` runs when files are saved on the path `/my/sublime/projects/scripts/coffee`. Note the `follow_symlinks` option has the same meaning as when it is defined in a folder.\n\nThen there is a `sass` command that gets run to recompile an scss file into css when files are saved on its path.\n\nLast, but not least, there is a command that is run on every file saved within the project which runs `growlnotify`, for no apparent reason... Ok, so this isn't **completely** a real-world example :P\n\nBecause most people don't normally launch sublime from the command line, it's likely that your environment path won't be set as you expect it. For example, you may see something like this in your console if you were trying to run `cake build`:\n\n```\nfido$ cake build\n/bin/sh: cake: command not found\n```\n\nIf you get errors like this, you'll need to set your environment path, open a terminal and check your `PATH` variable.\n\nIn OS X and *nix: `echo $PATH`\n\nCopy that value, and set it up like so:\n\n```javascript\n{\n    \"folders\":\n    [\n        {\n    \t\t\"follow_symlinks\": true,\n\t\t\t\"path\": \"/my/sublime/project\"\n\t\t},\n\t],\n    \"fido\": [\n        {\n            \"follow_symlinks\": true,\n            \"path\": \"/my/sublime/project/scripts/coffee\",\n            \"command\": \"cake build\",\n            \"env\": {\n                \"PATH\": \"\u003c\u003c\u003c PATH COPIED FROM COMMAND LINE HERE \u003e\u003e\u003e\"\n            }\n        },\n        {\n            \"path\": \"/my/sublmime/project/scss\",\n            \"command\": \"sass --style compressed site.scss ../css/site.css\",\n            \"env\": {\n                \"PATH\": \"\u003c\u003c\u003c PATH COPIED FROM COMMAND LINE HERE \u003e\u003e\u003e\"\n            }\n        },\n        {\n            \"command\": \"growlnotify -m'Insanely annoying message every time a file is saved' -t'Annoying Notification'\",\n            'alwaysRun': true,\n            \"env\": {\n                \"PATH\": \"\u003c\u003c\u003c PATH COPIED FROM COMMAND LINE HERE \u003e\u003e\u003e\"\n            }\n        }\n    ]\n}\n```\n\nYou may or may not need to set the path depending on where the command lives on your filesystem, but it's probably a good idea to include it with each command.\n\nBy the way, any environment variables can be set this way by setting key-value pairs on the env object, not **just** PATH.\n\n## Special Thanks\nSpecial thanks go out to [titoBouzout](https://github.com/titoBouzout) for letting me use a piece of his code from his [SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements) plugin to get this working properly on ST2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdo%2Ffido","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerdo%2Ffido","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdo%2Ffido/lists"}