Skip to main content
On this page

Kater CLI Set up init

kater init write-back

Connects a GitHub repository for write-back.

This is step 9 of kater init. Run it alone first to approve Kater in GitHub, then again with the repository that you select.

Examples

Terminal window
# Approve Kater in GitHub, then list the accounts and repositories
kater init write-back
# Connect a repository, and write back to kater/ after each publish
kater init write-back --installation-id 12345678 --repository-id 87654321 --path-prefix kater/ --schedule on_publish
# Connect a repository, and write back at 06:00 UTC each day
kater init write-back --installation-id 12345678 --repository-id 87654321 --path-prefix kater/ --schedule cron --cron "0 6 * * *"

Options

OptionDescription
--installation-id <id>The GitHub App installation to use, by the installation_id that the first run lists.
--repository-id <id>The repository to write back to, by the repository_id that the first run lists.
--path-prefix <folder>The folder in the repository for the shared layer, such as kater/.
--schedule <schedule>When Kater writes back: on_publish after each publish, or cron on a cron schedule.
--cron <expression>A cron expression of five fields, in UTC, such as 0 6 * * *. Give it with --schedule cron.

It also takes --help.

Two runs

  1. Alone, it opens GitHub, where you approve Kater’s GitHub App. It waits 9 minutes at most. Then it lists each account with its installation_id, and each repository where you are an admin, with its repository_id.
  2. With --installation-id, --repository-id, --path-prefix and --schedule together, it connects the repository and completes the step.

When the first run lists no repository, install Kater’s GitHub App on a repository in GitHub. Then run the command again. See kater admin write-back for what Kater writes. It needs the settings:manage permission.

See also