kamakiri init
kamakiri init creates a site, reserves its subdomain, and links the current directory to it.
Usage
kamakiri init [--no-wait]
$ kamakiri init
Subdomain: my-site
Creating site... done.
Saved to .kamakiri/config.json
$ kamakiri init
サブドメイン: my-site
サイトを作成中... 完了しました。
.kamakiri/config.json に保存しました
init returns once the site’s address is serving. --no-wait returns as soon as the site is created, with the file already written. Ctrl-C during the wait stops only the watching: the site is created and the directory linked. The kamakiri CLI covers waiting.
Commit .kamakiri/config.json, so a collaborator or a CI job deploys the same site. It holds the site’s id, not its subdomain, so renaming the site with kamakiri subdomain changes nothing in the repository.
The subdomain
A name that is taken, invalid or reserved gets an error and another prompt. kamakiri subdomain gives the rules for a name.
If the name belongs to another site on your account, init offers to link this directory to that site instead, and warns that deploys from here will replace what it serves. Answer yes, the default, to adopt it without creating a site: this is how a second machine or a fresh clone picks up an existing site. Answer no to choose another name.
If the directory already holds .kamakiri/config.json, init prints the linked site and changes nothing.
Exit status
- 0: the site is created and serving (or created, with
--no-wait), an existing site is adopted, or the directory was already linked. - 1: there is no credential, the API key is rejected, the server no longer supports this client version, a request fails, or the account is at its plan’s limit of sites. At the limit, delete a site you no longer need with kamakiri teardown, or write to support@kamakiri-labs.jp to have the limit raised.
- 130: Ctrl-C during the wait.