Skip to content

feat: add dory CLI tool with build and preview commands#15

Merged
hkdeman merged 2 commits intomainfrom
claude/issue-14-20250623_044710
Jun 23, 2025
Merged

feat: add dory CLI tool with build and preview commands#15
hkdeman merged 2 commits intomainfrom
claude/issue-14-20250623_044710

Conversation

@hkdeman
Copy link
Copy Markdown
Contributor

@hkdeman hkdeman commented Jun 23, 2025

Implements the requested Dory CLI tool for building and previewing documentation sites.

Changes

  • Updated package.json for npm publishing with proper metadata
  • Created CLI entry point at bin/dory.js with build and preview commands
  • Updated README.md with CLI installation and usage instructions

Resolves #14

Generated with Claude Code

- Update package.json for npm publishing with proper metadata
- Create CLI entry point at bin/dory.js with:
  - dory build: checks dory.json, clears docs folder, runs build, creates dist
  - dory preview: starts preview server for built site
  - dory help: shows usage information
- Update README.md with CLI installation and usage instructions

Resolves #14

Co-authored-by: H <hkdeman@users.noreply.github.com>
@jazzberry-ai
Copy link
Copy Markdown

jazzberry-ai bot commented Jun 23, 2025

Bug Report

Name Severity Example test case Description
Command Injection in log message High Create a dory.json file with a malicious name field like "name": "$(touch /tmp/pwned)". Run dory build. The console.log statement in bin/dory.js is vulnerable to command injection if the name field in dory.json contains shell commands.
Missing Input Sanitization Medium Create a file named -rf. Run dory build. bin/dory.js blindly executes rmSync(docsDir, { recursive: true, force: true });. If docsDir were to be crafted to be -rf, it could have unintended consequences.
Confusing instructions in README.md Low Follow the instructions in "3️⃣ Copy Documentation Content". The instructions suggest running rm -rf ./docs && cp ../wherever-the-docs-are/. ./docs. Since the dory build command already handles clearing and preparing the docs folder, this step is redundant when using the CLI. Also, the command cp ../wherever-the-docs-are/. ./docs is dangerous because of the dot after wherever-the-docs-are/. It should be cp -r ../wherever-the-docs-are ./docs.

Comments? Email us.

@jazzberry-ai
Copy link
Copy Markdown

jazzberry-ai bot commented Jun 23, 2025

Bug Report

Name Severity Example test case Description
Incorrect working directory for npm run build Critical Run dory build in a Dory project. The npm run build command is executed in the Dory CLI's installation directory instead of the user's project directory, causing the build to fail.

Comments? Email us.

@hkdeman hkdeman merged commit 8fa7f6f into main Jun 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] - Create "dory" command line and publish to npm registry

1 participant