agent-fetch


Nameagent-fetch JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryCLI tool for fetching AGENTS.md files from GitHub
upload_time2025-09-03 18:46:37
maintainerFreeMarketaMilitia
docs_urlNone
authorFreeMarketamilitia
requires_python>=3.9
licenseMIT
keywords agents cli documentation fetch github
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # agent-fetch

A Python command-line tool for fetching `AGENTS.md` files (or other markdown/docs) from GitHub repositories.

## 🚀 Features

- **Interactive-first**: Default command triggers beautiful interactive file selection
- **Flexible Automation**: Flags let advanced users skip interaction with `--all`, `--name`, or `--repo`
- **Configurable Defaults**: Global default repo stored in config with branch overrides
- **Beautiful UI**: Colorful menus with arrow key navigation and fuzzy search using `questionary`
- **Cross-platform**: Works on Linux, macOS, and Windows

## 📦 Installation

```bash
# Option 1: Traditional pip installation
pip install -e .

# Option 2: Modern uv installation (recommended)
uv pip install -e .
```

## 🎯 Quick Start

### Default Setup (No Configuration Required)
The tool comes with a pre-configured default repository and works immediately:

```bash
# Interactive mode (with default repo)
agentfetch
```

### Change Default Repository (Optional)
If you want to use a different repository:

```bash
agentfetch set-repo https://github.com/your-org/docs
```

### Quick Usage Examples

```bash
# Interactive mode (default)
agentfetch

# Fetch all files from default repo
agentfetch main --all

# Search for specific files
agentfetch main --name "api"  # Fuzzy matching

# Use different repository
agentfetch main --all --repo https://github.com/org/docs
```

### Expected Interactive Output
```
📁 Files in index.yaml
Select files to fetch using ↑/↓ arrows, space to select, enter to confirm

❯ Python APIs Guide
  Shadcn UI Components Guide
  Next.js App APIs Guide
```

## 📋 Commands

| Command | Description |
|---------|-------------|
| `agentfetch` | Interactive mode (default) |
| `agentfetch --all` | Fetch all files |
| `agentfetch --name <query>` | Fetch by name (fuzzy matching) |
| `agentfetch --repo <url>` | Fetch from alternate repo |
| `agentfetch --branch <branch>` | Fetch from specific branch |
| `agentfetch --no-overwrite` | Skip existing files |
| `agentfetch set-repo <url>` | Set global default repo |
| `agentfetch show-repo` | Display current config |
| `agentfetch list` | List files in index.yaml |
| `agentfetch validate` | Validate index.yaml |

## 🔧 Configuration

Configuration is stored in:
- **Linux/macOS**: `~/.agentfetch/config.yaml`
- **Windows**: `%APPDATA%\agentfetch\config.yaml`

Example config:
```yaml
default_repo: "https://github.com/org/agents"
default_branch: "main"
```

## 📁 Index File Specification

The tool expects an `index.yaml` file in the repository root with this structure:

```yaml
agents:
  - name: "Root Guide"           # Human-readable name
    source: "AGENTS.md"          # Repo-relative path
    target: "downloads/root.md"  # Local destination

  - name: "API Guide"
    source: "services/api/AGENTS.md"
    target: "downloads/api.md"
```

## 🔍 Example Workflows

### Standard Development Workflow
```bash
# Set up default repository
agentfetch set-repo https://github.com/your-org/docs

# Interactive selection for daily use
agentfetch

# Automate fetching all docs
agentfetch --all

# Fetch specific documentation
agentfetch --name "user guide"
```

### CI/CD Integration
```bash
# Non-interactive batch operation
agentfetch --all --repo https://github.com/org/docs --branch main
```

### Multi-Repository Setup
```bash
# Fetch from monorepo
agentfetch --repo https://github.com/org/monorepo

# Fetch from specific branch
agentfetch --repo https://github.com/org/monorepo --branch feature/new-docs
```

## 🛠️ Development

This tool is modular and easily extensible, following Python best practices with:

- **OOP Design**: Clean class-based architecture
- **Separation of Concerns**: Config, fetching, parsing, and UI as separate modules
- **Robust Error Handling**: Comprehensive error handling throughout
- **Rich UI**: Beautiful, colorful console output with Rich

### Project Structure
```
agents_collector/
├── config/              # Configuration management
├── fetcher/             # GitHub fetching logic
├── parser/              # Index file parsing
├── cli/                 # Command-line interface
├── ui/                  # Interactive UI components
└── __init__.py
```

### Dependencies
- `typer`: CLI framework
- `pyyaml`: YAML parsing
- `requests`: HTTP client
- `questionary`: Interactive menus
- `rapidfuzz`: Fuzzy matching
- `rich`: Beautiful console output

## 🤝 Contributing

The tool follows a modular architecture that makes it easy to:
- Add new fetcher backends (GitLab, local files, etc.)
- Extend interactive selection features
- Add new CLI commands
- Support additional index file formats

## 📄 License

MIT License

---

## 🎉 Why agent-fetch?

This tool makes it simple to **collect, organize, and update** `AGENTS.md` files across monorepos or multiple projects, ensuring consistency for both developers and coding agents.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "agent-fetch",
    "maintainer": "FreeMarketaMilitia",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "agents, cli, documentation, fetch, github",
    "author": "FreeMarketamilitia",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/15/f6/9d2524e32ac112f7d1d7359771a8af478c29b4b3d583411465b96cc4c823/agent_fetch-0.1.0.tar.gz",
    "platform": null,
    "description": "# agent-fetch\n\nA Python command-line tool for fetching `AGENTS.md` files (or other markdown/docs) from GitHub repositories.\n\n## \ud83d\ude80 Features\n\n- **Interactive-first**: Default command triggers beautiful interactive file selection\n- **Flexible Automation**: Flags let advanced users skip interaction with `--all`, `--name`, or `--repo`\n- **Configurable Defaults**: Global default repo stored in config with branch overrides\n- **Beautiful UI**: Colorful menus with arrow key navigation and fuzzy search using `questionary`\n- **Cross-platform**: Works on Linux, macOS, and Windows\n\n## \ud83d\udce6 Installation\n\n```bash\n# Option 1: Traditional pip installation\npip install -e .\n\n# Option 2: Modern uv installation (recommended)\nuv pip install -e .\n```\n\n## \ud83c\udfaf Quick Start\n\n### Default Setup (No Configuration Required)\nThe tool comes with a pre-configured default repository and works immediately:\n\n```bash\n# Interactive mode (with default repo)\nagentfetch\n```\n\n### Change Default Repository (Optional)\nIf you want to use a different repository:\n\n```bash\nagentfetch set-repo https://github.com/your-org/docs\n```\n\n### Quick Usage Examples\n\n```bash\n# Interactive mode (default)\nagentfetch\n\n# Fetch all files from default repo\nagentfetch main --all\n\n# Search for specific files\nagentfetch main --name \"api\"  # Fuzzy matching\n\n# Use different repository\nagentfetch main --all --repo https://github.com/org/docs\n```\n\n### Expected Interactive Output\n```\n\ud83d\udcc1 Files in index.yaml\nSelect files to fetch using \u2191/\u2193 arrows, space to select, enter to confirm\n\n\u276f Python APIs Guide\n  Shadcn UI Components Guide\n  Next.js App APIs Guide\n```\n\n## \ud83d\udccb Commands\n\n| Command | Description |\n|---------|-------------|\n| `agentfetch` | Interactive mode (default) |\n| `agentfetch --all` | Fetch all files |\n| `agentfetch --name <query>` | Fetch by name (fuzzy matching) |\n| `agentfetch --repo <url>` | Fetch from alternate repo |\n| `agentfetch --branch <branch>` | Fetch from specific branch |\n| `agentfetch --no-overwrite` | Skip existing files |\n| `agentfetch set-repo <url>` | Set global default repo |\n| `agentfetch show-repo` | Display current config |\n| `agentfetch list` | List files in index.yaml |\n| `agentfetch validate` | Validate index.yaml |\n\n## \ud83d\udd27 Configuration\n\nConfiguration is stored in:\n- **Linux/macOS**: `~/.agentfetch/config.yaml`\n- **Windows**: `%APPDATA%\\agentfetch\\config.yaml`\n\nExample config:\n```yaml\ndefault_repo: \"https://github.com/org/agents\"\ndefault_branch: \"main\"\n```\n\n## \ud83d\udcc1 Index File Specification\n\nThe tool expects an `index.yaml` file in the repository root with this structure:\n\n```yaml\nagents:\n  - name: \"Root Guide\"           # Human-readable name\n    source: \"AGENTS.md\"          # Repo-relative path\n    target: \"downloads/root.md\"  # Local destination\n\n  - name: \"API Guide\"\n    source: \"services/api/AGENTS.md\"\n    target: \"downloads/api.md\"\n```\n\n## \ud83d\udd0d Example Workflows\n\n### Standard Development Workflow\n```bash\n# Set up default repository\nagentfetch set-repo https://github.com/your-org/docs\n\n# Interactive selection for daily use\nagentfetch\n\n# Automate fetching all docs\nagentfetch --all\n\n# Fetch specific documentation\nagentfetch --name \"user guide\"\n```\n\n### CI/CD Integration\n```bash\n# Non-interactive batch operation\nagentfetch --all --repo https://github.com/org/docs --branch main\n```\n\n### Multi-Repository Setup\n```bash\n# Fetch from monorepo\nagentfetch --repo https://github.com/org/monorepo\n\n# Fetch from specific branch\nagentfetch --repo https://github.com/org/monorepo --branch feature/new-docs\n```\n\n## \ud83d\udee0\ufe0f Development\n\nThis tool is modular and easily extensible, following Python best practices with:\n\n- **OOP Design**: Clean class-based architecture\n- **Separation of Concerns**: Config, fetching, parsing, and UI as separate modules\n- **Robust Error Handling**: Comprehensive error handling throughout\n- **Rich UI**: Beautiful, colorful console output with Rich\n\n### Project Structure\n```\nagents_collector/\n\u251c\u2500\u2500 config/              # Configuration management\n\u251c\u2500\u2500 fetcher/             # GitHub fetching logic\n\u251c\u2500\u2500 parser/              # Index file parsing\n\u251c\u2500\u2500 cli/                 # Command-line interface\n\u251c\u2500\u2500 ui/                  # Interactive UI components\n\u2514\u2500\u2500 __init__.py\n```\n\n### Dependencies\n- `typer`: CLI framework\n- `pyyaml`: YAML parsing\n- `requests`: HTTP client\n- `questionary`: Interactive menus\n- `rapidfuzz`: Fuzzy matching\n- `rich`: Beautiful console output\n\n## \ud83e\udd1d Contributing\n\nThe tool follows a modular architecture that makes it easy to:\n- Add new fetcher backends (GitLab, local files, etc.)\n- Extend interactive selection features\n- Add new CLI commands\n- Support additional index file formats\n\n## \ud83d\udcc4 License\n\nMIT License\n\n---\n\n## \ud83c\udf89 Why agent-fetch?\n\nThis tool makes it simple to **collect, organize, and update** `AGENTS.md` files across monorepos or multiple projects, ensuring consistency for both developers and coding agents.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI tool for fetching AGENTS.md files from GitHub",
    "version": "0.1.0",
    "project_urls": {
        "Repository": "https://github.com/FreeMarketamilitia/agent-fetch"
    },
    "split_keywords": [
        "agents",
        " cli",
        " documentation",
        " fetch",
        " github"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "84f8eef97a6a6e58b6692b4d020e82ee1705e373a63c25d7d23bd0d378c66667",
                "md5": "7cf23238fa401d6c5cde3f8d37ef8f3d",
                "sha256": "786a814f093385b317e0af408a7061043504e2bbb7871d3287fc1d6dc0bef4d3"
            },
            "downloads": -1,
            "filename": "agent_fetch-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7cf23238fa401d6c5cde3f8d37ef8f3d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 21227,
            "upload_time": "2025-09-03T18:46:36",
            "upload_time_iso_8601": "2025-09-03T18:46:36.266162Z",
            "url": "https://files.pythonhosted.org/packages/84/f8/eef97a6a6e58b6692b4d020e82ee1705e373a63c25d7d23bd0d378c66667/agent_fetch-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "15f69d2524e32ac112f7d1d7359771a8af478c29b4b3d583411465b96cc4c823",
                "md5": "2a6b45644542b2b2a44364dfe6200ad2",
                "sha256": "5ec0dd28debd4a501f9d0f2d8ec049fa4a1679ad35192a03551108ab1ef66bac"
            },
            "downloads": -1,
            "filename": "agent_fetch-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2a6b45644542b2b2a44364dfe6200ad2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 14476,
            "upload_time": "2025-09-03T18:46:37",
            "upload_time_iso_8601": "2025-09-03T18:46:37.664674Z",
            "url": "https://files.pythonhosted.org/packages/15/f6/9d2524e32ac112f7d1d7359771a8af478c29b4b3d583411465b96cc4c823/agent_fetch-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-03 18:46:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FreeMarketamilitia",
    "github_project": "agent-fetch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "agent-fetch"
}
        
Elapsed time: 3.80844s