import

import is a command for coding agents from babarot/gh-infra. It costs 0 tokens per session (2,093 once invoked), scanned A, original, MIT.

An import command that exports existing GitHub repository settings as YAML manifests. It can also update existing local manifests with the current GitHub state.

In plain words
What is it for?
Use it to import one or more repositories, save their settings as YAML, or pull live settings into a selected manifest file or directory.
Why use it?
It gives you a starting configuration for repositories that already exist and helps bring local files up to date with GitHub.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/babarot/gh-infra/import
Clone the repo
git clone --depth 1 https://github.com/babarot/gh-infra

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for import

README.md
[![agentmods](https://agentmods.dev/badge/commands/babarot/gh-infra/import.svg)](https://agentmods.dev/commands/babarot/gh-infra/import)
Your own site
<a href="https://agentmods.dev/commands/babarot/gh-infra/import"><img src="https://agentmods.dev/badge/commands/babarot/gh-infra/import.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,093 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02093
Opus 5 $0.00000 $0.01046
Sonnet 5 $0.00000 $0.00419
Haiku 4.5 $0.00000 $0.00209

Measured 4d ago against content hash 13aa70fbc7f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

import scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/src/content/docs/commands/import.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Export existing repository settings as YAML. Useful for bootstrapping gh-infra configuration from an existing repository.

gh infra import <owner/repo> [owner/repo ...]

Arguments

Argument Example Behavior
<owner/repo> gh infra import babarot/my-project Import that repository
Multiple repos gh infra import babarot/my-project babarot/my-cli Import each repository

When using --into, arguments are optional. If omitted, all repositories defined in the manifests are targeted.

Flags

Flag Description
--into <path> Pull GitHub state into existing local manifests (directory or file path)

Examples

# Import and save to a file
gh infra import babarot/my-project > repos/my-project.yaml

# Import multiple repositories
gh infra import babarot/my-project babarot/my-cli

# Import and review
gh infra import babarot/my-project

# Pull GitHub state into existing manifests (specific repo)
gh infra import babarot/my-project --into=repos/my-project.yaml

# Pull GitHub state for all repos defined in manifests
gh infra import --into=repos/

The output is a complete Repository YAML manifest reflecting the current state of the repository on GitHub.

--into: Pull GitHub State into Local Manifests

With --into, import works in the reverse direction of plan/apply: it fetches the current GitHub state and updates your existing local YAML manifests to match.

# Import specific repos into manifests
gh infra import <owner/repo> [owner/repo ...] --into=<path>

# Import all repos defined in manifests
gh infra import --into=<path>

The path can be a single YAML file or a directory containing manifests.

When no owner/repo arguments are given, all repositories defined in the manifests (from Repository, RepositorySet, and FileSet resources) are targeted automatically.

How It Works

  1. Parse local manifests at the given path
  2. Match targets to resources in the manifests — either from arguments or all repos in manifests when no arguments are given
  3. Fetch the current state from GitHub (in parallel)
  4. Diff local vs GitHub, field by field
  5. Display the plan (repo setting changes + file changes with diff stats)
  6. Confirm with interactive diff viewer (for file changes) or simple prompt (repo-only changes)
  7. Write approved changes to local files

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 227 lines · 0 tokens per session scan A 13aa70fbc7f3

Subscribe to this mod's changes

import is a command published in the GitHub repository babarot/gh-infra (134 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,093 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.