hnl

forgejo-claude (0.1.1)

Published 2026-03-19 12:01:32 +00:00 by hnl

Installation

pip install --index-url  forgejo-claude

About this package

Natural-language interface for Forgejo powered by Claude

forgejo-claude

A natural-language interface for your Forgejo instance, powered by Claude.

Exposes Forgejo API operations as Claude tools so you can browse repos, manage issues, and more by just describing what you want.

forgejo-claude "show all open P0 bugs in money_manager"
forgejo-claude "create an issue in hnl/task_tracker: add dark mode support"
forgejo-claude   # interactive REPL

Features

  • Typed Forgejo API client — clean wrapper over the Forgejo v1 REST API using requests + dataclasses; no unmaintained third-party packages
  • Claude tool calling — Forgejo operations exposed as tools; Claude runs an agentic loop to answer multi-step queries
  • Interactive REPL — persistent conversation history within a session
  • Single-shot mode — pass a prompt as CLI args for scripting
  • Cross-platform — works on macOS and Linux; isolated venv, no system Python pollution
  • Portable — copy ~/.forgejo_claude/ to any machine and run setup.sh

Installation

# 1. Clone (or copy) to ~/.forgejo_claude
git clone https://git.bitvektor.net/hnl/forgejo-claude ~/.forgejo_claude

# 2. Bootstrap
bash ~/.forgejo_claude/setup.sh

setup.sh creates a venv, installs dependencies, and symlinks ~/bin/forgejo-claude.

Make sure ~/bin is on your PATH (add to ~/.zshrc or ~/.bashrc):

export PATH="$HOME/bin:$PATH"

Configuration

Create ~/.forgejo_claude/.env (never committed):

FORGEJO_TOKEN=your_token_here
FORGEJO_BASE=https://git.example.com
ANTHROPIC_API_KEY=your_key_here

The .env file is sourced automatically by the launcher. You can also set these as regular environment variables — they take precedence.

Required token scopes

Scope Purpose
read:repository List repos, read issues
write:repository Create/edit issues, add comments
write:user Create new repositories via API

Usage

# Single-shot
forgejo-claude "list all repos with open issues"
forgejo-claude "what are the P0 bugs in hnl/money_manager?"
forgejo-claude "close issue #3 in hnl/money_manager"

# Interactive REPL (maintains conversation context)
forgejo-claude
you> show open issues across all my repos
you> create a new issue in hnl/podcast_transcriber: add batch processing
you> exit

Available tools

Claude can call these Forgejo operations:

Tool Description
list_repos List all accessible repositories
list_issues List issues in a repo (open/closed/all)
get_issue Get full details of a single issue
create_issue Create a new issue
close_issue Close an open issue
reopen_issue Reopen a closed issue
edit_issue Edit title or body
add_comment Post a comment
list_labels List labels in a repo

Development

# Run tests
~/.forgejo_claude/venv/bin/python -m pytest tests/ -v

# All tests use mocks — no live API calls needed

Dependencies: anthropic, requests, pytest (see requirements.txt).


Portability

To set up on a new machine (Linux or macOS):

git clone https://git.bitvektor.net/hnl/forgejo-claude ~/.forgejo_claude
bash ~/.forgejo_claude/setup.sh
# then create ~/.forgejo_claude/.env with your tokens

Requirements

Requires Python: >=3.11
Details
PyPI
2026-03-19 12:01:32 +00:00
4
MIT
23 KiB
Assets (2)
Versions (2) View all
0.1.1 2026-03-19
0.1.0 2026-03-19