Skip to main content
Version: v1.105

Editing jobs locally

To edit jobs, instead of using the OpenFn Job Studio you can also use your favorite text editor and make changes offline, committing and pushing to GitHub to deploy to your OpenFn using the version control feature.

First, make sure that version control is set up for your project and the job in question. When that's all done, follow the steps below:

  1. Make sure you have git installed

  2. Clone the repo from GitHub. Depending on how you're connecting, grab the HTTPS or SSH URL of the repository.

GH Clone URL

tip

You can connect to GitHub with username+password (HTTPS) or an SSH keypair you generated. (You can check out the GitHub docs for more info.)

  1. Then use it to clone the repo to your computer by running this command in a folder that you'd like to contain your new repo: git clone {repo URL} (e.g., git clone https://github.com/OpenFn/Miracle-Feet.git)

  2. To update your local copy with changes from GitHub, run git pull regularly while you're editing.

  3. For this tutorial, we assume you're making changes on the main or master branch: the one that is deployed as your production system to OpenFn.

  4. To edit your jobs, use a code editor such as Visual Studio Code.

VS Code

  1. Make sure you install the Prettier VSCode Extension and set is as default formatter in Settings as seen below. This will apply the correct code formatting to the files you change.

Prettier

  1. Once you're done, you can check which files you changed with git status.

  2. Then use git add {filepath} followed by git commit -m {change notes} to prepare the changes to be merged into the repo.

tip

There's a lot to learn about git. Here's a good place to start.

  1. Then run git push to upload the files to the repo (see more on git docs).

From there, the version control integration will update changed jobs in your OpenFn project and you can test those changes on the platform.

Once you're ready to start running jobs and testing your changes locally, head over to the The CLI docs for guidance.