Automating Neocities CLI Uploads With macOS Automator

Neocities is the wonderful hosting service that serves up this site. I recommend that everyone gets their own Neocities page! The internet was a hell of a lot more fun when people made their own content and didn't just go to a handful of major corporate websites. Neocities is free and offers plenty of hosting for simple sites. Even if you don't know HTML, start learning! Go here and sign up.

While basic Neocities accounts are free, paid accounts get the ability to mount their site as a directory through FTP access. I update my website fairly erratically, so I don't really want to pay for an account...

Neocities does, however, offer surprisingly robust CLI tools that free or paid users can take advantage of. The Neocities CLI is available here and lets you upload a local copy of your website directly to Neocities.

I found this tool extremely useful, but due to my sporadic updates I didn't really feel like memorizing the syntax for usage. While I have been a committed Mac user since ~2005, I never really dug into Automator until the past few months while trying to find solutions for some tasks at work. I realized that I could make an Automator app that would interact with the Neocities CLI to push updates for me.

The app is extremely simple to create, so I will provide instructions for how you can put it together yourself. This also prevents any directory issues.

You'll need to install the Neocities CLI and run it from Terminal at least once to log in to your account for this to work correctly.

  1. Open Automator and choose the "Application" type.



  2. Drag the "Run Shell Script" action to the workflow area.



  3. Enter the following into the shell script:
    /usr/local/bin/neocities push /Users/XXXXX/Documents/website
    osascript -e 'display notification "Website uploaded!" with title "Neocities"'

    Note that you will need to update the path after the "push" command to reflect where your website is actually stored on your computer. My path is set for my website folder which is contained in my Documents folder. If you also keep your website in your Documents folder then you will need to replace the "XXXXX" with your username.





  4. Name the application and save it, double click to run.

When you run the application it will automatically complete the "push" command in the Neocities CLI to upload your website. Once the program is finished, the second line will display a notification indicating that your website has been uploaded. If you don't like notifications and don't want to see this, you can delete the second line. I added this in as without the notification the automation will complete and you won't receive any feedback that the task is complete.

I hope that other Neocities users making websites on macOS will find this to be helpful!