npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lobehub/seo-cli

v1.4.2

Published

Lobe seo is a CLI tool that automate generation seo content for mdx

Downloads

110,005

Readme

Lobe SEO 是一款使用 ChatGPT 自动化 mdx 的 SEO Matter 的流程工具

English ・ 简体中文 ・ Changelog · Report Bug · Request Feature

TOC

✨ 特性

  • [x] 🤖 利用 ChatGPT 实现 Seo Matter 自动化
  • [x] ♻️ 支持 seo 增量更新,按照缺失 seo 信息自动新增内容
  • [x] 🛠️ 支持自定义 OpenAI 模型、API 代理、temperature
  • [x] 📝 支持 Markdown Mdx seo 自动化

📦 安装

要安装 Lobe seo,请运行以下命令:

npm install -g @lobehub/seo-cli

[!IMPORTANT]
请确保环境中 Node.js 版本 >= 18

🤯 使用

要初始化配置 Lobe i8n,请运行以下命令:

$ lobe-seo -o # 或使用完整标志 --option

[!IMPORTANT]
要使用 AI 自动生成,需要在设置中填写 OpenAI 令牌

# 翻译 Locale 文件
$ lobe-seo

# 指定配置文件
$ lobe-seo -c './custom-config.js' # or use the full flag --config

配置

可以按照 cosmiconfig 格式任选配置方式

  • package.json 中的 seo 属性
  • 以 JSON 或 YAML 格式的 .seorc 文件
  • .seorc.json.seorc.yaml.seorc.yml.seorc.js.seorc.cjs 文件

[!TIP]

本项目提供了 defineConfig 安全定义方法可以从 @lobehub/seo-cli 中导入

环境变量

本项目提供了一些额外的配置项,使用环境变量进行设置:

| 环境变量 | 类型 | 描述 | 示例 | | ------------------ | ---- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | OPENAI_API_KEY | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | sk-xxxxxx...xxxxxx | | OPENAI_PROXY_URL | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | https://api.chatanywhere.cn/v1默认值:https://api.openai.com/v1 |

🔍 配置

| 属性名称 | 必填 | 类型 | 默认值 | 描述 | | -------------- | ---- | -------------- | --------------- | ---------------------------- | | entry | * | string | - | 入口文件或文件夹 | | entryExtension | | string | .mdx | 入口文件扩展名 | | groupKey | | string | - | 为 Seo Matter 设置 Gorup key | | tagStringify | | boolean | false | 将 tags 字符串化 | | modelName | | string | gpt-3.5-turbo | 使用的模型 | | temperature | | number | 0 | 使用的采样温度 | | reference | | string | - | 自定义 SEO 规则 prompt | | concurrency | | number | 5 | 同时并发的队列请求数量 | | experimental | | experimental | {} | 实验性功能,见下文 |

experimental

| 属性名称 | 必填 | 类型 | 默认值 | 描述 | | -------- | ---- | --------- | ------- | -------------------------------------------------------------- | | jsonMode | | boolean | false | 开启 gpt 强制 json 输出提升稳定性 (只支持 23 年 11 月后新模型) |

示例一 .seorc.js

const { defineConfig } = require('@lobehub/seo-cli');

module.exports = defineConfig({
  entry: './docs/**/*.mdx',
  modelName: 'gpt-3.5-turbo-1106',
  experimental: {
    jsonMode: true,
  },
});

示例二 .seorc.json

{
  "entry": "./docs/**/*.mdx",
  "experimental": {
    "jsonMode": true
  },
  "modelName": "gpt-3.5-turbo-1106"
}

示例三 package.json

{
  "...": "...",
  "seo": {
    "entry": "./docs/**/*.mdx",
    "modelName": "gpt-3.5-turbo-1106",
    "experimental": {
      "jsonMode": true
    }
  }
}

运行

使用 lobe-seo 命令自动化生成 seo 文件:

$ lobe-seo

⌨️ 本地开发

可以使用 Github Codespaces 进行在线开发:

或者,可以克隆存储库并运行以下命令进行本地开发:

$ git clone https://github.com/lobehub/lobe-cli-toolbox.git
$ cd lobe-cli-toolbox
$ bun install
$ cd packages/lobe-seo
$ bun dev

🤝 参与贡献

我们非常欢迎各种形式的贡献。如果你对贡献代码感兴趣,可以查看我们的 GitHub Issues,大展身手,向我们展示你的奇思妙想。

🔗 链接

More Products

  • 🤖 Lobe Chat - An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application.
  • 🤯 Lobe Theme - The modern theme for stable diffusion webui, exquisite interface design, highly customizable UI, and efficiency boosting features.

Credits


📝 License

Copyright © 2023 LobeHub. This project is MIT licensed.