Skip to content

Conversation

@satnaing
Copy link
Owner

Description

Integrate @astro-paper/cli in AstroPaper. The CLI will provide commands for creating new blog posts, managing assets, handling theme-specific configurations, and much more.

However, at the time of writing this, only the new command for creating blog posts is available.

AstroPaper.CLI.Demo.mp4

All CLI-related configurations and improvements will be included in this PR.

Installation

As a Dev Dependency

pnpm add -D @astro-paper/cli
  • then add a script inside the package.json file
{
  "scripts": {
    // other scripts
    "lint": "eslint .",
    "cli": "astro-paper" 
  },
}
  • you can now use it like this
pnpm cli -h
pnpm cli new

# or 
npm run cli -h

As a Global Dependency

You can install the CLI globally using your preferred package manager:

# Using npm
npm install -g @astro-paper/cli

# Using yarn
yarn global add @astro-paper/cli

# Using pnpm
pnpm add -g @astro-paper/cli

Or run it directly with npx

npx @astro-paper/cli

Basic Usage

Create a New Post

# Basic usage
astro-paper new

# With a title
astro-paper new "My New Blog Post"

# Create with default values
astro-paper new -y

# Create with all default values (including filename)
astro-paper new -Y

# Create a draft post
astro-paper new -d

# Create a featured post
astro-paper new -f

# Create post in a custom path
astro-paper new -p "./examples/posts"

# Combine options
astro-paper new "My New Post" -p "./posts" -d -f -y

Command Options

Option Alias Description
--yes -y Create post with default values
--yes-all -Y Create post with default values and filename
--draft -d Create as draft
--featured -f Mark as featured
--path <path> -p The path to create the post (e.g. "./examples/posts/")

Note

Read more at @astro-paper/cli README

Related Issue

Closes: #13, #54, #53

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 29, 2025

Deploying astro-paper with  Cloudflare Pages  Cloudflare Pages

Latest commit: c3af64f
Status: ✅  Deploy successful!
Preview URL: https://618a21eb.astro-paper.pages.dev
Branch Preview URL: https://rfc-astro-paper-cli.astro-paper.pages.dev

View logs

@satnaing satnaing force-pushed the rfc/astro-paper-cli branch from 8dac4a9 to c3af64f Compare July 9, 2025 16:39
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.

suggestion: add a "new page" command

2 participants