Total Pageviews

Wednesday, 18 November 2026

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/就会更新。

 

windmill

 Code-first platform for workflows, apps and AI agents, on the fastest self-hostable orchestrator (benchmarked against Airflow, Prefect and Temporal). Business teams build with AI, engineers control what ships. Open-source alternative to Lovable, Retool and n8n.

 https://windmill.dev/

 

Open-source, self-hostable code-first platform for workflows, apps and AI agents, running on the fastest self-hostable orchestrator. Engineers write code in 20+ languages and sync it with Git. Business teams build on the same platform with AI, while review, promotion between environments and isolated workers keep engineers in control of what ships. Self-hostable alternative to Lovable, Retool, n8n and a simplified Temporal.

Scripts are turned into sharable UIs, APIs and cron jobs automatically, and can be composed together into flows, data pipelines, AI agents or full-code React and Svelte apps. Supported languages: Python, TypeScript, Go, Bash, SQL, GraphQL, PowerShell, Rust, and more.

Package version Docker Image CI Package version

Commit activity Discord Shield

Try it - Website - Docs - Discord - Hub - Contributing

Windmill - Code-first platform for workflows, apps and AI agents

Windmill is fully open-sourced (AGPLv3) and Windmill Labs offers dedicated instances and commercial support and licenses.

Windmill Diagram

readme_video.mp4

Build with AI, ship with review

Business teams and engineers build on the same Windmill instance. What the AI builds is an ordinary script, flow or app, and goes through the same review as code written by engineers:

  • AI sessions build scripts, flows and apps with AI in a workspace fork, with a live preview and a diff to review before deploying.
  • Workspace roles decide what each team can author, and folders scope the resources, skills and MCP servers its AI can reach.
  • Protection rulesets block direct deployment, so changes reach production only after an engineer reviews and deploys them.
  • Dev workspaces keep their own credentials, and promote to prod through Compare & Deploy or a Git pull request.
  • Worker groups run AI-built code on its own workers, or on a separate instance.

See let business teams build with AI safely for the full setup. Engineers keep writing code locally with the CLI, the VS Code extension and their coding agent, synced with Git.

Main Concepts

  1. Define a minimal and generic script in Python, TypeScript, Go or Bash that solves a specific task. The code can be defined in the provided Web IDE or synchronized with your own GitHub repo (e.g. through VS Code extension): provided Web IDE or synchronized with your own GitHub repo (e.g. through VS Code extension).

from  https://github.com/windmill-labs/windmill

opencode, The open source AI coding agent.


 https://opencode.ai/

OpenCode Terminal UI


Installation

# YOLO
curl -fsSL https://opencode.ai/v2/install | bash

# Package managers
npm i -g @opencode/cli@latest      # or bun/pnpm/yarn
brew install anomalyco/tap/opencode-v2 # macOS and Linux (recommended, always up to date)
brew install opencode              # macOS and Linux (official brew formula, updated less)
sudo pacman -S opencode            # Arch Linux (Stable)
paru -S opencode-beta              # Arch Linux (Latest from AUR)
mise use -g opencode               # Any OS
nix run github:anomalyco/opencode  # Nix

Tip

Remove versions older than 0.1.x before installing.

Desktop App (BETA)

OpenCode is also available as a desktop application. Download it from opencode.ai/download.

Platform Download
macOS (Apple Silicon) opencode-desktop-mac-arm64.dmg
macOS (Intel) opencode-desktop-mac-x64.dmg
Windows opencode-desktop-win-x64.exe
Linux .deb, .rpm, or .AppImage
# macOS (Homebrew)
brew install --cask opencode-desktop

Installation Directory

The install script installs OpenCode to $HOME/.opencode/bin.

Agents

OpenCode includes two built-in agents you can switch between with the Tab key.

  • build - Default, full-access agent for development work
  • plan - Read-only agent for analysis and code exploration
    • Denies file edits by default
    • Asks permission before running bash commands
    • Ideal for exploring unfamiliar codebases or planning changes

Also included is a general subagent for complex searches and multistep tasks. This is used internally and can be invoked using @general in messages.

Learn more about agents.

Documentation

For more info on how to configure OpenCode, head over to our docs.

Building on OpenCode

If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.

from  https://github.com/anomalyco/opencode

Monday, 16 November 2026

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


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

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





my Osmium Database Template url:

https://app.notion.com/p/37b63c580eea83018dd6810fdede8a3c

notion config page url:

https://app.notion.com/p/Config-b7b63c580eea823b999581b17d2e73d3

不过instinct在第5张截图里,对我说:这个notion config page里的"sortByDate"的值即使设为true, 也是不起作用的。它修改了lib/server/database.ts文件后,才使得博客帖子按发表的时间顺序排列。

我得到的博客地址: 

https://om-stc1.onrender.com/

仓库 https://github.com/brightmann/om的代码被instinct修正了。

我用email id: ymbrite@gmail.com + 邮箱验证码登录了vercel.com,于是我也用ymbrite@gmail.com登录了github.com, 然后对https://github.com/brightmann/om进行fork, 得到项目地址https://github.com/ymbrite/om 。

我 登录了vercel.com后,访问vercel.com/new, 导入项目https://github.com/ymbrite/om 。在输入命令的栏里,输入:

pnpm build

pnpm install

在environment variables处,输入环境变量NOTION_DATABASE_ID ,其值设为 

37b63c580eea83018dd6810fdede8a3c

然后点击底部的deploy按钮,等待部署完成。部署完成后,我得到网址https://om-eta-red.vercel.app/

 

项目地址:

 https://github.com/osmium-blog/osmium

 https://github.com/brightmann/om

 https://github.com/ymbrite/om 

博客地址:

 https://om-stc1.onrender.com/

https://om-eta-red.vercel.app/

 

 

黄仁勋的出轨:中美AI暗战