A VS Code Extension (also works with Cursor)
ChapterWise turns your code editor into a writing app with tree navigation, distraction-free prose editing, transformation commands, and format validation. Supports .codex.yaml, .codex.json, and Markdown files as Codex Lite format.
ChapterWise is the IDE for Writers. Debug your plot, version-control your drafts, and compile your book like code.
A sidebar tree view showing all nodes in your Codex file:
- Hierarchical view of your document structure
- Filter by type (chapters, characters, locations, etc.)
- Click to navigate directly to any node in the file
- Include directive support β shows referenced file paths
- Context menu with Go to YAML and Copy ID
- Auto-refresh when files are saved
Distraction-free prose editing:
- Serif typography for comfortable reading
- Dark theme matching Cursor/VS Code
- Auto-save on blur or after 2 seconds of inactivity
- Word count and character count
- Keyboard shortcuts (Ctrl+S to save)
Real-time format checking:
- Schema validation for Codex V1.0 and V1.1
- Problems panel integration
- Inline squiggly underlines for errors
- Quick fixes for common issues:
- Add missing metadata
- Add formatVersion
- Generate UUIDs for missing IDs
- Convert from legacy format
Extract child nodes into separate files for modular organization:
- Filter by type β only extract specific node types (characters, locations, etc.)
- Custom output folder β choose where extracted files are saved
- Dry run mode β preview changes before executing
- Include directives β automatically replaces extracted nodes with
include:references - Git-friendly β perfect for version control and collaboration
Command: ChapterWise Codex: Explode Codex
Merge included files back into the parent document:
- Recursive processing β follows includes within included files
- Backup creation β optionally save a backup before modifying
- Source file cleanup β delete original files after merging
- Empty folder removal β cleans up folders that become empty
- Dry run mode β preview what will be merged
Command: ChapterWise Codex: Implode Codex (Merge Included Files)
Track word counts across your manuscript:
- Counts body fields β tallies words in all
bodycontent - Updates attributes β adds/updates
word_countattribute on each node - Recursive counting β processes all children
- Include support β optionally count words in included files
Command: ChapterWise Codex: Update Word Count
AI-powered tag extraction from your content:
- NLP-based analysis β extracts meaningful terms and phrases
- Unigrams and bigrams β captures both single words and two-word phrases
- Heading boost β terms in markdown headings get extra weight
- Stopword filtering β removes common words automatically
- Two output formats:
- Simple β array of tag strings
- Detailed β objects with
nameandcountfields
- Configurable options:
- Max tags (1-100)
- Min occurrences threshold
- Follow includes
Command: ChapterWise Codex: Generate Tags
Quick templates for common node types:
| Prefix | Description |
|---|---|
codex-meta |
New Codex file with metadata |
codex-character |
Character node |
codex-chapter |
Chapter node |
codex-scene |
Scene node |
codex-location |
Location node |
codex-attr |
Attribute entry |
codex-rel |
Relation entry |
- Install the extension in VS Code or Cursor (from VSIX or marketplace)
- Open a
.codex.yamlfile (or create one using snippets) - Click the Codex icon in the activity bar to open the Navigator
- Click any node to navigate to it in the editor
- Use commands via the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P)
Access all commands via the Command Palette:
| Command | Description |
|---|---|
ChapterWise Codex: Explode Codex |
Extract children to separate files |
ChapterWise Codex: Implode Codex |
Merge included files back |
ChapterWise Codex: Update Word Count |
Count words in body fields |
ChapterWise Codex: Generate Tags |
Extract tags from content |
ChapterWise Codex: Open Writer's View |
Focused writing mode |
| Shortcut | Action |
|---|---|
Cmd/Ctrl+Shift+P |
Open Command Palette |
Cmd/Ctrl+Shift+W |
Open Writer View for current node |
Cmd/Ctrl+Shift+E |
Focus Explorer (Codex Tree) |
Cmd/Ctrl+S (in Writer) |
Save changes |
Cmd/Ctrl+. |
Quick fix suggestions |
This extension supports the ChapterWise Codex Format V1.1.
metadata:
formatVersion: "1.1"
id: "my-book"
type: book
name: "My Novel"
summary: |
A brief description of my book.
children:
- id: "ch-1"
type: chapter
name: "Chapter 1"
body: |
The story begins...Modularize your codex with includes:
children:
- include: "./characters/protagonist.codex.yaml"
- include: "./chapters/chapter-01.codex.yaml"
- include: "./locations/castle.codex.yaml"tags:
- protagonist
- roman-era
- awakenedtags:
- name: Roman
count: 15
- name: Awakening
count: 8
- name: Senate
count: 5| Extension | Format |
|---|---|
.codex.yaml |
YAML format (recommended) - Full Codex Format |
.codex.json |
JSON format - Full Codex Format |
.md |
Markdown (Codex Lite) - Codex Lite Format |
This extension works with both:
- Visual Studio Code β Version 1.85.0 or later
- Cursor β All versions (Cursor is built on VS Code, so all features work seamlessly)
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch for changes
npm run watch- Run
npm run watchin terminal - Press F5 or run "Developer: Reload Window" to test changes
- Open Developer Tools to see console logs
# Full build and package
npm run compile
npm run package
# Install in VS Code
code --install-extension chapterwise-codex-0.1.0.vsix --force
# Install in Cursor
cursor --install-extension chapterwise-codex-0.1.0.vsix --forceFull documentation available at:
MIT
Made with β€οΈ for storytellers