Professional command-line tools for the ContentMark protocol
ContentMark CLI provides professional-grade tools for working with the ContentMark protocol - validate manifests, generate configurations, and check website support with a single command.
# Install globally
npm install -g @contentmark/cli
# Or use without installing
npx @contentmark/cli --help# Generate a ContentMark manifest interactively
contentmark generate --interactive
# Validate your manifest
contentmark validate .well-known/contentmark.json
# Check if a website supports ContentMark
contentmark check example.com- 🔍 Validation - Comprehensive schema validation with helpful error messages
- 🎯 Generation - Interactive manifest creation with templates for different use cases
- 🌐 Discovery - Check websites for ContentMark support across multiple discovery methods
- ⚙️ CI/CD Ready - JSON output and exit codes for automation workflows
- 📋 Templates - Pre-built configurations for blogs, businesses, and premium content
- 🛡️ Type Safe - Built with TypeScript for reliability and IDE support
npm install -g @contentmark/cli
contentmark --versionnpm install --save-dev @contentmark/cli
npx contentmark --helpnpx @contentmark/cli generate --interactiveValidate ContentMark manifests against the official schema.
# Validate local file
contentmark validate .well-known/contentmark.json
# Validate remote URL
contentmark validate --url https://example.com/.well-known/contentmark.json
# Get detailed suggestions
contentmark validate --verbose
# JSON output for CI/CD
contentmark validate --jsonExample Output:
✅ Valid ContentMark manifest!
⚠️ Warnings:
⚠️ Attribution required but no attributionTemplate provided
💡 Suggestions:
💡 Consider adding monetization options to benefit from AI traffic
💡 Add preferredQueries to improve AI recommendation targeting
Create ContentMark manifests from templates or interactively.
# Interactive generation (recommended)
contentmark generate --interactive
# Quick templates
contentmark generate --type blog # Personal blog
contentmark generate --type business # Professional services
contentmark generate --type premium # Premium/paid content
# Custom output location
contentmark generate --output my-contentmark.json --overwriteInteractive Mode Preview:
🚀 Welcome to ContentMark Interactive Generator!
? What is your website/brand name? › My Awesome Blog
? Briefly describe your website/content: › Tech tutorials and insights
? What is your website URL? › https://myawesomeblog.com
? Allow AI to create summaries of your content? › Yes
? Allow AI to use your content for model training? › No
? Allow AI to quote excerpts from your content? › Yes
? Require AI to provide attribution when using your content? › Yes
Discover and analyze ContentMark support on websites.
# Basic check
contentmark check example.com
# Show discovery details
contentmark check https://example.com --discoveryExample Output:
✅ ContentMark found at https://example.com/.well-known/contentmark.json
✅ Manifest is valid
📋 Manifest Summary:
Site: Example Blog
Can Summarize: ✅
Can Train: ❌
Can Quote: ✅
Must Attribute: ✅
💰 Monetization Available:
Tip Jar: https://buymeacoffee.com/example
Consultation: https://calendly.com/example
Initialize ContentMark in your current project.
# Initialize with template selection
contentmark init --type blog
# Creates .well-known/contentmark.json with template
# Provides customization guidanceGet information about the ContentMark protocol.
contentmark infoPerfect for personal blogs and content sites:
- Public access with tip jar monetization
- Allows summaries and quotes, blocks training
- Basic attribution requirements
Designed for professional services:
- Enhanced AI visibility optimization
- Consultation booking integration
- Multiple service offerings
- Professional attribution
For subscription/paid content:
- Paywall access controls
- Restricted AI usage (preview only)
- Subscription-focused monetization
- Professional positioning
contentmark generate --output public/.well-known/contentmark.json
# File automatically served at /.well-known/contentmark.jsoncontentmark generate --output static/.well-known/contentmark.json
# Add to config: staticDir = "static"contentmark generate --output .well-known/contentmark.json
# Add to _config.yml: include: [".well-known"]contentmark generate --output static/.well-known/contentmark.json
# File copied to public during build# Generate manifest
contentmark generate --type blog --output contentmark.json
# Upload to wp-content/ directory
# Add to functions.php:
# wp_head action to include <link> element# Generate manifest
contentmark generate --type blog --output contentmark.json
# Upload to content/files/
# Add link element to default.hbs templatecontentmark generate --output public/.well-known/contentmark.json
# Optional: Add to netlify.toml
# [[headers]]
# for = "/.well-known/contentmark.json"
# [headers.values]
# Content-Type = "application/json"contentmark generate --output public/.well-known/contentmark.json
# Automatically served with correct headerscontentmark init
git add .well-known/contentmark.json
git commit -m "Add ContentMark support"
git pushname: Validate ContentMark
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate ContentMark
run: npx @contentmark/cli validate --jsonvalidate_contentmark:
stage: test
script:
- npx @contentmark/cli validate --json .well-known/contentmark.json
only:
- merge_requests
- main#!/bin/sh
# .git/hooks/pre-commit
if [ -f ".well-known/contentmark.json" ]; then
npx @contentmark/cli validate .well-known/contentmark.json || exit 1
fiPerfect for automation and monitoring:
contentmark validate --json .well-known/contentmark.json{
"valid": true,
"errors": [],
"warnings": [
"Attribution required but no attributionTemplate provided"
],
"suggestions": [
"Consider adding monetization options to benefit from AI traffic"
],
"manifest": {
"version": "1.0.0",
"siteName": "Example Site",
"defaultUsagePolicy": { ... }
}
}Exit Codes:
0- Success/Valid1- Validation failed2- Network error3- Invalid arguments
# Use custom schema URL
CONTENTMARK_SCHEMA_URL="https://my-org.com/schema.json" contentmark validate# Validate multiple files
find . -name "contentmark.json" -exec contentmark validate {} \;
# Check multiple websites
for site in site1.com site2.com site3.com; do
contentmark check $site
doneSet environment variables for customization:
export CONTENTMARK_TIMEOUT=30000 # Network timeout (ms)
export CONTENTMARK_SCHEMA_URL=https://... # Custom schema URL# 1. Generate manifest
contentmark generate --interactive
# 2. Validate locally
contentmark validate .well-known/contentmark.json --verbose
# 3. Upload to your website
# (copy to your web server)
# 4. Test discovery
contentmark check yourdomain.com --discovery
# 5. Verify in CI/CD
contentmark validate --url https://yourdomain.com/.well-known/contentmark.json --json# Ensure correct location
ls -la .well-known/contentmark.json
# Check web server configuration
curl https://yourdomain.com/.well-known/contentmark.json# Get detailed error information
contentmark validate --verbose
# Check JSON syntax
cat .well-known/contentmark.json | jq .# Increase timeout for slow sites
CONTENTMARK_TIMEOUT=30000 contentmark check slow-site.comgit clone https://github.com/contentmark/cli.git
cd cli
npm install
npm run build
npm link # Makes 'contentmark' available globallynpm test # Run test suite
npm run test:watch # Watch mode for development
npm run lint # Code quality checks
npm run type-check # TypeScript validationWe welcome contributions! Please see our Contributing Guide.
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes and add tests
- Run tests:
npm test - Commit:
git commit -m "Add amazing feature" - Push:
git push origin feature/amazing-feature - Submit pull request
- Website: https://contentmark.org
- Documentation: https://contentmark.org/docs
- Specification: https://github.com/contentmark/spec
- Examples: https://github.com/contentmark/spec/tree/main/examples
- Discussions: GitHub Discussions
- Issues: Report bugs
- Discord: Join community (coming soon)
- Documentation: Getting Started Guide
- Best Practices: Implementation Guide
- FAQ: Common Questions
# Quick setup for personal blog
contentmark init --type blog
# Edit .well-known/contentmark.json with your details
# Upload to your website
contentmark check yourblog.com# Business-focused setup
contentmark generate --interactive
# Configure consultation booking and services
# Optimize for AI discovery
contentmark validate --verbose# Subscription/paywall content
contentmark generate --type premium
# Configure access controls and pricing
# Test with restricted policies
contentmark validate .well-known/contentmark.json- Always validate manifests before deployment
- Use HTTPS for all ContentMark URLs
- Regularly update CLI to latest version
- Monitor for policy compliance
Please report security vulnerabilities to: security@contentmark.org
MIT © ContentMark Alliance
See LICENSE for details.
- Built with Commander.js for CLI framework
- Validation powered by Ajv JSON Schema validator
- Styled with Chalk for beautiful terminal output
- Thanks to all contributors
Ready to take control of your AI-content relationship?
npm install -g @contentmark/cli
contentmark generate --interactiveJoin thousands of creators using ContentMark to monetize and control AI usage of their content.