@cloudcannon/cli
v0.0.3
Published
Command line interface for the CloudCannon CMS.
Readme
CloudCannon CLI
Command line interface for the CloudCannon CMS.
Highlights
- 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.
Install
npm install --global @cloudcannon/cliUsage
cloudcannon configure <command> [path] [flags]Run without arguments to see available commands:
cloudcannon configure --helpCommands
configure generate [path]
Generate 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-build-settings | Also generate .cloudcannon/initial-site-settings.json | false |
| --initial-build-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 | |
configure detect-ssg [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.
configure detect-source [path]
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 |
configure detect-collections [path]
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 |
configure detect-build-commands [path]
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 |
Development
Running toolproof tests:
npm run test:toolproof
npm run test:toolproof -- -iRelated
- CloudCannon — The CMS this tool configures.
- cloudcannon.config reference — Full configuration reference.
- @cloudcannon/gadget — The detection library powering this CLI.
License
ISC © CloudCannon
