Logo
1.60
  • Introduction
  • Conan migration guide to 2.0
  • Training Courses
  • Install
  • Getting Started
  • Using packages
  • Creating Packages
  • Uploading Packages
  • Developing packages
  • Package apps and devtools
  • Versioning
  • Mastering Conan
  • Systems and cross building
  • Extending Conan
  • Integrations
  • Configuration
  • Howtos
  • Reference
    • Commands
      • Consumer commands
        • conan install
        • conan config
        • conan get
        • conan info
        • conan search
      • Creator commands
      • Package development commands
      • Misc commands
      • JSON Output
      • Return codes
    • conanfile.txt
    • conanfile.py
    • Generators
    • Profiles
    • Build helpers
    • Tools
    • Configuration files
    • Environment variables
    • Hooks
  • Cheatsheet
  • Videos and links
  • FAQ
  • Glossary
  • Changelog
conan

This document is for a "1.X" legacy Conan version, which is no longer recommended. Please update to Conan 2, click here to read the Conan 2 documentation

🔍 Scan for vulnerabilities in your packages with the new conan audit command. Register now.

  • Reference
  • Commands
  • conan search
  • Edit on GitHub

conan search

$ conan search [-h] [-o] [-q QUERY] [-r REMOTE] [--case-sensitive]
               [--raw] [--table TABLE] [-j JSON] [-rev]
               [pattern_or_reference]

Searches package recipes and binaries in the local cache or a remote. Unless a remote is specified only the local cache is searched.

If you provide a pattern, then it will search for existing package recipes matching it. If a full reference is provided (pkg/0.1@user/channel) then the existing binary packages for that reference will be displayed. The default remote is ignored, if no remote is specified, the search will be done in the local cache. Search is case sensitive, the exact case has to be used. For case insensitive file systems, like Windows, case sensitive search can be forced with ‘–case-sensitive’.

positional arguments:
  pattern_or_reference  Pattern or package recipe reference, e.g., 'boost/*',
                        'MyPackage/1.2@user/channel'

optional arguments:
  -h, --help            show this help message and exit
  -o, --outdated        Show only outdated from recipe packages. This flag can
                        only be used with a reference
  -q QUERY, --query QUERY
                        Packages query: 'os=Windows AND (arch=x86 OR
                        compiler=gcc)'. The 'pattern_or_reference' parameter
                        has to be a reference: MyPackage/1.2@user/channel
  -r REMOTE, --remote REMOTE
                        Remote to search in. '-r all' searches all remotes
  --case-sensitive      Make a case-sensitive search. Use it to guarantee
                        case-sensitive search in Windows or other case-
                        insensitive file systems
  --raw                 Print just the list of recipes
  --table TABLE         Outputs html file with a table of binaries. Only valid
                        for a reference search
  -j JSON, --json JSON  json file path where the search information will be
                        written to
  -rev, --revisions     Get a list of revisions for a reference or a package
                        reference.

Examples

$ conan search "zlib/*"
$ conan search "zlib/*" -r=conancenter

To search for recipes in all defined remotes use -r all (this is only valid for searching recipes, not binaries):

$ conan search "zlib/*" -r=all

If you use instead the full package recipe reference, you can explore the binaries existing for that recipe, also in a remote or in the local conan cache:

$ conan search boost/1.71.0@

Query syntax

A query syntax is allowed to look for specific binaries, you can use AND and OR operators and parenthesis, with settings and also options.

$ conan search boost/1.71.0@ -q arch=x86_64
$ conan search boost/1.71.0@ -q "(arch=x86_64 OR arch=ARM) AND (build_type=Release OR os=Windows)"

Query syntax allows sub-settings, even for custom ones. e.g:

$ conan search boost/1.71.0@ -q "compiler=gcc AND compiler.version=9"
$ conan search boost/1.71.0@ -q "os=Linux AND os.distro=Ubuntu AND os.distro.version=19.04"

If you specify a query filter for a setting and the package recipe is not restricted by this setting, Conan won’t find the packages. e.g:

class MyRecipe(ConanFile):
    name = "my_recipe"
    settings = "arch",
$ conan search my_recipe/1.0@lasote/stable -q os=Windows

The query above won’t find the my_recipe binary packages (because the recipe doesn’t declare “os” as a setting) unless you specify the None value:

$ conan search my_recipe/1.0@lasote/stable -q os=None

Tabular output

You can generate a table for all binaries from a given recipe with the --table argument:

$ conan search jinja2cpp/1.1.0@ --table=file.html -r=conancenter
$ file.html # or open the file, double-click
../../../_images/conan-search_binary_table.png

Recipe and package revisions

Search all the local Conan packages matching a pattern and showing the revision:

$ conan search "lib*" --revisions
$ Existing package recipes:

  lib/1.0@user/channel#404e86c18e4a47a166fabe70b3b15e33

Search the local revision for a local cache recipe:

$ conan search lib/1.0@conan/testing --revisions
$ Revisions for 'lib/1.0@conan/testing':
    a55e3b054fdbf4e2c6f10e955da69502 (2019-03-05 16:37:27 UTC)

Search the remote revisions in a server:

$ conan search lib/1.0@conan/testing --revisions -r=myremote
  Revisions for 'lib/1.0@conan/testing' at remote 'myremote':
    78fcef25a1eaeecd5facbbf08624c561 (2019-03-05 16:37:27 UTC)
    f3367e0e7d170aa12abccb175fee5f97 (2019-03-05 16:37:27 UTC)
Previous Next

© Copyright 2016-2022, JFrog. Last updated on Apr 29, 2025.

Version: 1.60
Versions
2.16
2.15
2.14
2.13
2.12
2.11
2.10
2.9
2.8
2.7
2.6
2.5
2.4
2.3
2.2
2.1
2.0
2

1
1.66
1.65
1.64
1.63
1.62
1.61
1.60
1.59
1.58
1.57
1.56
1.55
1.54
1.53
1.52
1.51
1.50
1.49
1.48
1.47
1.46
1.45
1.44
1.43
1.42
1.41
1.40
1.39
1.38
1.37
1.36
1.35
1.34
1.33
1.32
1.31
1.30
1.29
1.28
1.27
1.26
1.25
1.24
1.23
1.22
1.21
1.20
1.19
1.18
1.17
1.16
1.15
1.14
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.4
1.3
Downloads
PDF