Command line interface for the CloudCannon CMS.
- Generates CloudCannon configuration files interactively or non-interactively.
- Detects your static site generator automatically, works with Astro, Bridgetown, Docusaurus, Eleventy, Gatsby, Hexo, Hugo, Jekyll, Lume, MkDocs, Next.js, Nuxt, Sphinx, SvelteKit.
- Suggests collections, build commands, and output paths based on your project.
- Validates CloudCannon configuration files against the schema, including split configuration files.
- Manage organisations, sites, builds, files, and form submissions via the CloudCannon API.
npm install --global @cloudcannon/cliCommands that interact with the CloudCannon API require authentication. You can authenticate using:
Log in with your CloudCannon account interactively with your web browser:
cloudcannon loginFor non-interactive environments, you can provide your access key via command line flags:
cloudcannon login --access-key-id <id> --access-key-secret <secret>Or set environment variables:
export CC_ACCESS_KEY_ID=your_key_id
export CC_ACCESS_KEY_SECRET=your_key_secretAlternatively, set the CLOUDCANNON_API_KEY environment variable:
export CLOUDCANNON_API_KEY=your_api_keyTo log out and remove stored credentials:
cloudcannon logoutEnable tab completion for your shell by adding the following to your shell config:
# zsh
echo 'source <(cloudcannon complete zsh)' >> ~/.zshrc
# bash
echo 'source <(cloudcannon complete bash)' >> ~/.bashrc
# fish
echo 'cloudcannon complete fish | source' >> ~/.config/fish/config.fishcloudcannon <command> [args] [flags]
Run without arguments to see available commands:
cloudcannon --helpLog in to your CloudCannon account using a user access key.
cloudcannon login
cloudcannon login --access-key-id <id> --access-key-secret <secret>Flags
| Flag | Description |
|---|---|
--access-key-id <string> |
Access key ID for non-interactive login |
--access-key-secret <string> |
Access key secret for non-interactive login |
Log out and remove stored credentials.
cloudcannon logoutGenerate a cloudcannon.config.yml file for your site. Runs interactively by default.
cloudcannon configure generate
cloudcannon configure generate ./my-siteFlags
| Flag | Description | Default |
|---|---|---|
--auto |
Non-interactive, accept all suggestions | false |
--dry-run |
Print output without writing files | false |
--format <yaml|json> |
Output format | yaml |
--output <path> |
Custom output file path | |
--ssg <name> |
Override SSG detection | |
--source <path> |
Override source folder | |
--mode <hosted|headless> |
Mode for initial site settings | hosted |
--initial-site-settings |
Also generate .cloudcannon/initial-site-settings.json |
false |
--initial-site-settings-only |
Only generate .cloudcannon/initial-site-settings.json |
false |
--install-command <cmd> |
Override detected install command | |
--build-command <cmd> |
Override detected build command | |
--output-path <path> |
Override detected output path |
Detect the static site generator used by your site.
cloudcannon configure detect-ssg
cloudcannon configure detect-ssg ./my-siteOutputs JSON with the detected SSG and confidence scores for all supported generators.
Detect the source folder for your site.
cloudcannon configure detect-source
cloudcannon configure detect-source ./my-site --ssg jekyllFlags
| Flag | Description |
|---|---|
--ssg <name> |
Override SSG detection |
List the collections detected in your site.
cloudcannon configure detect-collections
cloudcannon configure detect-collections ./my-site --ssg astroFlags
| Flag | Description |
|---|---|
--ssg <name> |
Override SSG detection |
--source <path> |
Override source folder |
Show suggested build commands for your site.
cloudcannon configure detect-build-commands
cloudcannon configure detect-build-commands ./my-site --ssg hugoFlags
| Flag | Description |
|---|---|
--ssg <name> |
Override SSG detection |
--source <path> |
Override source folder |
Validate CloudCannon configuration files against the schema.
cloudcannon validate
cloudcannon validate ./my-siteBy default validates all configuration files found: cloudcannon.config.yml, .cloudcannon/initial-site-settings.json, .cloudcannon/routing.json, and any split configuration files.
Use --stdin to read from stdin. Exactly one of --configuration, --initial-site-settings, or --routing must also be set to indicate the type of file being piped:
cat cloudcannon.config.yml | cloudcannon validate --stdin --configurationNote: When reading from stdin, split configuration files referenced via
*_from_globkeys are not validated. Runcloudcannon validateon a directory to validate split configuration files.
Flags
| Flag | Description |
|---|---|
--configuration |
Validate only the CloudCannon configuration file and any split configuration files |
--initial-site-settings |
Validate only .cloudcannon/initial-site-settings.json |
--routing |
Validate only .cloudcannon/routing.json |
--configuration-path <path> |
Path to the CloudCannon configuration file, overrides path search |
--stdin |
Read from stdin instead of files on disk |
List all organisations.
cloudcannon orgs listFlags
| Flag | Description |
|---|---|
--page <n> |
Page number to fetch |
--items <n> |
Number of items per page |
--sort-by <field> |
Field name to sort by |
--sort-direction <ASC|DESC> |
Sort direction |
--filter <key=value,key=value> |
Comma-separated key=value pairs to filter by |
Get an organisation by name, ID, or UUID.
cloudcannon orgs get --org my-orgFlags
| Flag | Description |
|---|---|
--org <name|id|uuid> |
The organisation name, ID, or UUID (required) |
List all sites for an organisation.
cloudcannon orgs sites list --org my-orgFlags
| Flag | Description |
|---|---|
--org <name|id|uuid> |
The organisation name, ID, or UUID (required) |
--page <n> |
Page number to fetch |
--items <n> |
Number of items per page |
--sort-by <field> |
Field name to sort by |
--sort-direction <ASC|DESC> |
Sort direction |
--filter <key=value,key=value> |
Comma-separated key=value pairs to filter by |
List all inboxes for an organisation.
cloudcannon orgs inboxes list --org my-orgFlags
| Flag | Description |
|---|---|
--org <name|id|uuid> |
The organisation name, ID, or UUID (required) |
--page <n> |
Page number to fetch |
--items <n> |
Number of items per page |
--sort-by <field> |
Field name to sort by |
--sort-direction <ASC|DESC> |
Sort direction |
--filter <key=value,key=value> |
Comma-separated key=value pairs to filter by |
List all sites across all organisations.
cloudcannon sites listGet a site by name, ID, UUID, or domain.
cloudcannon sites get --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Trigger a rebuild for a site.
cloudcannon sites rebuild --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Update the build configuration for a site.
cloudcannon sites update-build-config --site my-site --ssg hugoFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
--ssg <name> |
Static site generator name |
--building-locked <true|false> |
Lock the site from building |
--default-locale <locale> |
Default locale for i18n |
--install-command <cmd> |
Override install command |
--build-command <cmd> |
Override build command |
--output-path <path> |
Override output path |
--preserved-paths <paths> |
Comma-separated preserved paths |
--hugo-version <version> |
Hugo version |
--node-version <version> |
Node version |
--ruby-version <version> |
Ruby version |
--deno-version <version> |
Deno version |
--preserve-output <true|false> |
Preserve previous output |
--include-git <true|false> |
Include git history in build |
List files from a site.
cloudcannon sites files list --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Get the contents of a file from a site.
cloudcannon sites files get --site my-site index.html
cloudcannon sites files get --site my-site index.html --output ./local-index.htmlFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
--output <path> |
Path to save the file to. If not provided then the file is printed to STDOUT |
Upload a file to a site.
cloudcannon sites files upload --site my-site ./local-file.html /uploaded-file.htmlFlags
| Flag | Description | Default |
|---|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) | |
--type <mime> |
MIME type of the file | |
--overwrite |
Overwrite if the file already exists | false |
List builds for a site.
cloudcannon sites builds list --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
--page <n> |
Page number to fetch |
--items <n> |
Number of items per page |
--sort-by <field> |
Field name to sort by |
--sort-direction <ASC|DESC> |
Sort direction |
--filter <key=value,key=value> |
Comma-separated key=value pairs to filter by |
Print the logs for the most recent build of a site.
cloudcannon sites print-last-build --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Print the logs for the most recent failed build of a site.
cloudcannon sites print-last-failed-build --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Print the logs for the most recent sync of a site.
cloudcannon sites print-last-sync --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Print the logs for the most recent failed sync of a site.
cloudcannon sites print-last-failed-sync --site my-siteFlags
| Flag | Description |
|---|---|
--site <name|id|uuid|domain> |
The site name, ID, UUID, or domain (required) |
Print the logs for a build.
cloudcannon builds print-logs --build <uuid>Flags
| Flag | Description |
|---|---|
--build <uuid> |
The build UUID (required) |
List submissions for an inbox.
cloudcannon inboxes submissions list --inbox my-inboxFlags
| Flag | Description |
|---|---|
--inbox <name|id|key|uuid> |
The inbox name, ID, key, or UUID (required) |
--page <n> |
Page number to fetch |
--items <n> |
Number of items per page |
--sort-by <field> |
Field name to sort by |
--sort-direction <ASC|DESC> |
Sort direction |
--filter <key=value,key=value> |
Comma-separated key=value pairs to filter by |
Running toolproof tests:
npm run test:toolproof
npm run test:toolproof -- -i- CloudCannon — The CMS this tool configures.
- cloudcannon.config reference — Full configuration reference.
- @cloudcannon/gadget — The detection library powering this CLI.
ISC © CloudCannon