{"id":22770357,"url":"https://github.com/leanercloud/f2c","last_synced_at":"2025-08-02T08:03:21.952Z","repository":{"id":246835325,"uuid":"823669950","full_name":"LeanerCloud/f2c","owner":"LeanerCloud","description":"Simple tool that copies to clipboard the content of files given as CLI arguments, with a comment before each file.","archived":false,"fork":false,"pushed_at":"2025-05-31T16:56:25.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T01:04:49.066Z","etag":null,"topics":["llm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeanerCloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-03T13:31:10.000Z","updated_at":"2025-06-12T10:09:31.000Z","dependencies_parsed_at":"2025-05-31T17:49:12.699Z","dependency_job_id":"fa1f8523-2679-4fb6-a49b-58cb00bea3df","html_url":"https://github.com/LeanerCloud/f2c","commit_stats":null,"previous_names":["leanercloud/f2c"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeanerCloud/f2c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Ff2c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Ff2c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Ff2c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Ff2c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeanerCloud","download_url":"https://codeload.github.com/LeanerCloud/f2c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeanerCloud%2Ff2c/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268350992,"owners_count":24236328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm"],"created_at":"2024-12-11T15:31:09.559Z","updated_at":"2025-08-02T08:03:21.885Z","avatar_url":"https://github.com/LeanerCloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File-to-Clipboard Tool (f2c)\n\nA versatile tool that helps you copy file contents or Go code snippets to your clipboard. It's particularly useful when working with large language models (LLMs) for code analysis or sharing multiple files.\n\n## Features\n\n### File Processing Mode\n\n- Reads contents of multiple files given as command-line arguments\n- Walks directories recursively to gather all files\n- Prefixes each file's content with a comment showing the file name\n- Ignores non-text files\n- Can exclude files matching specified patterns\n\n### Go Code Analysis Mode\n\n- Finds and extracts specified Go functions from your codebase\n- Analyzes and includes function dependencies\n- Captures related type definitions and helper functions\n- Preserves file and line number information\n- Formats output for easy copying into LLMs\n\n## Requirements\n\n- Go 1.15 or higher\n\n## Installation\n\n1. Ensure you have Go installed from [golang.org](https://golang.org/)\n2. Install the tool:\n\n```shell\ngo install github.com/LeanerCloud/f2c/cmd/f2c@latest\n```\n\n## Usage\n\n### File Processing Mode Usage\n\nCopy contents of specific files or directories:\n\n```shell\n# Copy all text files in current directory\nf2c .\n\n# Copy specific files\nf2c file1.txt file2.go\n\n# Exclude certain paths\nf2c --exclude .git,vendor,node_modules .\n\n# Short form for exclude\nf2c -e .git,vendor .\n```\n\nExample output:\n\n```text\n// file1.txt\nHello, this is file1.\n\n// file2.txt\nHello, this is file2.\n```\n\n### Go Code Analysis Mode Usage\n\nExtract a function and its dependencies from the current directory:\n\n```shell\n# Extract a specific function\nf2c --function ProcessDirectory\n\n# Short form\nf2c -f ProcessDirectory\n```\n\nExample output:\n\n```go\n// main.go:40 ProcessDirectory\nfunc ProcessDirectory(path string) error {\n    // ... function code ...\n}\n\n// utils.go:15 helperFunction\nfunc helperFunction() {\n    // ... dependency code ...\n}\n\n// types.go:25 Config\ntype Config struct {\n    // ... related type definition ...\n}\n```\n\n## Command Line Options\n\n```shell\nf2c [flags] [file/directory...]\n\nFlags:\n  -e, --exclude string    Comma-separated list of strings to exclude when appearing in file names\n  -f, --function string   Name of the Go function to analyze\n  -h, --help             Help for f2c\n```\n\n## How It Works\n\n### File Processing\n\n1. Recursively scans provided paths\n2. Identifies text files using content type detection\n3. Skips excluded paths\n4. Reads and formats file contents\n5. Copies combined output to clipboard\n\n### Go Code Analysis\n\n1. Locates target function in Go source files\n2. Analyzes function dependencies (types, helper functions)\n3. Collects all related code snippets\n4. Preserves source location information\n5. Copies formatted output to clipboard\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Ff2c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanercloud%2Ff2c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanercloud%2Ff2c/lists"}