docs(blog): Update Forgejo CLI article and agent shell session selection

- 2026-02-01: Clarify and refine wording and steps in the Forgejo CLI guide
- 2026-03-01: Add and adjust explanation for agent shell session selection

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Daisuke Nakahara 2026-03-01 19:50:23 +09:00
parent c3a0a5c434
commit b1176331ae
2 changed files with 14 additions and 14 deletions

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:
```bash
```shellsession
$ fj version
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
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
```
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
```
```bash
```shellsession
$ fj auth list
username@git.example.com
```
```bash
```shellsession
$ fj -H git.example.com whoami
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
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>
```
To search for issues in a specific repository, use `fj issue search`. The `--repo` option is required:
```bash
```shellsession
$ 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:
```bash
```shellsession
$ fj -H git.example.com issue close <ISSUE> -w <WITH_MSG>
```
## 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:
```bash
```shellsession
$ 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`:
```bash
```shellsession
$ fj pr search -r <REPO> -s <STATE>
```
@ -114,7 +114,7 @@ You can access help for any command using the `--help` flag.
# Logging Out
Logout from a host with `fj auth logout`:
```bash
```shellsession
$ fj auth list
username@git.example.com
$ fj auth logout git.example.com

View file

@ -15,7 +15,7 @@ By default, starting agent-shell creates a new session. However, with the follow
## Prerequisites
```bash
```shellsession
$ emacs --version
GNU Emacs 30.2
Development version 636f166cfc86 on HEAD branch; build date 2025-12-14.
@ -28,7 +28,7 @@ For more information about these matters, see the file named COPYING.
This article assumes the use of Copilot CLI.
```bash
```shellsession
$ copilot --version
GitHub Copilot CLI 0.0.420.
Run 'copilot update' to check for updates.
@ -45,7 +45,7 @@ agent-shell v0.43.1
Set the value of `agent-shell-session-strategy` to `prompt`.
Here is an example configuration in `init.el`:
```elisp
```emacs-lisp
(use-package agent-shell
:custom
(agent-shell-session-strategy 'prompt)