contento-cli
v0.1.2
Published
Local CLI for safe programmatic SEO. Bundles 150+ niches and 10 content schemas; works with any AI provider via your own API key.
Downloads
420
Maintainers
Readme
contento
Local CLI for safe programmatic SEO. Bundles 150 niches and 10 content schemas; works with any AI provider via your own API key.
npm install -g contento-cliRequires Node.js ≥ 18.
What it does
contento generates schema-validated, AI-powered pages and renders them as static HTML you deploy to your own domain. Everything runs on your machine — no Contento server, no central account. The only network calls are to the AI provider you configure (OpenAI, Anthropic, Google, Groq, OpenRouter, or any OpenAI-compatible endpoint, including local models via Ollama).
Quick start
# Configure your AI provider once (interactive)
contento config set
# or set provider env var directly:
# export OPENAI_API_KEY=sk-...
# Initialize a project in the current directory
contento init --name "My Articles" --domain example.com --output ./dist/articles
# Browse the bundled niches and schemas
contento niches list --category "Software / SaaS"
contento schemas list
# Create a collection (niches × schema = pages)
contento collections create \
--schema idea-list \
--niches developer-tools,devops,api-development \
--url-pattern "/articles/{nicheSlug}-{slug}"
# Generate (calls the AI provider directly)
contento collections generate <collection-id>
# Publish + build static HTML
contento publish <collection-id>
contento buildCommands
| Command | Description |
| --- | --- |
| contento init | Initialize a project in the current directory |
| contento config show / set / clear | AI provider configuration (BYOK) |
| contento projects list | List all projects on this machine |
| contento projects status [idOrSlug] | Show project status (counts, chrome paths) |
| contento projects chrome | Configure header/footer/CSS file paths |
| contento niches list | List bundled + custom niches |
| contento niches view <slug> | View full niche context (audience, subtopics) |
| contento niches fork <slug> | Fork a bundled niche to your custom store |
| contento niches create | Create a custom niche from scratch |
| contento niches edit <slug> | Edit a custom niche (bundled niches read-only) |
| contento niches delete <slug> | Delete a custom niche |
| contento niches select | Interactive multi-niche picker |
| contento schemas list / view <slug> | Browse content schemas |
| contento collections list / show / create / generate | Manage collections |
| contento publish <collection-id> | Flip validated pages to published |
| contento build [idOrSlug] | Render published pages to static HTML |
| contento analytics connect / sync / disconnect | Connect a project to GSC |
| contento analytics summary / top-pages / zero-traffic / export | Reporting queries |
| contento mcp serve | Run the MCP server over stdio (for AI agents) |
| contento pro status / activate / deactivate / features / packs | Manage Contento Pro license + packs |
Add --json to any command for machine-readable output.
Where things live
~/.contento/
config.json AI provider config
niches/<slug>.json custom + forked niches
projects/<project-id>/
project.json project metadata + chrome paths
collections/<col-id>.json collection definition
pages/<page-id>.json generated content + metadata
gsc.json Google OAuth tokens (per project)
analytics.db SQLite cache of GSC dataEach project working directory holds a contento.config.json pointing at the project ID. Commit it to git so your team uses the same project.
Environment variables
The CLI reads these in addition to (or instead of) ~/.contento/config.json:
| Variable | Purpose |
| --- | --- |
| OPENAI_API_KEY | Used when provider is openai |
| ANTHROPIC_API_KEY | Used when provider is anthropic |
| GROQ_API_KEY | Used when provider is groq |
| OPENROUTER_API_KEY | Used when provider is openrouter |
| CONTENTO_PROVIDER | Override the configured provider |
| CONTENTO_MODEL | Override the configured model identifier |
| GOOGLE_OAUTH_CLIENT_ID | OAuth client for analytics connect |
| GOOGLE_OAUTH_CLIENT_SECRET | OAuth client for analytics connect |
| NO_COLOR | Disable colored output |
For GSC you need to register your own Google OAuth client (Desktop app type) at https://console.cloud.google.com/apis/credentials. Either export the env vars above or write ~/.contento/google-oauth.json with { "clientId": "...", "clientSecret": "..." }.
Agent integration
Every command supports --json for structured output, and the CLI reads provider keys straight from environment variables, so AI agents can drive the entire pipeline:
export OPENAI_API_KEY=sk-...
contento init --name "Generated Site" --domain example.com --json
contento collections create --schema idea-list --niches developer-tools --json
contento collections generate <id> --json # streams NDJSON progress
contento publish <id> --json
contento build --jsonFor MCP-aware agents (Claude Code, Codex, Cursor), run contento mcp serve to expose every command as a typed MCP tool over stdio.
Programmatic API
The package also exports its lib modules so you can compose them in your own scripts:
import {
loadAiConfig,
getAllNiches,
findSchemaBySlug,
createProject,
createCollection,
expandCollection,
generateCollection,
renderPage,
buildInternalLinks,
renderSitemap,
} from 'contento';See cli/src/index.ts for the full export surface.
Development
npm install
npm run build
npm test
node dist/bin/contento.js --helpLicense
Free Use License — see LICENSE. The CLI is free of charge but proprietary: no redistribution, no modification, no derivative works. Pro features (gated by contento pro activate) are covered by a separate subscription agreement.
