📖 CLI manga downloader with multiple and up-to-date scrapers, export formats, anilist integration and more!
  • Go 89%
  • Shell 8.2%
  • PowerShell 2.4%
  • Makefile 0.2%
  • Dockerfile 0.2%
Find a file
Marvin the Paranoid Android d41305c894
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(installer): use Forgejo API and self-hosted scrapers by default
Replace hardcoded GitHub API URL with configurable Forgejo-compatible API:
- Add InstallerBaseURL key (installer.base_url) defaulting to git.yak-shaver.club
- Update collect() to use Forgejo API: {base_url}/api/v1/repos/{user}/{repo}/git/trees/{branch}
- Update GithubURL() to use Forgejo URL format (/src/branch/ instead of /blob/)
- Change default InstallerUser from 'metafates' to 'mangal2'
- Increment DefinedFieldsCount from 62 to 63

Users can override installer.base_url to point at any Forgejo or GitHub instance.
2026-03-22 22:15:32 -03:00
.github github: fix source request form 2022-09-22 10:55:34 +03:00
.idea perf(cache): use gacher as caching backend 2022-11-01 19:06:01 +03:00
anilist Centralizes HTTP client construction through httpclient.Factory 2026-02-22 00:47:25 -03:00
assets chore: update schemas, move to assets 2022-10-31 15:19:47 +03:00
captcha Solves CAPTCHAs automatically for sources that declare they need it 2026-02-22 23:54:40 -03:00
certs Supports configurable proxy for all HTTP traffic 2026-02-19 01:08:15 -03:00
cmd Routes proxy traffic only to sources that declare they need it 2026-02-22 23:54:40 -03:00
color refactor: add orange color 2022-10-28 12:27:51 +03:00
completions chore: apply formatter, go mod tidy 2022-09-05 22:23:18 +03:00
config feat(installer): use Forgejo API and self-hosted scrapers by default 2026-03-22 22:15:32 -03:00
constant Supports configurable proxy for all HTTP traffic 2026-02-19 01:08:15 -03:00
converter Upgrades Go toolchain and deps to Go 1.24 2026-02-14 23:02:41 -03:00
docs/features Solves CAPTCHAs automatically for sources that declare they need it 2026-02-22 23:54:40 -03:00
downloader Surfaces permission error when downloads directory is unwritable 2026-03-02 23:42:13 -03:00
filesystem perf(cache): use gacher as caching backend 2022-11-01 19:06:01 +03:00
history refactor: move config keys to separate module + possible fix of #135 2022-12-11 18:48:47 +03:00
httpclient Solves CAPTCHAs automatically for sources that declare they need it 2026-02-22 23:54:40 -03:00
icon refactor: move config keys to separate module + possible fix of #135 2022-12-11 18:48:47 +03:00
impersonate Supports configurable proxy for all HTTP traffic 2026-02-19 01:08:15 -03:00
inline refactor: move config keys to separate module + possible fix of #135 2022-12-11 18:48:47 +03:00
installer feat(installer): use Forgejo API and self-hosted scrapers by default 2026-03-22 22:15:32 -03:00
integration Centralizes HTTP client construction through httpclient.Factory 2026-02-22 00:47:25 -03:00
key feat(installer): use Forgejo API and self-hosted scrapers by default 2026-03-22 22:15:32 -03:00
log refactor: move config keys to separate module + possible fix of #135 2022-12-11 18:48:47 +03:00
mini Upgrades Go toolchain and deps to Go 1.24 2026-02-14 23:02:41 -03:00
network Exposes HTTP pipeline diagnostics for proxy failures 2026-02-22 15:48:04 -03:00
open refactor: move GOOS names to constants 2022-09-15 16:57:46 +03:00
provider Runs scraper tests with the same config loading as main 2026-02-23 00:19:43 -03:00
query Upgrades Go toolchain and deps to Go 1.24 2026-02-14 23:02:41 -03:00
scripts Supports configurable proxy for all HTTP traffic 2026-02-19 01:08:15 -03:00
source Surfaces permission error when downloads directory is unwritable 2026-03-02 23:42:13 -03:00
style Upgrades Go toolchain and deps to Go 1.24 2026-02-14 23:02:41 -03:00
tui Prevents crash when some search sources fail to load 2026-03-03 00:13:49 -03:00
update refactor: add prefix for format constants 2022-11-02 21:20:58 +03:00
util Fixes go vet warnings for lo.Tuple2 composite literals 2026-02-15 14:04:54 -03:00
vendor Sync vendor directory with go.mod 2026-03-22 22:02:36 -03:00
version Fixes go vet warnings for lo.Tuple2 composite literals 2026-02-15 14:04:54 -03:00
where refactor: move config keys to separate module + possible fix of #135 2022-12-11 18:48:47 +03:00
.gitignore Ignores worktree directories 2026-02-22 19:42:30 -03:00
.goreleaser.yaml refactor: remove update command due to how unstable it is 2022-10-25 11:42:35 +03:00
.woodpecker.yml Add Woodpecker CI pipeline 2026-03-22 21:37:05 -03:00
AGENTS.md Removes Manganelo and Manganato built-ins; starts 5.0 changelog 2026-02-15 02:00:30 -03:00
CHANGELOG.md Update CHANGELOG for v5.0.0 release 2026-03-22 21:37:02 -03:00
Dockerfile Upgrades Go toolchain and deps to Go 1.24 2026-02-14 23:02:41 -03:00
go.mod Sync vendor directory with go.mod 2026-03-22 22:02:36 -03:00
go.sum Solves CAPTCHAs automatically for sources that declare they need it 2026-02-22 23:54:40 -03:00
LICENSE feat: basic lua support 2022-08-02 09:48:52 +03:00
main.go Solves CAPTCHAs automatically for sources that declare they need it 2026-02-22 23:54:40 -03:00
Makefile Prevents RaiseError from treating messages as format strings 2026-02-15 14:04:54 -03:00
README.md Supports configurable proxy for all HTTP traffic 2026-02-19 01:08:15 -03:00

Mangal 4 ☄️

Linux macOS Windows Termux

The most advanced CLI manga downloader in the entire universe!

Mangal 4 TUI

Caution

As of April 2025, Mangal is no longer maintained. I am incredibly grateful to everyone who used it, contributed, or gave feedback along the way - thank you! Unfortunately, I just don't have the time to keep it going right now. That said, it's open source, so you're more than welcome to fork it, build on it, or maintain your own version. I might return to it someday, but for now, I don't recommend using it as-is - running unmaintained software can introduce security risks.

Try it!

curl -sSL mangal.metafates.one/run | sh

Note

Not available on Windows.

Table of contents

Features

  • Lua Scrapers!!! You can add any source you want by creating your own (or using someone's else) scraper with Lua 5.1. See mangal-scrapers repository
  • 2 Built-in sources - Mangadex & Mangapill
  • Download & Read Manga - I mean, it would be strange if you couldn't, right?
  • Caching - Mangal will cache as much data as possible, so you don't have to wait for it to download the same data over and over again.
  • 4 Different export formats - PDF, CBZ, ZIP and plain images
  • TUI - You already know how to use it! (ノ>ω<)ノ :。・::・゚’★,。・:・゚’☆
  • Scriptable - You can use Mangal in your scripts, it's just a CLI app after all. Examples
  • History - Resume your reading from where you left off!
  • Fast? - YES.
  • Monolith - ZERO runtime dependencies. Even Lua is built in. Easy to install and use.
  • Cross-Platform - Linux, macOS, Windows, Termux, even your toaster. (¬‿¬ )
  • Anilist integration - Mangal will collect additional data from Anilist and use it to improve your reading experience. It can also sync your progress!

Installation

Script (Linux, MacOS, Termux)

Install using this shell script

curl -sSL mangal.metafates.one/install | sh

This script will automatically detect OS & Distro and use the best option available. For example, on macOS it will try to use Homebrew, on Ubuntu it will install the .deb package and so on...

Arch Linux

AUR package (maintained by @balajsra, thank you)

MacOS

Install using Homebrew

brew tap metafates/mangal
brew install mangal

Windows

Install using Scoop (thanks to @SonaliBendre for adding it to the official bucket)

scoop bucket add extras
scoop install mangal

Termux

Thanks to @T-Dynamos for adding it to the termux-packages

pkg install mangal

Gentoo

Install using third-party overlay raiagent. Thanks to @leycec for maintaining it.

eselect repository enable raiagent
emerge --sync raiagent
emerge mangal

Nix

Install using Nix. Thanks to @bertof for adding it to the nixpkgs

# NixOS
nix-env -iA nixos.mangal

# Non NixOS
nix-env -iA nixpkgs.mangal

Docker

Install using Docker. (thanks to @ArabCoders for reference)

docker pull metafates/mangal

To run

docker run --rm -ti -e "TERM=xterm-256color" -v $(PWD)/mangal/downloads:/downloads -v $(PWD)/mangal/config:/config metafates/mangal

From source

Visit this link to install Go.

Clone the repo

git clone --depth 1 https://github.com/metafates/mangal.git
cd mangal

GNU Make (Recommended)

make install # if you want to compile and install mangal to path
make build # if you want to just build the binary
If you don't have GNU Make use this
# To build
go build -ldflags "-X 'github.com/metafates/mangal/constant.BuiltAt=$(date -u)' -X 'github.com/metafates/mangal/constant.BuiltBy=$(whoami)' -X 'github.com/metafates/mangal/constant.Revision=$(git rev-parse --short HEAD)' -s -w"

# To install
go install -ldflags "-X 'github.com/metafates/mangal/constant.BuiltAt=$(date -u)' -X 'github.com/metafates/mangal/constant.BuiltBy=$(whoami)' -X 'github.com/metafates/mangal/constant.Revision=$(git rev-parse --short HEAD)' -s -w"

If you want to build mangal for other architecture, say ARM, you'll have to set env variables GOOS and GOARCH

GOOS=linux GOARCH=arm64 make build

Available GOOS and GOARCH combinations

Pre-compiled

Download the pre-compiled binaries from the releases page and copy them to the desired location.

Usage

TUI

Just run mangal and you're ready to go.

Keybinds
Bind Description
? Show help
↑/j ↓/k →/l ←/h Navigate
g Go to first
G Go to last
/ Filter
esc Back
space Select one
tab Select all
v Select volume
backspace Unselect all
enter Confirm
o Open URL
r Read
q Quit
ctrl+c Force quit
a Select Anilist manga (chapters list)
d Delete single history entry

TUI

If you wonder what those icons mean - D stands for "downloaded", * shows that chapter is marked to be downloaded. You can choose different icons, e.g. nerd font ones - just run mangal with --icons nerd. Available options are nerd, emoji, kaomoji and squares

Mini

Mini mode tries to mimic ani-cli

To run: mangal mini

mini

Inline

Inline mode is intended for use with other scripts.

Type mangal help inline for more information.

See Wiki for more examples.

Mangal 4 Inline

Other

See mangal help for more information

Configuration

Mangal uses TOML format for configuration under the mangal.toml filename. Config path depends on the OS. To find yours, use mangal where --config. For example, on Linux it would be ~/.config/mangal/mangal.toml.

Use env variable MANGAL_CONFIG_PATH to set custom config path.

See mangal env to show all available env variables.

Command Description
mangal config get Get config value for specific key
mangal config set Set config value for specific key
mangal config reset Reset config value for specific key
mangal config info List all config fields with description for each
mangal config write Write current config to a file

Proxy

Mangal can route all traffic through an HTTP or HTTPS proxy. This is useful for bypassing geo-restrictions or using services like Bright Data Web Unlocker.

Configure via config keys or environment variables:

Config Key Env Variable Description
proxy.url MANGAL_PROXY_URL Proxy URL (http://host:port or with auth)
proxy.username MANGAL_PROXY_USERNAME Username (if not embedded in URL)
proxy.password MANGAL_PROXY_PASSWORD Password (if not embedded in URL)

Examples:

# Simple proxy
export MANGAL_PROXY_URL="http://127.0.0.1:8080"

# Bright Data Web Unlocker
export MANGAL_PROXY_URL="http://brd-customer-XXXX:password@brd.superproxy.io:33335"

Bright Data's MITM proxy CA certificate is embedded in the binary, so HTTPS through their proxy works without any system-level certificate setup.

Browser Impersonation

Mangal can impersonate a real Chrome browser's TLS ClientHello and HTTP/2 fingerprints, making requests indistinguishable from genuine browser traffic. This defeats TLS/HTTP2 fingerprinting used by Cloudflare and similar services.

Enabled by default. To disable:

mangal config set -k downloader.impersonate -v false
# or
export MANGAL_DOWNLOADER_IMPERSONATE=false

Custom scrapers

TLDR; To browse and install a custom scraper from mangal-scrapers repository run

mangal sources install

Mangal has a Lua5.1 VM built-in + some useful libraries, such as headless chrome, http client, html parser and so on...

Check the defined modules for more information.

For scrapers examples, check the mangal-scrapers repository

Creating a custom scraper

This command will create example.lua file in the mangal where --sources directory.

mangal sources gen --name example --url https://example.com

Open the file and edit it as you wish. Take a look at the comments for more information. See mangal-scrapers repository for examples.

You can test it by running mangal run <filepath>

It should automatically appear in the list of available scrapers.

New to Lua? Quick start guide

Anilist

Mangal also supports integration with anilist.

Besides fetching metadata for each manga when downloading, mangal can also mark chapters as read on your Anilsit profile when you read them inside mangal.

For more information see wiki

Honorable mentions

Projects using mangal

  • kaizoku - Self-hosted manga downloader with mangal as its core 🚀

Similar Projects

  • mangadesk - Terminal client for MangaDex
  • ani-cli - A cli tool to browse and play anime
  • manga-py - Universal manga downloader
  • animdl - A highly efficient, fast, powerful and light-weight anime downloader and streamer
  • tachiyomi - Free and open source manga reader for Android

Libraries

  • bubbletea, bubbles & lipgloss - Made mangal shine! The best TUI libraries ever
  • gopher-lua - Made it possible to write custom scrapers with Lua ❤️
  • cobra and viper - Responsible for the awesome CLI & config experience 🛠
  • pdfcpu - Fast pdf processor in pure go 📄
  • And many others!

Contributors

And of course, thanks to all contributors! You are awesome!

Contributors


If you find this project useful or want to say thank you, please consider starring it, that would mean a lot to me

Star History