Config

The CLI comes with helpful commands for performing common tasks like adding a new form. You can use the CLI to make changes or edit your statickit.json file by hand — either way is fine!

Add a form

Run the following command to add a new form to your config file.

statickit forms add <key> <name>

If you'd like to add extra functionality (like server-side validations and actions), you can edit the config manually.

Example

The following command will change your statickit.json file like this:

statickit forms add contact-form "Contact Form"
  {
    "forms": {
+     "contact-form": {
+       "name": "Contact Form"
+     }
    }
  }

Deployment

Once you are finished making changes, you can deploy them with the CLI.

statickit deploy -k <your-deploy-key>

Your site's deploy key can be found under the Settings tab in StaticKit. Instead of using the -k flag every time, you can create a .env file in the root of your project and define an environment variable:

echo "STATICKIT_DEPLOY_KEY=<your-deploy-key>" >> .env
echo ".env" >> .gitignore

Do not commit your .env file to version control. You should treat your deploy key like any other secret token. A common convention is to create a .env.example file (excluding the actual key) that developers can use as a template:

echo "STATICKIT_DEPLOY_KEY=" >> .env.example