CLI tool for creating Astro blogs with @jet-w/astro-blog theme
npm install @jet-w/astro-blog-cliCLI tool for creating Astro blogs with @jet-w/astro-blog theme.
``bash`Create a new blog project
npx @jet-w/astro-blog-cli my-blog
Run without options to enter interactive mode:
`bash`
npx @jet-w/astro-blog-cli
You will be prompted for:
- Project name
- Blog title (English & Chinese)
- Blog description (English & Chinese)
- Author name
- Author email
- Site URL
- Template selection
Use -y flag to skip prompts and use defaults or provided options:
`bashQuick create with defaults
npx @jet-w/astro-blog-cli my-blog -y
Commands
$3
Create a new Astro blog project.
`bash
npx @jet-w/astro-blog-cli my-blog
`Options:
| Option | Description | Default |
|--------|-------------|---------|
|
-t, --template | Template to use | default |
| --title | Blog title (English) | My Astro Blog |
| --title-zh | Blog title (Chinese) | 我的Astro博客 |
| --description | Blog description (English) | - |
| --description-zh | Blog description (Chinese) | - |
| --author | Author name | Author |
| --email | Author email | email@example.com |
| --site | Site URL | https://example.com |
| --lang | CLI language (en/zh) | Auto-detect |
| -y, --yes | Skip prompts, use defaults | - |
| -f, --force | Overwrite existing directory | - |Examples
$3
`bash
npx @jet-w/astro-blog-cli my-tech-blog -y \
--title "Tech Notes" \
--title-zh "技术笔记" \
--description "Personal tech blog" \
--description-zh "个人技术博客" \
--author "Jane Smith" \
--email "jane@example.com" \
--site "https://jane-tech.com"
`$3
`bash
npx @jet-w/astro-blog-cli my-blog --lang zh
`$3
`bash
npx @jet-w/astro-blog-cli my-blog -y -f
`After Creation
`bash
cd my-blog
npm install
npm run dev
`Your blog will be running at
http://localhost:4321.Project Structure
The created project includes:
`
my-blog/
├── astro.config.mjs # Astro configuration
├── package.json
├── src/
│ ├── config/
│ │ ├── site.ts # Main site configuration
│ │ └── locales/ # i18n configurations
│ │ ├── en/ # English locale
│ │ └── zh-CN/ # Chinese locale
│ └── content.config.ts # Content collections schema
├── content/
│ ├── posts/ # Blog posts (Markdown/MDX)
│ ├── pages/ # Static pages
│ └── slides/ # Presentation slides
└── public/ # Static assets
``- Multi-language support (i18n)
- Markdown & MDX support
- Code syntax highlighting
- Mermaid diagrams
- LaTeX math equations
- Custom containers (tip, warning, danger, etc.)
- RSS feed
- Tailwind CSS styling
- Vue.js components support
For more information about the blog theme, visit:
- GitHub Repository
MIT