Merge pull request 'docs: Add agent-shell session selection article, update Forgejo CLI guide, and improve theme/code styling' (#14) from develop into main

Reviewed-on: #14
This commit is contained in:
Daisuke Nakahara 2026-03-01 10:53:58 +00:00
commit 08adcaed6e
5 changed files with 91 additions and 46 deletions

View file

@ -28,7 +28,23 @@ This is a personal blog named "Naputo" built with Astro and Preact. The blog is
## Development Guidelines ## Development Guidelines
### Recommended Development Setup
**Development via Podman (Recommended)**: This repository is designed to be developed inside a Podman container for consistency and reproducibility. See README.md for complete container setup instructions.
- Run `podman compose up --build` to start development
- Run commands in the container with `podman compose exec app <command>`
- This keeps your host environment clean and ensures reproducible builds
### Commands ### Commands
#### Local Development (with Podman - Recommended)
- `podman compose up --build`: Start development container with auto-rebuild
- `podman compose up -d`: Start development container in background
- `podman compose exec app npm run dev`: Start dev server inside container
- `podman compose exec app npm run build`: Build inside container
#### Direct Commands (without Podman)
- `npm install`: Install dependencies - `npm install`: Install dependencies
- `npm run dev`: Start local development server at `localhost:4321` - `npm run dev`: Start local development server at `localhost:4321`
- `npm run build`: Build production site to `./dist/` - `npm run build`: Build production site to `./dist/`

View file

@ -1,33 +0,0 @@
---
name: commit-message-generator
description: Generate appropriate commit messages based on Git diffs
---
## Prerequisites
- This Skill retrieves Git diffs and suggests meaningful commit messages
- Message format should follow Conventional Commits
- Commit messages should have a one-line Conventional Commits header, an optional blank second line, and from the third line onward include a bulleted list summarizing the changes
- Commit messages should be in English
- **Never perform Git commit or Git push**
## Steps
1. Run `git status` to check modified files
2. Retrieve diffs with `git diff` or `git diff --cached`
3. Analyze the diff content and determine if changes should be split into multiple commits
4. For each logical group of changes:
- List the target files
- Generate a message in English compliant with Conventional Commits
- Suggest the command: `git add <files> && git commit -m "<message>"`
5. If changes are extensive and should be split, provide:
- Rationale for the split
- Multiple commit suggestions with their respective target files and messages
## Commit Splitting Guidelines
- Split commits when changes span multiple logical concerns (e.g., feature + refactoring)
- Group related files that serve the same purpose
- Keep each commit focused on a single, atomic change
## Notes
- **This Skill must never execute `git commit` or `git push`**
- Only suggest commands; execution is entirely at user's discretion
- Users must explicitly perform commits and pushes themselves

View file

@ -38,7 +38,7 @@ I installed it on a Linux environment using Nix's home-manager. The Nix 25.11 pa
``` ```
forgejo-cli is launched with the `fj` command: forgejo-cli is launched with the `fj` command:
```bash ```shellsession
$ fj version $ fj version
fj v0.3.0 fj v0.3.0
``` ```
@ -56,20 +56,20 @@ Generate a token from Forgejo's frontend at Settings > Applications > Access tok
# Logging In with a Token # Logging In with a Token
I stored the generated token in [gnome-keyring](https://gitlab.gnome.org/GNOME/gnome-keyring) first: I stored the generated token in [gnome-keyring](https://gitlab.gnome.org/GNOME/gnome-keyring) first:
```bash ```shellsession
$ echo -n "MY_FORGEJO_PAT" | secret-tool store --label="Forgejo PAT" service forgejo user username@git.example.com $ echo -n "MY_FORGEJO_PAT" | secret-tool store --label="Forgejo PAT" service forgejo user username@git.example.com
``` ```
Register the key using the `auth add-key` subcommand. Note that you must specify the host with `-H git.example.com`; otherwise, it defaults to `github.com`: Register the key using the `auth add-key` subcommand. Note that you must specify the host with `-H git.example.com`; otherwise, it defaults to `github.com`:
```bash ```shellsession
$ echo -n "$(secret-tool lookup service forgejo user username@git.example.com)" | fj -H git.example.com auth add-key username $ echo -n "$(secret-tool lookup service forgejo user username@git.example.com)" | fj -H git.example.com auth add-key username
``` ```
```bash ```shellsession
$ fj auth list $ fj auth list
username@git.example.com username@git.example.com
``` ```
```bash ```shellsession
$ fj -H git.example.com whoami $ fj -H git.example.com whoami
currently signed in to username@git.example.com currently signed in to username@git.example.com
``` ```
@ -81,29 +81,29 @@ The v0.3.0 `fj` provides `issue` and `pr` commands for managing issues and pull
## Issues ## Issues
Create an issue with `fj issue create`. Note that the `-H` flag for specifying the host must come before the subcommand: Create an issue with `fj issue create`. Note that the `-H` flag for specifying the host must come before the subcommand:
```bash ```shellsession
$ fj -H git.example.com issue create --repo <REPO> [TITLE] --body <BODY> $ fj -H git.example.com issue create --repo <REPO> [TITLE] --body <BODY>
``` ```
To search for issues in a specific repository, use `fj issue search`. The `--repo` option is required: To search for issues in a specific repository, use `fj issue search`. The `--repo` option is required:
```bash ```shellsession
$ fj issue search --repo <REPO> $ fj issue search --repo <REPO>
``` ```
To view issue details, use `fj issue view <ISSUE> body`. Replace `<ISSUE>` with the issue number. You can also close issues using the `-w` option to include a comment. Interestingly, this command works correctly without requiring the repository name: To view issue details, use `fj issue view <ISSUE> body`. Replace `<ISSUE>` with the issue number. You can also close issues using the `-w` option to include a comment. Interestingly, this command works correctly without requiring the repository name:
```bash ```shellsession
$ fj -H git.example.com issue close <ISSUE> -w <WITH_MSG> $ fj -H git.example.com issue close <ISSUE> -w <WITH_MSG>
``` ```
## Pull Requests ## Pull Requests
Create a pull request with `fj pr create`. This creates a pull request requesting to merge the `<HEAD>` branch into the `<BASE>` branch: Create a pull request with `fj pr create`. This creates a pull request requesting to merge the `<HEAD>` branch into the `<BASE>` branch:
```bash ```shellsession
$ fj pr create --repo <REPO> --base <BASE> --head <HEAD> [TITLE] --body <BODY> $ fj pr create --repo <REPO> --base <BASE> --head <HEAD> [TITLE] --body <BODY>
``` ```
List pull requests using `fj pr search`. You can filter by state using the `-s` option with either `open` or `closed`: List pull requests using `fj pr search`. You can filter by state using the `-s` option with either `open` or `closed`:
```bash ```shellsession
$ fj pr search -r <REPO> -s <STATE> $ fj pr search -r <REPO> -s <STATE>
``` ```
@ -114,7 +114,7 @@ You can access help for any command using the `--help` flag.
# Logging Out # Logging Out
Logout from a host with `fj auth logout`: Logout from a host with `fj auth logout`:
```bash ```shellsession
$ fj auth list $ fj auth list
username@git.example.com username@git.example.com
$ fj auth logout git.example.com $ fj auth logout git.example.com

View file

@ -0,0 +1,59 @@
---
title: 'How to Select Sessions When Starting the agent-shell ACP Client Running on Emacs'
pubDate: 2026-03-01
author: 'Nakahara Daisuke'
tags: ["Emacs"]
---
I recently returned to Emacs, motivated by CLI-type AI tools like [GitHub Copilot CLI](https://github.com/github/copilot-cli).
Copilot CLI supports ACP (Agentic Communication Protocol), which enables communication between AI agents and editors ([GitHub official documentation](https://docs.github.com/en/copilot/reference/acp-server)).
And [agent-shell](https://github.com/xenodium/agent-shell) is an ACP client that runs on Emacs.
agent-shell can be started with `M-x agent-shell`.
By default, starting agent-shell creates a new session. However, with the following configuration change, you can choose to create a new session or select from past sessions when starting. I'll introduce this configuration.
## Prerequisites
```shellsession
$ emacs --version
GNU Emacs 30.2
Development version 636f166cfc86 on HEAD branch; build date 2025-12-14.
Copyright (C) 2025 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
```
This article assumes the use of Copilot CLI.
```shellsession
$ copilot --version
GitHub Copilot CLI 0.0.420.
Run 'copilot update' to check for updates.
```
After starting Emacs, the result of running `M-x agent-shell-version` is as follows:
```
agent-shell v0.43.1
```
## Method
Set the value of `agent-shell-session-strategy` to `prompt`.
Here is an example configuration in `init.el`:
```emacs-lisp
(use-package agent-shell
:custom
(agent-shell-session-strategy 'prompt)
:ensure t)
```
With this configuration, you can create a new session or select from history in the minibuffer. Selecting a new session behaves the same as the default behavior, but selecting a past session allows you to resume work in that session's context. This enables you to efficiently manage multiple different projects and tasks.
---
> **Note**: The review and translation were assisted by an AI generative model. The author is responsible for the final content.

View file

@ -130,7 +130,10 @@ pre {
overflow-x: auto; overflow-x: auto;
} }
html.dark pre { html.dark .astro-code,
background-color: #1e293b !important; html.dark .astro-code span {
color: var(--shiki-dark) !important;
background-color: var(--shiki-dark-bg) !important;
} }