Sturdy for Servers

Similarly to the Sturdy app (for macOS, Windows, and Linux), the Sturdy command line application (sturdy) manages a directory on your computer and connects it to Sturdy.

Installation and getting started

The Sturdy CLI is currently only available for Sturdy in the Cloud.

  1. Login to Sturdy in the browser
  2. Download and install the Sturdy CLI
  3. Find the ID of the codebase that you want to setup. In Sturdy: Go to the codebase > Settings > Developers, and copy the ID
  4. Run sturdy init $ID $PATH to setup a new connection of the codebase to $PATH
  5. If you're asked to authenticate yourself, get your token from here

Setup a new directory

Run sturdy init ID $PATH to setup Sturdy in a new directory. There are detailed instructions available on the Codebase page on the Sturdy website. The $PATH must point to a empty or non-existant directory on your computer.

Starting and stopping Sturdy

The Sturdy application runs in the background, and can be started with sturdy start and stopped with sturdy stop.

If Sturdy doesn't auto-start after restarting your computer, start Sturdy again with sturdy start

Logging in

Sturdy will prompt you to authenticate yourself the first time you run sturdy init automatically. To authenticate yourself as a different account, run sturdy auth and follow the instructions.

Moving a directory

It's currently not possible to move a connected Sturdy directory. Instead you can create a new directory, by following the "Setup Sturdy on your computer" instructions again for the Codebase to setup a new directory. The last argument to sturdy init is a path that you can change to the path where you want Sturdy to create the new directory. To delete the old directory, follow the delete instructions below.

To move an existing draft change to the new directory, use the "computer picker" in the top right of the page when viewing a draft, and select the new directory that you want to use. The draft, and all unsaved changes will be moved automatically.

Deleting a Sturdy directory

To remove a directory from Sturdy, start by deleting the directory like you would delete any directory. Then open the .sturdy file in your $HOME and remove the section about this directory. Remember to make sure that the file you're saving is valid JSON, it's easy to miss a trailing comma!

Uninstalling Sturdy

Remove the sturdy and sturdy-sync binaries from your $PATH. Sturdy stores data in your home directory in the following files and directories:

  • .sturdy
  • .sturdy-agent
  • .sturdy-sync

Delete them to uninstall Sturdy.