# Install magika with Homebrew, apk, Nix, winget

Fast and accurate AI powered file content types detection. Version 1.0.2 via Homebrew; verified 2026-06-22.

## Install

```sh
sudo av install brew:magika
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install magika
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add magika
```

  Evidence: Alpine Linux edge package indexes: magika from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#magika
```

  Evidence: nixpkgs package indexes: magika from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

### Windows

- winget (92%):

```sh
winget install --id Google.Magika -e
```

  Evidence: Windows Package Manager source index: Google.Magika from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:magika
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/magika>
- **Version:** 1.0.2
- **Source summary:** Fast and accurate AI powered file content types detection
- **Homepage:** <https://securityresearch.google/magika/>
- **Repository:** <https://github.com/google/magika>
- **Upstream docs:** <https://securityresearch.google/magika>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/google/magika/archive/refs/tags/cli/v1.0.2.tar.gz>
- **Last updated:** 2026-06-22T14:05:26-07:00
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- magika (cli)
- magika (alias)

## Dependencies

- openssl@3

## Build dependencies

- pkgconf
- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.0.2
- Package-manager updated: 2026-06-22
- Local data: ok
- Upstream repository: https://github.com/google/magika
- Upstream latest detected: cli/v1.0.2 (current)
## Project history and usage

Magika is Google's AI-powered file content type detection tool. It ships as a Rust CLI plus Python, Rust, JavaScript/TypeScript, and emerging Go bindings, using a compact deep-learning model to classify binary and text files quickly on CPU.

### Project history

Google created the public repository in August 2023 and announced the open-source release in February 2024. Official docs describe a model trained and evaluated on roughly 100 million samples across more than 200 content types, with about 99 percent average precision and recall on Google's test set.

The project moved beyond a Python package into a multi-language toolchain. The README documents a Rust command-line tool, Python API, JavaScript package, Rust bindings, web demo, and additional bindings, with release tags split by CLI, Python, JavaScript, and Go components.

### Adoption history

Magika had unusually fast visibility because Google said it was already used at scale inside Gmail, Drive, and Safe Browsing routing, processing hundreds of billions of samples weekly. Official docs also note integrations with VirusTotal and abuse.ch.

The open-source package spread into package managers quickly: the README documents Homebrew, pipx, pip, cargo, npm, and installer scripts, while the supplied Homebrew input also lists apk, Nix, and winget packages. The GitHub repository has tens of thousands of stars and more than a thousand forks, reflecting broad interest from security and developer-tooling users.

### How it is used

The CLI scans files or directories and can emit descriptions, labels, MIME types, scores, JSON, or JSONL. Typical package-manager usage is `magika PATH`, often recursively, as a faster and ML-backed complement to extension- or magic-number-based detection.

Library users embed Magika to classify uploads, repositories, malware samples, or large file corpora. The docs emphasize near-constant inference time because the model uses a limited subset of file content.

### Why package nerds care

Magika is package-nerd interesting because it packages an ML model as a normal fast CLI. It belongs in the same mental drawer as `file` and libmagic, but with model assets, language bindings, and security-scanning use cases layered on top.

Its multi-artifact release style matters to maintainers: Homebrew ships the CLI, Python users install `magika`, Rust users can install `magika-cli`, JavaScript users have npm bindings, and downstreams need to track model/data changes as part of versioning.

### Timeline

- 2023: Public GitHub repository created.
- 2024: Google open-sourced Magika and announced it on the Google Open Source Blog.
- 2024: CLI, Python, Rust, and JavaScript packaging paths documented.
- 2025: Research paper published at ICSE according to official docs.
- 2026: CLI and binding release tags continue in the public repository.

### Related projects

- libmagic and the Unix `file` command are the traditional content-type detection tools Magika is commonly compared with.
- VirusTotal and abuse.ch are named by Google as integrations.
- Gmail, Drive, and Safe Browsing are named by Google as internal-scale consumers.

### Sources

- <https://github.com/google/magika>
- <https://github.com/google/magika/releases>
- <https://opensource.googleblog.com/2024/02/magika-ai-powered-fast-and-efficient-file-type-identification.html>
- <https://securityresearch.google/magika/introduction/overview/>
- source_facts.package-manager
- source_facts.repo


## 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:** magika
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - magika: normalized package name match | nixpkgs package indexes: magika from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- apk - magika - 1.0.2-r0: normalized package name match | Alpine Linux edge package indexes: magika from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Detect file content types with deep learning | https://github.com/google/magika
- winget - Google.Magika: normalized package name match | Windows Package Manager source index: Google.Magika from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [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.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [openssl@3](https://www.automicvault.com/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [fits](https://www.automicvault.com/pkg/brew/fits/) - Shares av.db curated category or tags: cli, developer-tools, file-analysis.
- [pytorch](https://www.automicvault.com/pkg/brew/pytorch/) - Shares av.db curated category or tags: cli, deep-learning, developer-tools, machine-learning.
- [apache-opennlp](https://www.automicvault.com/pkg/brew/apache-opennlp/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [crf++](https://www.automicvault.com/pkg/brew/crf/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [dvc](https://www.automicvault.com/pkg/brew/dvc/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [hf](https://www.automicvault.com/pkg/brew/hf/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [hf-mcp-server](https://www.automicvault.com/pkg/brew/hf-mcp-server/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [llama.cpp](https://www.automicvault.com/pkg/brew/llama-cpp/) - Shares av.db curated category or tags: cli, developer-tools, machine-learning.
- [text-embeddings-inference](https://www.automicvault.com/pkg/brew/text-embeddings-inference/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, fast, learning.

## Combined YAML source

View the package source record on GitHub. [combined/magika.yml](https://github.com/automic-vault/db/blob/main/combined/magika.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
