swift-argument-parser

swift-argument-parser is a cursor rule for coding agents from roy2392/vibe-agents-rules. It costs 0 tokens per session (7,982 once invoked), scanned A, a copy of swift-argument-parser, MIT.

Swift Argument Parser is an Apple Swift library for building command-line tools by declaring the arguments and options a program accepts.

In plain words
What is it for?
Use it to define required arguments, optional settings, help text, and synchronous or asynchronous command entry points in Swift programs.
Why use it?
It avoids writing command-line input handling from scratch and provides type-checked ways to read user-provided values.

Cursor rule

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 rules/roy2392/vibe-agents-rules/swift-argument-parser
Clone the repo
git clone --depth 1 https://github.com/roy2392/vibe-agents-rules

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 swift-argument-parser

README.md
[![agentmods](https://agentmods.dev/badge/rules/roy2392/vibe-agents-rules/swift-argument-parser.svg)](https://agentmods.dev/rules/roy2392/vibe-agents-rules/swift-argument-parser)
Your own site
<a href="https://agentmods.dev/rules/roy2392/vibe-agents-rules/swift-argument-parser"><img src="https://agentmods.dev/badge/rules/roy2392/vibe-agents-rules/swift-argument-parser.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 7,982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.07982
Opus 5 $0.00000 $0.03991
Sonnet 5 $0.00000 $0.01596
Haiku 4.5 $0.00000 $0.00798

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

Security

Grade A, and why

swift-argument-parser 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 3d 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.

Origin

This is a copy

100% identical to swift-argument-parser — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

docs/swift-argument-parser.mdc · 738 lines

How it starts

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

https://swiftpackageindex.com/apple/swift-argument-parser/1.5.1/documentation/argumentparser llms-full.txt

Swift Argument Parser

Skip Navigation

Framework

ArgumentParser

Straightforward, type-safe argument parsing for Swift.

Overview

By using ArgumentParser, you can create a command-line interface tool by declaring simple Swift types. Begin by declaring a type that defines the information that you need to collect from the command line. Decorate each stored property with one of ArgumentParser‘s property wrappers, declare conformance to ParsableCommand, and implement your command’s logic in its run() method. For async renditions of run, declare AsyncParsableCommand conformance instead.

import ArgumentParser

@main
struct Repeat: ParsableCommand {
    @Argument(help: "The phrase to repeat.")
    var phrase: String

    @Option(help: "The number of times to repeat 'phrase'.")
    var count: Int? = nil

    mutating func run() throws {
        let repeatCount = count ?? 2
        for _ in 0..<repeatCount {
            print(phrase)
        }
    }
}

When a user executes your command, the ArgumentParser library parses the command-line arguments, instantiates your command type, and then either calls your run() method or exits with a useful message.

The output of the Repeat command, declared above.

Additional Resources

Read the full file on GitHub · 738 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. 3d ago First seen · 738 lines · 0 tokens per session scan A 606b057f59ae

Subscribe to this mod's changes

swift-argument-parser is a cursor rule published in the GitHub repository roy2392/vibe-agents-rules (11 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 7,982 tokens. A static security scan graded it A with 0 findings. It is 100% identical to swift-argument-parser, differing in 0 lines, and is treated as a copy.