# Install needle with Homebrew, Nix

Compile-time safe Swift dependency injection framework with real code. Version 0.25.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:needle
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install needle
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#needle
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ne/needle/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:needle
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/needle>
- **Version:** 0.25.1
- **Source summary:** Compile-time safe Swift dependency injection framework with real code
- **Homepage:** <https://github.com/uber/needle>
- **Repository:** <https://github.com/uber/needle>
- **Upstream docs:** <https://github.com/uber/needle#readme>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/uber/needle/archive/refs/tags/v0.25.1.tar.gz>
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- needle (cli)
- needle (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.25.1
- Local data: ok
- Upstream repository: https://github.com/uber/needle
- Upstream latest detected: v0.25.1 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

Needle is Uber's Swift dependency-injection system. Its distinguishing idea is to make dependency wiring explicit, hierarchical, and code-generated so missing or invalid dependencies fail at compile time instead of becoming runtime container lookups.

### Project history

The public GitHub repository was created on 2018-04-06. The README frames Needle against Swift DI libraries such as Cleanse and Swinject, while comparing its compile-time generated graph more closely to Dagger on the JVM. The project goals call out high reliability, code generation performance for multi-million-line codebases, and compatibility with iOS architectures including RIBs and MVx.

Needle ships both a runtime framework, NeedleFoundation, and the `needle` generator executable packaged by Homebrew. Its release process documentation explicitly includes publishing to CocoaPods and Homebrew, which matches its split identity as both a Swift package/library and a developer tool installed into build phases.

### Adoption history

Needle's primary adoption channel is iOS application architecture, especially large Swift apps where runtime service locators are too loose and hand-wired dependency trees become noisy. Swift Package Index listed the package as in development for 8 years, with 42 releases and 42 contributors when checked in 2026, and the GitHub API showed 2,006 stars and 160 forks on 2026-07-01.

Homebrew is important because teams usually need the generator binary in local and CI builds. Homebrew's formula page showed stable version 0.25.1 and 1,766 installs over 365 days, 70 over 90 days, and 17 over 30 days when checked on 2026-07-01.

### How it is used

In practice, developers add NeedleFoundation to a Swift app, model scopes as `Component` types, express dependencies as Swift protocols, then run `needle generate` to emit a generated file that wires the graph. The generator is commonly invoked from an Xcode build phase or CI step so dependency graph mistakes become compilation errors.

Needle is attractive to package nerds because the Homebrew formula is not the library itself; it is the code-generation tool that makes the library's safety story work. That puts it in the same operational family as SwiftGen, Sourcery, and other source-generation CLIs that become part of a build pipeline.

### Why package nerds care

Needle is a notable example of a company-scale mobile architecture tool packaged for general use. It shows how a Swift library can require a separately installed command-line generator, and why Homebrew remains relevant even for ecosystems that also use Swift Package Manager or CocoaPods.

### Timeline

- 2018-04-06: Public GitHub repository created.
- 2019: Community tutorials and comparisons began presenting Needle as Uber's compile-time-safe Swift DI option.
- 2024-08: GitHub releases page listed v0.25.1 with Swift 6-related release notes.
- 2026-07-01: Homebrew formula stable version observed as 0.25.1.

### Related projects

- NeedleFoundation
- Swinject
- Cleanse
- Dagger
- Uber RIBs

### Sources

- <https://api.github.com/repos/uber/needle>
- <https://formulae.brew.sh/formula/needle>
- <https://github.com/uber/needle>
- <https://github.com/uber/needle/blob/master/RELEASE.md>
- <https://swiftpackageindex.com/uber/needle>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** needle
- **Version Scheme:** 0
- **Revision:** 0
- **Requirements:** macos
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - needle: normalized package name match | nixpkgs package indexes: pkgs/by-name/ne/needle/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [weaver](https://www.automicvault.com/pkg/brew/weaver/) - Shares av.db curated category or tags: cli, dependency-injection, developer-tools, ios, swift.
- [sourcery](https://www.automicvault.com/pkg/brew/sourcery/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, swift.
- [mint](https://www.automicvault.com/pkg/brew/mint/) - Shares av.db curated category or tags: cli, developer-tools, swift.
- [rswift](https://www.automicvault.com/pkg/brew/rswift/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, ios, swift.
- [sourcedocs](https://www.automicvault.com/pkg/brew/sourcedocs/) - Shares av.db curated category or tags: cli, developer-tools, swift.
- [swiftgen](https://www.automicvault.com/pkg/brew/swiftgen/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, ios, swift.
- [carthage](https://www.automicvault.com/pkg/brew/carthage/) - Shares av.db curated category or tags: cli, developer-tools, ios, swift.
- [configen](https://www.automicvault.com/pkg/brew/configen/) - Shares av.db curated category or tags: cli, code-generation, developer-tools, swift.
- [needle](https://www.automicvault.com/pkg/npm/needle/) - Same normalized package name in another local ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/needle.yml](https://github.com/automic-vault/db/blob/main/combined/needle.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
