CLI tool
gphoto/gphoto2 avatar
gphoto/gphoto2

gphoto2: the command line front end that libgphoto2 needs to be usable

The gphoto2 commandline tool for accessing and controlling digital cameras.

905 stars122 forksCGPL-2.0

At a glance

What is it?
gphoto2 is a C program that turns the libgphoto2 library into a working command line for talking to a camera, and the split is the point, because the library carries the protocol work while the program carries the interface. It is GPL-2.0 licensed, autotools built, and mostly frozen since 2022 in terms of tagged releases.
Who is it for?
gphoto2 is the right choice for a Linux or macOS workstation or server that needs to drive a camera from a script rather than a desktop application, and for anyone who wants the protocol handling in libgphoto2 without committing to a particular graphical front end.
Can I use it commercially?
Yes, with conditions. GPL-2.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 123 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A front end is the whole point of this repository

The project documentation answers the what question in a single line. gphoto2 is a command-line frontend to libgphoto2. That sentence contains the entire architecture and the entire reason to build this repository separately from the library.

The division of labour is the useful part. libgphoto2 is a portable C library that knows how to speak to cameras: the USB and serial transports, the protocol quirks, the camera models, the ability to read a viewfinder image and pull files off the card. None of that is useful on its own to a person at a terminal, because a library has no command line. gphoto2 is the program that turns those library calls into arguments, output and an interactive mode.

The consequence for an adopter is that gphoto2 and libgphoto2 are two things you install, and they are versioned and released separately. The project documentation tells you to look for the man page in the file gphoto2.1 inside the doc directory, and that file is the real reference for the tool, since the README in this repository is a build guide rather than a usage guide.

For scripting purposes, the front end is what you actually invoke. A shell script that needs to download a photo from a tethered camera calls gphoto2 and parses its output, rather than linking against the C library and handling the library's own error and configuration conventions. That is the whole appeal for the automation case, and it is also where the tool's rough edges live, since a program designed for humans at a terminal and a program designed for scripts have different conventions and this one is the former.

Building it means autotools, libgphoto2 and popt

The build is a classic GNU autotools sequence, and the documentation is unusually precise about one detail that catches people out: if you have installed libgphoto2 into a prefix under your home directory and want gphoto2 to go to the same place, you have to keep both the PKG_CONFIG_PATH and the --prefix arguments to configure.

The sequence for a git clone is four commands:

bash
autoreconf -is  # if using a git clone
./configure PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig${PKG_CONFIG_PATH+":${PKG_CONFIG_PATH}"}" --prefix="$HOME/.local"
make
make install

The PKG_CONFIG_PATH line is the part to copy exactly. Without it, configure cannot find the pkg-config metadata for the libgphoto2 you just built, and the build fails with a missing dependency rather than a version conflict. The documentation says to adapt or remove both arguments otherwise, so a system-installed libgphoto2 through the distribution package manager needs no such flag.

The hard requirements beyond the common build tools are listed as two items. The libgphoto2 library itself, and the popt libraries, which handle command line option parsing, with the note that the system package may be called popt-devel, libpopt-dev or something similar depending on the distribution.

The optional list is longer and more interesting, because each optional library switches on a feature. The EXIF library enables metadata handling, the JPEG library handles JPEG specific work, the CDK library provides an ncurses based configuration user interface, and the AALIB library does ascii art rendering of previews. That last one is the sort of detail that tells you the tool was written for a terminal in the early 2000s and never fully grew out of that. Out-of-tree builds are supported, and ./configure --help is pointed at for the details.

What make check actually covers

There is one documented test command, and it is worth reading carefully because the documentation is unusually specific about its limits.

bash
make check

The test suite checks the installation and the basic functionality of the gphoto2 program, and the Directory Browse libgphoto2 camera driver. That is a narrow scope stated plainly. It is not a test suite that exercises talking to real hardware, and it is not a regression suite across camera models. It verifies that the program installs correctly and that a baseline of the program's own behaviour works, plus one camera driver against a virtual source rather than a camera.

That is the shape you would expect from a project whose test infrastructure has to run on machines without cameras attached, and it is also a real constraint for anyone planning to depend on gphoto2 in a production pipeline. There is no documented test matrix, no simulation of a range of camera behaviours, and no indication in the documentation of how many tests exist. The reliability of the tool on a specific camera model therefore comes from the community reporting issues, not from a test suite you can point at.

The repository layout supports this reading. There is a tests directory, a doc directory holding the man page, a contrib directory, a packaging directory, a po directory for translations, a snap directory for Snap packaging, and a gphoto-m4 directory holding the m4 macros the build system uses. There is also a .travis.yml, which dates the continuous integration configuration, a ChangeLog, a NEWS file, a TODO, an AUTHORS file, a COPYING file carrying the licence, and a .cvsignore left over from the era before git was the only option.

The GPL-2.0 licence is the real constraint for embedders

The licence field for the repository is GPL-2.0, and the COPYING file is in the root. For a command line tool that a person or a script invokes as a separate process, the practical effect of the copyleft is limited, because the program is not linked into your product.

The point matters because the split with libgphoto2 changes the calculus. If you embed gphoto2 in a larger application, or link against libgphoto2 inside a proprietary product, you are in a different legal position from invoking a command line binary, and the obligation depends on the distribution terms of the library you link. The documentation does not discuss licensing in any detail beyond the COPYING file, so anyone with a specific obligation to satisfy should read the licence text itself and, if the question matters, ask their own counsel rather than take a summary from a review page.

The licence is the one constraint here that has a hard boundary, and it is worth separating from the others. Everything else about this project is a matter of engineering preference: whether you want a command line, whether you want to avoid a GUI, how you script it. The licence only matters if you plan to redistribute or to embed.

For personal use, for scripts on a machine you control, and for internal automation where the tool runs as a separate process, GPL-2.0 on a command line program is rarely the deciding factor. The deciding factor is more likely whether the tool still does what you need on your camera.

Where gphoto2 is the wrong tool

There are three clear cases.

The first is a person who wants a graphical interface. gphoto2 is a command line tool, and the project documentation does not present it as a desktop application. There is an ncurses based configuration interface available through the optional CDK library, which is a text menu for settings, not a photo browser or an import workflow with thumbnails. If the requirement is a window with previews, this repository is the wrong layer, and the correct starting point is the library together with a front end that provides one.

The second is a Windows deployment. The packaging directory, the Snap directory and the .travis.yml place the distribution story squarely in the Linux world, and the documentation's build instructions are autotools instructions for a Unix shell. A Windows user is going to be looking for an installer, and the project documentation does not describe one.

The third is a camera that gphoto2 does not support. This is the real operational risk and the documentation is not helpful about it, because the camera driver catalogue lives in libgphoto2 rather than in this repository, and this README does not enumerate models. A tool that speaks to hundreds of camera models through protocol code that is frequently the product of reverse engineering will always have gaps, and the documentation gives you no way to check before committing.

There is a fourth, softer case. If your workflow needs to move photos off a camera card automatically and unattended, gphoto2's interactive conventions, its error output and its exit codes are all shaped for a human at a terminal, and treating its output as a stable machine interface is an assumption you should test rather than trust. The documentation does not promise a scripting contract.

A release history with a long gap in it

The release list shows the pattern clearly. Version 2.5.32 was released on 2025-08-11, and before that came 2.5.28 on 2022-01-03 and 2.5.27 on 2021-02-21. So there was a three and a half year gap between 2.5.28 and 2.5.32, and the project is on a 2.5 line with a version number that has not moved its minor component in the visible history.

The last push to the repository was on 2026-06-22 and the repository is not archived, so the code is still receiving changes. But the tagged releases tell a different story from the commit history, and the tagged releases are what a distribution package is built from. A packager picking up the newest tag gets 2.5.32.

The repository does carry the artefacts of careful release hygiene: a ChangeLog, a NEWS file, an AUTHORS file, a TODO, a configure.ac driven by automake, a po directory for translations, and separate packaging for the various distributions. The presence of a .cvsignore file, which long predates git, is a small reminder of how old the accumulated conventions are.

The practical advice for someone adopting this is straightforward. If you need a feature that arrived after 2.5.28, or a fix for a camera you own, you may need to build from git rather than install a released tarball, which means the autotools sequence above and the dependency work that comes with it. If a released version does what you need, install it and treat it as a finished tool.

Editorial conclusion

gphoto2 is the right choice for a Linux or macOS workstation or server that needs to drive a camera from a script rather than a desktop application, and for anyone who wants the protocol handling in libgphoto2 without committing to a particular graphical front end. It is the wrong choice if you need a finished user interface, since the program is a command line tool with no GUI of its own, and it is the wrong choice for a Windows deployment without extra work, since the packaging directory and the Snap directory show the distribution story is Linux shaped. Before adopting it, build it against a libgphoto2 you control and confirm your camera model is in the driver list, then read the man page in doc/gphoto2.1, which is the actual reference for the tool rather than the README.

Frequently asked questions

What is the difference between gphoto2 and libgphoto2?

gphoto2 is the command-line frontend to libgphoto2. The library handles the camera protocols and hardware access, while gphoto2 provides the interface that a person or a script actually invokes.

How do I build gphoto2 from source?

Run autoreconf -is for a git clone, then ./configure with the PKG_CONFIG_PATH and --prefix arguments if your libgphoto2 lives under $HOME/.local, then make and make install. You need the libgphoto2 library and the popt libraries, with EXIF, JPEG, CDK and AALIB optional.

What does make check test in gphoto2?

The documentation says the test suite checks the installation and the basic functionality of the gphoto2 program, along with the Directory Browse libgphoto2 camera driver. It does not exercise real camera hardware.

What licence is gphoto2 released under?

The repository is licensed under GPL-2.0, with the licence text in the COPYING file in the repository root. The documentation does not discuss licensing in any further detail.

Is gphoto2 still being worked on?

The last push to the repository was on 2026-06-22 and the repository is not archived, but the most recent tagged releases are 2.5.32 from 2025-08-11, 2.5.28 from 2022-01-03 and 2.5.27 from 2021-02-21. Distributors build from those tags.

Official sources

  1. gphoto/gphoto2 on GitHub
  2. Issues
  3. License: GPL-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/gphoto-gphoto2.svg)](https://hysenlabs.com/projects/gphoto-gphoto2)

Was this useful?