{"id":15152928,"url":"https://github.com/bartmika/ipfs-cli-wrapper","last_synced_at":"2026-01-20T04:32:07.383Z","repository":{"id":255301028,"uuid":"849163646","full_name":"bartmika/ipfs-cli-wrapper","owner":"bartmika","description":"Package that manages running an IPFS node in the background and offers a user-friendly interface, enabling you to build IPFS-embedded Golang applications more easily.","archived":false,"fork":false,"pushed_at":"2024-09-04T15:27:43.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T11:38:12.837Z","etag":null,"topics":["golang","ipfs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartmika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-08-29T05:06:41.000Z","updated_at":"2024-09-04T15:27:46.000Z","dependencies_parsed_at":"2024-08-29T06:25:34.145Z","dependency_job_id":"4ed0d117-c2ab-4ce9-87af-df555ac26128","html_url":"https://github.com/bartmika/ipfs-cli-wrapper","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"8a6a98f40a9d33745ffc9b4c445f293320a96f44"},"previous_names":["bartmika/ipfs-cli-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bartmika/ipfs-cli-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fipfs-cli-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fipfs-cli-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fipfs-cli-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fipfs-cli-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartmika","download_url":"https://codeload.github.com/bartmika/ipfs-cli-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartmika%2Fipfs-cli-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","ipfs"],"created_at":"2024-09-26T16:41:54.497Z","updated_at":"2026-01-20T04:32:07.362Z","avatar_url":"https://github.com/bartmika.png","language":"Go","readme":"# IPFS CLI Wrapper\n\n[![GoDoc](https://godoc.org/github.com/gomarkdown/markdown?status.svg)](https://pkg.go.dev/github.com/bartmika/ipfs-cli-wrapper)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bartmika/ipfs-cli-wrapper)](https://goreportcard.com/report/github.com/bartmika/ipfs-cli-wrapper)\n[![License](https://img.shields.io/github/license/bartmika/ipfs-cli-wrapper)](https://github.com/bartmika/ipfs-cli-wrapper/blob/master/LICENSE)\n![Go version](https://img.shields.io/github/go-mod/go-version/bartmika/ipfs-cli-wrapper)\n\n`ipfs-cli-wrapper` is a Go package that provides a convenient way to manage [IPFS](https://github.com/ipfs/kubo) nodes by running the IPFS binary as a separate process alongside your Go application. This package allows you to easily start, control, and interact with an IPFS node using the [HTTP Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/).\n\n## Key Features\n\n- **Automatic IPFS Binary Download**: Automatically downloads the appropriate IPFS binary for your machine's architecture on first use.\n- **Run IPFS as a Background Process**: Start the IPFS daemon in the background, allowing your application to continue running seamlessly.\n- **HTTP API Interaction**: Use the [HTTP Kubo RPC API](https://docs.ipfs.tech/reference/kubo/rpc/) to interact with your IPFS node.\n\n## Getting Started\n\nFollow these steps to start using `ipfs-cli-wrapper` in your Go project:\n\n### Installation\n\n1. **Install the package:**\n\n   ```shell\n   go get github.com/bartmika/ipfs-cli-wrapper\n\n2. **Update your .gitignore to exclude the IPFS binary:**\n\n   Add the following to your .gitignore to prevent the binary from being tracked in your version control:\n\n   ```shell\n   bin\n   ./bin\n   ./bin/*\n   ```\n\n3. **Open port 4001 on your server:**\n\n   Make sure port 4001 (the Swarm port used by IPFS) is open on your server to allow connections to the IPFS network.\n\n### Basic Usage\nHere's a simple example to get started with `ipfs-cli-wrapper`:\n\n```go\npackage main\n\nimport (\n    \"log\"\n    ipfswrap \"github.com/bartmika/ipfs-cli-wrapper\"\n)\n\nfunc main() {\n    // Initialize the IPFS CLI wrapper.\n    wrapper, err := ipfswrap.NewWrapper()\n    if err != nil {\n        log.Fatalf(\"Failed to create IPFS wrapper: %v\", err)\n    }\n\n    // Start the IPFS daemon in the background.\n    if err := wrapper.StartDaemonInBackground(); err != nil {\n        log.Fatalf(\"Failed to start IPFS daemon: %v\", err)\n    }\n\n    // Ensure the IPFS daemon shuts down gracefully on application exit.\n    defer func() {\n        if err := wrapper.ShutdownDaemon(); err != nil {\n            log.Fatalf(\"Failed to shut down IPFS daemon: %v\", err)\n        }\n    }()\n\n    // Continue with your application logic...\n}\n```\n\n### Advanced Example: Interacting with the IPFS Node\nOnce the IPFS daemon is running, you can interact with it using the HTTP Kubo RPC API:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \"net/http\"\n    \"os\"\n    \"strings\"\n\n    ipfsFiles \"github.com/ipfs/go-ipfs-files\"\n    \"github.com/ipfs/kubo/client/rpc\"\n    ipfscliwrapper \"github.com/bartmika/ipfs-cli-wrapper\"\n)\n\nfunc main() {\n    wrapper, err := ipfscliwrapper.NewWrapper()\n    if err != nil {\n        log.Fatalf(\"Failed to create IPFS wrapper: %v\", err)\n    }\n\n    if err := wrapper.StartDaemonInBackground(); err != nil {\n        log.Fatalf(\"Failed to start IPFS daemon: %v\", err)\n    }\n    defer func() {\n        if err := wrapper.ShutdownDaemon(); err != nil {\n            log.Fatalf(\"Failed to shut down IPFS daemon: %v\", err)\n        }\n    }()\n\n    // Create an IPFS HTTP client.\n    httpClient := \u0026http.Client{}\n    httpApi, err := rpc.NewURLApiWithClient(\"http://127.0.0.1:5001\", httpClient)\n    if err != nil {\n        log.Fatalf(\"Failed to create IPFS HTTP API client: %v\", err)\n    }\n\n    // Add data to IPFS.\n    content := strings.NewReader(\"Hello world from IPFS CLI Wrapper!\")\n    p, err := httpApi.Unixfs().Add(context.Background(), ipfsFiles.NewReaderFile(content))\n    if err != nil {\n        log.Fatalf(\"Failed to add data to IPFS: %v\", err)\n    }\n\n    fmt.Printf(\"Data stored in IPFS with CID: %v\\n\", p)\n}\n```\n\nFor the full example, see the [RPC example code](https://github.com/bartmika/ipfs-cli-wrapper/blob/main/examples/rpc/main.go).\n\n### Documentation\nDetailed documentation can be found on [pkg.go.dev](https://pkg.go.dev/github.com/bartmika/ipfs-cli-wrapper).\n\n### Examples\nSee the [examples folder](https://github.com/bartmika/ipfs-cli-wrapper/tree/main/examples) for more code samples and use cases.\n\n### Contributing\nFound a bug or have a feature request? Please open an [issue](https://github.com/bartmika/ipfs-cli-wrapper/issues). Contributions are welcome!\n\n### License\nMade with ❤️ by [Bartlomiej Mika](https://bartlomiejmika.com).   \nThe project is licensed under the [ISC License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartmika%2Fipfs-cli-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartmika%2Fipfs-cli-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartmika%2Fipfs-cli-wrapper/lists"}