story-weaver-ai
Version:
A narrative development system for AI-driven storytelling with Jungian psychology
106 lines (92 loc) • 3.35 kB
JavaScript
/**
* Generates CLI documentation content
* @returns {String} Documentation content
*/
function generateDocs() {
const content = `# Cursor Story CLI
A command-line interface for story development and management.
## Available Commands
${generateCommandDocs()}
## Common Options
${generateCommonOptionsDocs()}
## Examples
\`\`\`
# Create a new story project
cursor-story create my-new-story
# Generate new content based on the story concept
cursor-story generate --concept concept.json --type character
# Export story to Markdown
cursor-story export --format md --output story.md
\`\`\`
`;
return content;
}
/**
* Generates documentation for each command
* @returns {String} Commands documentation content
*/
function generateCommandDocs() {
const commands = {
'create': {
description: 'Create a new story project',
options: [
{ name: '--name, -n', description: 'Project name' },
{ name: '--template, -t', description: 'Template to use (default: standard)' }
]
},
'add': {
description: 'Add a new story element',
options: [
{ name: '--type, -t', description: 'Element type (character, location, item, event, etc.)' },
{ name: '--file, -f', description: 'Save to specified file' },
{ name: '--interactive, -i', description: 'Use interactive mode' }
]
},
'generate': {
description: 'Generate story content',
options: [
{ name: '--concept, -c', description: 'Path to concept file' },
{ name: '--type, -t', description: 'Content type to generate' },
{ name: '--count, -n', description: 'Number of items to generate' },
{ name: '--output, -o', description: 'Output file path' }
]
},
'export': {
description: 'Export story to various formats',
options: [
{ name: '--elements, -e', description: 'Path to elements file' },
{ name: '--format, -f', description: 'Export format (md, json, html)' },
{ name: '--output, -o', description: 'Output file path' },
{ name: '--template, -t', description: 'Template to use for export' }
]
},
'analyze-plot': {
description: 'Analyze story for plot holes and inconsistencies',
options: [
{ name: '--elements, -e', description: 'Path to elements file (required)' },
{ name: '--ids, -i', description: 'IDs of specific elements to analyze (optional)' }
]
},
'refine-story': {
description: 'Refine story elements through structured development phases',
options: [
{ name: '--elements, -e', description: 'Path to elements file' },
{ name: '--concept, -c', description: 'Path to concept file' },
{ name: '--phase, -p', description: 'Refinement phase (world, characters, plot, themes, all)' },
{ name: '--focus, -f', description: 'Focus area within the phase' }
]
}
};
let content = '';
for (const [command, details] of Object.entries(commands)) {
content += `### ${command}\n\n${details.description}\n\n`;
if (details.options && details.options.length > 0) {
content += '**Options:**\n\n';
details.options.forEach(option => {
content += `- \`${option.name}\`: ${option.description}\n`;
});
content += '\n';
}
}
return content;
}