Total Pageviews

Wednesday, 18 November 2026

让instinct帮我搭建基于nextjs+notion的静态博客程序ksnb

 我用email id: brightmann@gmail.com+邮箱验证码登录app.notion.com

  我用github a/c: brightmann@gmail.com授权登录cloudflare.com

 我跟instinct的对话截图如下,共20张图。

 




















 
 得到的博客地址:
 https://ksnb-x9e1.onrender.com/
https://ksnb.pages.dev/
 https://ksnb.brightmann.workers.dev/
 
项目地址:
 https://github.com/kanaru-ssk/notion-blog
 https://github.com/brightmann/ksnb/
 
博客的源帖在app.notion.com里面创建。



Editor.md, 开源在线 Markdown 编辑器

 https://pandao.github.io/editor.md/

项目地址: https://github.com/pandao/editor.md

英伟达拒绝黄仁勋回归,人类史上最大的泡沫破裂无疑

- 英伟达的市值最高峰时,达到55000亿美元,远超苹果。

习近平机场亲迎特朗普,美总统任内首访深圳,开启全球瞩目APEC峰会

 

-没想到60/70年代的小学生出面欢迎外国领导人的场面又出现了,只是这次小学生换成了大学生(估计是大学生)。

How to use GitHub as a Real-Time Headless CMS for Astro

 

I have been blogging since 2011. Back then, WordPress was the king of the hill. But it is 2026 now and the web has changed. I am tired of the endless cycle of plugin updates, heavy PHP backends, and cluttered themes. Even in my coding life, I have moved away from heavy frameworks like Django in favor of FastAPI.

When I decided to restart my blog as a hobby to save my thoughts, I knew I wanted something fast and modern. Astro is the perfect fit because of its minimal JS footprint. While Astro allows you to keep markdown files in your local source folder, that can make your main build heavy over time.

Instead, I decided to use GitHub as my Headless CMS using true SSR (Server Side Rendering). This means I build the site once and it fetches the latest content from a separate GitHub repository whenever a user visits the page. No more redeploying just to fix a typo.

The Game Plan

Traditionally, you have to define every blog post detail in a local config file. If one piece of frontmatter is missing, the whole project might break. We are going to avoid that by using Octokit, the official GitHub SDK, to pull our data dynamically.

Step 1: Configure Astro for SSR

Before we write any logic, we have to tell Astro to run on a server rather than building static files. Open your astro.config.mjs and update it to enable server output and prefetching.

import { defineConfig } from 'astro/config';

export default defineConfig({
  output: 'server',
  prefetch: {
    prefetchAll: true
  },
});

Step 2: Set Up Your Content Vault

Create a new GitHub repository to act as your Content Vault. You can organize it however you want. I prefer keeping things chronological using a folder structure like: {blog\_name}/{YYYYMM}/{blog-post.md}.

Step 3: Frontmatter Specification

Every .md or .mdx file in your repository must include a YAML block at the top. This is critical because the SSR loader needs these details to build your UI without breaking.

---
title: "The Title of Your Post"
date: 2025-12-24
description: "A short, 2-sentence hook for the blog archive list."
featured_img: "[https://images.pexels.com/photos/7005491/pexels-photo-7005491.jpeg](https://images.pexels.com/photos/7005491/pexels-photo-7005491.jpeg)"
tags: ["Health", "Systems", "Curiosity"]
---

Step 4: Secure Your Connection

To let your Astro site talk to GitHub, you need a Personal Access Token:

  1. Go to GitHub Settings > Developer Settings.

  2. Select Personal Access Tokens and then Tokens (classic).

  3. Generate a new token with repo permissions and set it to No Expiration.

  4. Copy that token and paste it into your Astro project .env file as GITHUB\_TOKEN.

Step 5: The Octokit Service

We use Octokit, the official GitHub SDK, to pull data. Create a file at src/lib/octokit.ts. This script will handle fetching the list of posts and the individual content.

In this file, we initialize Octokit with your token. The getPosts function scans your folders, filters for markdown files, and even calculates a reading time automatically by counting words and dividing by an average speed of 200 words per minute.

import { Octokit } from "octokit";
import matter from "gray-matter";

export const octokit = new Octokit({
  auth: import.meta.env.GITHUB_TOKEN,
});

const REPO_DETAILS = {
  owner: "your-github-username",
  repo: "your-repo-name",
};

export const PostService = {
  async getPosts(space: string) {
    try {
      const { data: dateFolders } = await octokit.rest.repos.getContent({
        ...REPO_DETAILS,
        path: space,
      });

      if (!Array.isArray(dateFolders)) return [];

      const postGroups = await Promise.all(
        dateFolders.filter(f => f.type === "dir").map(async (folder) => {
          const { data: files } = await octokit.rest.repos.getContent({
            ...REPO_DETAILS,
            path: folder.path,
          });

          if (!Array.isArray(files)) return [];

          const contentFiles = files.filter(f => 
            f.name.toLowerCase().endsWith('.md') || 
            f.name.toLowerCase().endsWith('.mdx')
          );

          return Promise.all(contentFiles.map(async (file) => {
            const { data: rawContent } = await octokit.rest.repos.getContent({
              ...REPO_DETAILS,
              path: file.path,
              headers: { 'accept': 'application/vnd.github.v3.raw' }
            });

            const { data: frontmatter, content } = matter(rawContent as string);
            const wordCount = content.split(/\s+/).length;
            const readingTime = Math.ceil(wordCount / 200);
            const slug = file.name.replace(/\.mdx?$/, "");

            return {
              id: slug,
              folderDate: folder.name,
              fullPath: file.path,
              readingTime,
              ...frontmatter
            };
          }));
        })
      );

      const allPosts = postGroups.flat();
      return allPosts.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
    } catch (error) {
      console.error("GitHub Fetch Error:", error);
      return [];
    }
  },

  async getPostContentBySlug(space: string, slug: string) {
    const allPosts = await this.getPosts(space);
    const post = allPosts.find(p => p.id === slug);
    if (!post || !post.fullPath) return null;

    const { data } = await octokit.rest.repos.getContent({
      ...REPO_DETAILS,
      path: post.fullPath,
      headers: { 'accept': 'application/vnd.github.v3.raw' }
    });
    return data;
  }
};

Step 6: Displaying the List

In your index.astro file, you can now pull your list of posts. Since we are using SSR, this list is always fresh. You just call the getPosts function, sort them by date, and map them into your UI components.

---
import { PostService } from '@/lib/octokit';
const posts = await PostService.getPosts('travel');
---

<div class="grid grid-cols-1 md:grid-cols-2 gap-12">
  {posts.map((post) => (
    <div class="card">
       <a href={`/blog/${post.id}`}>{post.title}</a>
       <p>{post.description}</p>
    </div>
  ))}
</div>

Step 7: The Single Post Page

Create a dynamic route at src/pages/blog/\[id\].astro. By setting "export const prerender = false", you tell Astro to fetch the content from GitHub every time someone visits the URL. We use the "matter" library to parse the frontmatter and "marked" to turn the raw markdown into HTML.

---
import { PostService } from '@/lib/octokit.ts';
import matter from 'gray-matter';
import { marked } from 'marked';

export const prerender = false;

const { id } = Astro.params;
if (!id) return Astro.redirect('/404');

const rawMarkdown = await PostService.getPostContentBySlug('travel', id);
if (!rawMarkdown) return Astro.redirect('/404');

const { data, content } = matter(rawMarkdown as string);
const htmlContent = marked.parse(content);
---

<article>
  <h1>{data.title}</h1>
  <div set:html={htmlContent} />
</article>

A Word on Traffic and Limits

It is important to note that if you expect 1,000 visitors at once, you might hit the GitHub API rate limits. If your blog reaches that level of scale, it is better to move your content vault away from GitHub to a dedicated database. However, since my personal blogs do not see massive spikes and my content is centrally located, I am currently very happy with GitHub. It is free, version-controlled, and reliable for my needs.

If you want I can send the open source code for this sample Astro and Headless GitHub CMS setup below. Reach me on X @ CodingFromMars. 

from  https://web.archive.org/web/20260213170213/https://www.theonlyanil.com/dev/blog/how-to-use-github-headless-cms-astrojs

Tuesday, 17 November 2026

hermes-agent

 The agent that grows with you,

 https://hermes-agent.nousresearch.com/

Hermes Agent | Hermes Desktop

Documentation Discord License: MIT Built by Nous Research 中文 اردو Español

The self-improving AI agent built by Nous Research. It's the only agent with a built-in learning loop — it creates skills from experience, improves them during use, nudges itself to persist knowledge, searches its own past conversations, and builds a deepening model of who you are across sessions. Run it on a $5 VPS, a GPU cluster, or serverless infrastructure that costs nearly nothing when idle. It's not tied to your laptop — talk to it from Telegram while it works on a cloud VM.

Use any model you want — Nous Portal, OpenRouter, OpenAI, your own endpoint, and many others. Switch with hermes model — no code changes, no lock-in.

A real terminal interfaceFull TUI with multiline editing, slash-command autocomplete, conversation history, interrupt-and-redirect, and streaming tool output.
Lives where you doTelegram, Discord, Slack, WhatsApp, Signal, and CLI — all from a single gateway process. Voice memo transcription, cross-platform conversation continuity.
A closed learning loopAgent-curated memory with periodic nudges. Autonomous skill creation after complex tasks. Skills self-improve during use. FTS5 session search with LLM summarization for cross-session recall. Honcho dialectic user modeling. Compatible with the agentskills.io open standard.
Scheduled automationsBuilt-in cron scheduler with delivery to any platform. Daily reports, nightly backups, weekly audits — all in natural language, running unattended.
Delegates and parallelizesSpawn isolated subagents for parallel workstreams. In Desktop, choose their provider, model, and limits under Settings → Model → Subagents, then Apply the complete route. Write Python scripts that call tools via RPC, collapsing multi-step pipelines into zero-context-cost turns.
Runs anywhere, not just your laptopSix built-in terminal backends — local, Docker, SSH, Modal, Daytona, and Vercel Sandbox — plus plugin backends such as Singularity/Apptainer. Daytona and Modal offer serverless persistence — your agent's environment hibernates when idle and wakes on demand, costing nearly nothing between sessions. Run it on a $5 VPS or a GPU cluster.
Research-readyBatch trajectory generation, trajectory compression for training the next generation of tool-calling models.

Quick Install

Linux, macOS, WSL2

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

Windows (native, PowerShell)

Heads up: Native Windows runs Hermes without WSL — CLI, gateway, TUI, and tools all work natively. If you'd rather use WSL2, the Linux/macOS one-liner above works there too. Found a bug? Please file issues.

Run this in PowerShell:

iex (irm https://hermes-agent.nousresearch.com/install.ps1)

The source installer delegates Python 3.14, Node.js, npm, pnpm, ripgrep, FFmpeg, and Python dependencies to PM. If Git is absent, it stages the verified Git for Windows archive in Hermes' tool store. It does not replace your system Git. See installation methods for the separate MSIX/App Installer package and its update ownership.

Android / Termux: A signed APT repository is available for aarch64 devices, with a stable channel (tagged releases) and a prerelease canary channel. The package includes Python, Node.js, and the TUI. Use the Termux guide, not the desktop/server installer script.

Windows: Native Windows is fully supported — the PowerShell one-liner above installs everything. If you'd rather use WSL2, the Linux command works there too. Native Windows install lives under %LOCALAPPDATA%\hermes; WSL2 installs under ~/.hermes as on Linux.

After installation:

source ~/.bashrc    # reload shell (or: source ~/.zshrc)
hermes              # start chatting!

Troubleshooting

Windows Defender or antivirus flags uv.exe as malware

If your antivirus (Bitdefender, Windows Defender, etc.) quarantines uv.exe from the Hermes bin folder (%LOCALAPPDATA%\hermes\bin\uv.exe), this is a false positive. The file is Astral's uv — the Rust Python package manager Hermes bundles to manage its Python environment. ML-based antivirus engines commonly flag unsigned Rust binaries that download and install packages.

To verify your copy is authentic:

# Install GitHub CLI if needed
winget install --id GitHub.cli

# Login to GitHub
gh auth login

# Run verification
$uv = "$env:LOCALAPPDATA\hermes\bin\uv.exe"
$ver = (& $uv --version).Split(' ')[1]
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$zip = "$env:TEMP\uv.zip"
Invoke-WebRequest "https://github.com/astral-sh/uv/releases/download/$ver/uv-x86_64-pc-windows-msvc.zip" -OutFile $zip -UseBasicParsing
gh attestation verify $zip --repo astral-sh/uv
Expand-Archive $zip "$env:TEMP\uv_x" -Force
(Get-FileHash "$env:TEMP\uv_x\uv.exe").Hash -eq (Get-FileHash $uv).Hash

If attestation says "Verification succeeded" and the last line prints True, you're good.

To whitelist Hermes:

  • Windows Defender: Run PowerShell as Admin → Add-MpPreference -ExclusionPath "$env:LOCALAPPDATA\hermes\bin"
  • Bitdefender: Add an exception in the Bitdefender console (Protection > Antivirus > Settings > Manage Exceptions)
  • Whitelist the folder, not the file hash — Hermes updates uv and the hash changes every version

For more context, see the upstream Astral reports: astral-sh/uv#13553, astral-sh/uv#15011, astral-sh/uv#10079.


Getting Started

hermes              # Interactive CLI — start a conversation
hermes model        # Choose your LLM provider and model
hermes tools        # Configure which tools are enabled
hermes config set   # Set individual config values
hermes config get   # Print individual config values
hermes gateway      # Start the messaging gateway (Telegram, Discord, etc.)
hermes setup        # Run the full setup wizard (configures everything at once)
hermes update       # Update to the latest version
hermes doctor       # Diagnose any issues

📖 Full documentation →


Skip the API-key collection — Nous Portal

Hermes works with whatever provider you want — that's not changing. But if you'd rather not collect five separate API keys for the model, web search, image generation, TTS, and a cloud browser, Nous Portal covers all of them under one subscription:

  • 300+ models — pick any of them with /model <name>
  • Tool Gateway — web search, image generation (FAL), text-to-speech (OpenAI), cloud browser (Browser Use), all routed through your sub. No extra accounts.

One command from a fresh install:

hermes setup --portal

That logs you in via OAuth, sets Nous as your provider, and turns on the Tool Gateway. Check what's wired up any time with hermes portal info. Full details on the Tool Gateway docs page.

You can still bring your own keys per-tool whenever you want — the gateway is per-backend, not all-or-nothing.


CLI vs Messaging Quick Reference

Hermes has two entry points: start the terminal UI with hermes, or run the gateway and talk to it from Telegram, Discord, Slack, WhatsApp, Signal, or Email. Once you're in a conversation, many slash commands are shared across both interfaces.

Action CLI Messaging platforms
Start chatting hermes Run hermes gateway setup + hermes gateway start, then send the bot a message
Start fresh conversation /new or /reset /new or /reset
Change model /model [provider:model] /model [provider:model]
Set a personality /personality [name] /personality [name]
Retry or undo the last turn /retry, /undo /retry, /undo
Compress context / check usage /compress, /usage, /insights [--days N] /compress, /usage, /insights [days]
Browse skills /skills or /<skill-name> /<skill-name>
Interrupt current work Ctrl+C or send a new message /stop or send a new message
Platform-specific status /platforms /status, /sethome

For the full command lists, see the CLI guide and the Messaging Gateway guide.


Documentation

All documentation lives at hermes-agent.nousresearch.com/docs:

Section What's Covered
Quickstart Install → setup → first conversation in 2 minutes
CLI Usage Commands, keybindings, personalities, sessions
Configuration Config file, providers, models, all options
Messaging Gateway Telegram, Discord, Slack, WhatsApp, Signal, Home Assistant
Security Command approval, DM pairing, container isolation
Tools & Toolsets 40+ tools, toolset system, terminal backends
Skills System Procedural memory, Skills Hub, creating skills
Memory Persistent memory, user profiles, best practices
MCP Integration Connect any MCP server for extended capabilities
Cron Scheduling Scheduled tasks with platform delivery
Context Files Project context that shapes every conversation
Architecture Project structure, agent loop, key classes
Contributing Development setup, PR process, code style
CLI Reference All commands and flags
Environment Variables Complete env var reference

Migrating from OpenClaw or another agent

If you're coming from OpenClaw, Claude Code, Codex CLI or Cursor, Hermes can import your settings, memories and skills (and, for OpenClaw, API keys when you ask for them).

During setup: hermes setup asks whether to import from another agent, pre-selects the ones it finds (~/.openclaw, ~/.claude, ~/.codex, ~/.cursor), installs the official agent-importers plugin and runs the import with a preview first.

Anytime after install:

hermes plugins install agent-importers          # once per profile
hermes import-agent openclaw                    # interactive migration (full preset)
hermes import-agent openclaw --dry-run          # preview what would be migrated
hermes import-agent openclaw --migrate-secrets  # also bring allowlisted API keys
hermes import-agent claude-code                 # or codex / cursor

What gets imported from OpenClaw:

  • SOUL.md — persona file
  • Memories — MEMORY.md and USER.md entries
  • Skills — user-created skills → ~/.hermes/skills/openclaw-imports/
  • Command allowlist — approval patterns
  • Messaging settings — platform configs, allowed users, working directory
  • API keys — allowlisted secrets (Telegram, OpenRouter, OpenAI, Anthropic, ElevenLabs), only with --migrate-secrets
  • TTS assets — workspace audio files
  • Workspace instructions — AGENTS.md (with --workspace-target)

hermes claw migrate still works as the older spelling. See the OpenClaw migration guide and Import from Other Agents.

Contributing

We welcome contributions! See the Contributing Guide for development setup, code style, and PR process.

Start with the PM developer workflow for activation, daily use, dependency changes, and leaving the environment. Development Setup covers the separate test environment and verification commands.

from  https://github.com/NousResearch/hermes-agent

-------

相关帖子:

Ollama 原生支持 Hermes Agent 了!一行命令,本地跑起完整 AI Agent

让instinct帮我搭建基于cloudflare workers的博客程序kcwb

 我用github a/c: brightmann@gmail.com授权登录cloudflare.com

下面是我跟 instinct的对话记录:

me: can u build https://github.com/brightmann/kcwb?

 

得到的博客地址:https://kcwb.brightmann.workers.dev/

项目地址:

 https://github.com/kasuganosoras/cloudflare-worker-blog

 https://github.com/brightmann/kcwb

访问 https://github.com/brightmann/kcwb/tree/master/posts,在此处新建源帖fh.md,内容为:

# 战马

此处写正文或html code

然后,编辑https://github.com/brightmann/kcwb/blob/master/list.json文件,加入下面的内容:

  {
        "title": "战马",
        "time": "2026-11-17",
        "file": "posts/fh.md"
   },

然后,稍等2分钟,博客https://kcwb.brightmann.workers.dev/就会更新。