Skip to main content

Thrones CLI

A command line interface for browsing cards from A Game of Thrones LCG 2nd Ed.

Why?

Thronesdb.com is a great web site, but sometimes it's just nice to do things from the command line.

Thrones CLI also has the ability produce card count breakdowns based on a selected field, with the --count option.

Install

Thrones CLI can be installed from PyPI using pip:

sudo pip install thronescli

Options

Thrones CLI has the following options as given by the --help option:

$ thronescli --help
Usage: thronescli [OPTIONS] [TEXT]...

Options:
  --update       Update card database
  -v, --verbose  Show more data.
  --brief        Show one line of data, regardless the level of verbose.
  --long         Show multiple lines of data, regardless the level of verbose.
  --show FIELD   Show given field only. Can be repeated to show multiple
                 fields in given order.
  --case         Use case sensitive filtering.
  --exact        Use exact match filtering.
  --regex        Use regular rexpressions when filtering.
  --or FIELD     Treat multiple tests for given field with logical
                 disjunction, i.e. OR-logic instead of AND-logic.
  --inclusive    Treat multiple tests for different fields with logical
                 disjunction, i.e. OR-logic instead of AND-logic.
  --sort FIELD   Sort results by given field.
  --desc         Sort results in descending order.
  --group FIELD  Group results by given field.
  --count FIELD  Print a breakdown of all values for given field.
  --version      Show the version and exit.
  --help         Show this message and exit.

Field filters:
  -n, --name TEXT         Filter on matching name.
  --trait TEXT            Filter on matching traits.
  -x, --text TEXT         Filter on matching text.
  --keyword TEXT          Filter on matching keywords.
  --unique                Filter on unique.
  --non-unique            Filter on non-unique.
  --loyal                 Filter on loyal.
  --non-loyal             Filter on non-loyal.
  -f, --faction FACTION   Filter on matching faction.
  --faction-isnt FACTION  Filter on non-matching faction.
  -t, --type TYPE         Filter on matching type.
  --type-isnt TYPE        Filter on non-matching type.
  --cost NUMBER           Filter on matching cost (number comparison).
  --ambush-cost NUMBER    Filter on matching ambush cost (number comparison).
  --bestow-limit NUMBER   Filter on matching bestow limit (number comparison).
  --shadow-cost NUMBER    Filter on matching shadow cost (number comparison).
  --str NUMBER            Filter on matching str (number comparison).
  --icon ICON             Filter on having given icon.
  --icon-isnt ICON        Filter on not having given icon.
  --claim NUMBER          Filter on matching claim (number comparison).
  --income NUMBER         Filter on matching income (number comparison).
  --initiative NUMBER     Filter on matching initiative (number comparison).
  --reserve NUMBER        Filter on matching reserve (number comparison).
  --illustrator TEXT      Filter on matching illustrator.
  --set TEXT              Filter on matching set.

Where:
  FACTION  One of: baratheon, gj, greyjoy, lannister, martell, neutral,
           night's watch, nw, stark, targaryen, the night's watch, tyrell.
  FIELD    One of: ambush cost, bestow limit, claim, cost, faction, icons,
           illustrator, income, initiative, keywords, loyal, name, reserve,
           set, shadow cost, str, text, traits, type, unique.
  ICON     One of: military, intrigue, power. A combination of the letters
           'MIP' can be used to define multiple respective icons.
  NUMBER   A number optionally prefixed by one of the supported comparison
           operators: ==, =, !=, !, <=, <, >=, >. Or a range of two numbers
           separated with the .. operator. With == being the default operator
           if none is given.
  TEXT     A text partially matching the field value. The --case, --regex and
           --exact options can be applied. If prefixed with ! the match is
           negated.
  TYPE     One of: agenda, attachment, character, event, location, plot,
           title.

Examples

Find a card by its name:

$ thronescli Asha
Asha Greyjoy: Unique. House Greyjoy. Character. 5 Cost. 4 STR. M P.
Asha Greyjoy: Unique. Loyal. House Greyjoy. Character. 7 Cost. 5 STR. M I P.
Asha Greyjoy: Unique. House Greyjoy. Character. 6 Cost. 5 STR. M P.

Total count: 3

Print more of the cards' information:

$ thronescli Asha -v
Asha Greyjoy
Ironborn. Lady.
Stealth.
Reaction: After you win an unopposed challenge in which Asha Greyjoy is participating, stand her.
Unique: Yes
Loyal: No
Faction: House Greyjoy
Type: Character
Cost: 5
STR: 4
Icons: M P

Asha Greyjoy
Captain. Ironborn. Lady.
Pillage. Stealth.
Reaction: After Asha Greyjoy discards a card using pillage, search the top X cards of your deck for a card and add it to your hand. Shuffle your deck. X is the number of cards in the losing opponent's
discard pile.
Unique: Yes
Loyal: Yes
Faction: House Greyjoy
Type: Character
Cost: 7
STR: 5
Icons: M I P

Asha Greyjoy
Captain. Ironborn. Lady.
Pillage. Stealth.
Each other unique Ironborn character you control gains stealth.
Unique: Yes
Loyal: No
Faction: House Greyjoy
Type: Character
Cost: 6
STR: 5
Icons: M P

Total count: 3

Find all Greyjoy characters with an intrigue icon, grouped by STR:

$ thronescli -f gj --icon i --group str
[ 1 STR ]

Lordsport Shipwright: House Greyjoy. Character. 2 Cost. 1 STR. I.
The Reader's Septon: House Greyjoy. Character. 2 Cost. 1 STR. I P.
Harlaw Scout: House Greyjoy. Character. 2 Cost. 1 STR. M I.

[ 2 STR ]

Alannys Greyjoy: Unique. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Priest of the Drowned God: House Greyjoy. Character. 3 Cost. 2 STR. I P.
Esgred: Unique. House Greyjoy. Character. 5 Cost. 2 STR. M I P.
Wex Pyke: Unique. House Greyjoy. Character. 2 Cost. 2 STR. M I.
Drowned God Fanatic: Loyal. House Greyjoy. Character. 3 Cost. 2 STR. M I.
Maester Murenmure: Unique. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Old Grey Gull: Unique. Loyal. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Drowned God Fanatic: Loyal. House Greyjoy. Character. 3 Cost. 2 STR. M I.
Cragorn: Unique. House Greyjoy. Character. 2 Cost. 2 STR. I.

[ 3 STR ]

Drowned God's Apostle: House Greyjoy. Character. 4 Cost. 3 STR. I P.
Aeron Damphair: Unique. Loyal. House Greyjoy. Character. 5 Cost. 3 STR. I P.
Hotho Humpback: Unique. House Greyjoy. Character. 4 Cost. 3 STR. I P.
Left-Hand Lucas Codd: Unique. House Greyjoy. Character. 4 Cost. 3 STR. M I.
Ralf Kenning: Unique. Loyal. House Greyjoy. Character. 4 Cost. 3 STR. M I.
Moqorro: Unique. House Greyjoy. Character. 3 Cost. 3 STR. I.

[ 4 STR ]

The Reader: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
Aeron Damphair: Unique. House Greyjoy. Character. 6 Cost. 4 STR. I P.
Tarle the Thrice-Drowned: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 6 Cost. 4 STR. M I P.
Alannys Greyjoy: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
King's Landing Proselyte: House Greyjoy. Character. 4 Cost. 4 STR. I P.
Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 6 Cost. 4 STR. M I P.
Dagmer Cleftjaw: Unique. House Greyjoy. Character. 5 Cost. 4 STR. M I.

[ 5 STR ]

Asha Greyjoy: Unique. Loyal. House Greyjoy. Character. 7 Cost. 5 STR. M I P.
Tarle the Thrice-Drowned: Unique. Loyal. House Greyjoy. Character. 6 Cost. 5 STR. I P.

[ 6 STR ]

Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 7 Cost. 6 STR. M I P.

Total count: 29

Find all non-limited income providing cards:

$ thronescli --text "\\+\\d+ Income" --text "!Limited" --regex
Littlefinger: Unique. Neutral. Character. 5 Cost. 4 STR. I P.
Tywin Lannister: Unique. Loyal. House Lannister. Character. 7 Cost. 6 STR. M I P.
Paxter Redwyne: Unique. Loyal. House Tyrell. Character. 4 Cost. 3 STR. I.
Master of Coin: Neutral. Title.
The God's Eye: Unique. Neutral. Location. 3 Cost.
Shield of Lannisport: Unique. Loyal. House Lannister. Attachment. 3 Cost.
Mace Tyrell: Unique. Loyal. House Tyrell. Character. 6 Cost. 4 STR. I P.
Northern Armory: Loyal. House Stark. Location. 2 Cost.
Stormlands Fiefdom: Loyal. House Baratheon. Location. 2 Cost.
Tycho Nestoris: Unique. Neutral. Character. 6 Cost. 3 STR. P.
Miner's Pick: Loyal. The Night's Watch. Attachment. 1 Cost.
Gold Mine: Loyal. House Lannister. Location. 2 Cost.
Summer Sea Port: Loyal. House Martell. Location. 2 Cost.
Tithe Collector: House Lannister. Character. 3 Cost. 3 STR. I.
Meereenese Market: Loyal. House Targaryen. Location. 2 Cost.
Refurbished Hulk: Loyal. House Greyjoy. Location. 2 Cost.
Arbor Marketplace: Loyal. House Tyrell. Location. 2 Cost.
Knights of the Hollow Hill: Neutral. Agenda.
The Red Keep: Unique. House Lannister. Location. 4 Cost.
The Red Keep: Unique. House Lannister. Location. 4 Cost.
Ser Harys Swyft: Unique. House Lannister. Character. 4 Cost. 4 STR. P.
Fair Isle: Unique. Loyal. House Lannister. Location. 3 Cost.
The Green Fork: Unique. Neutral. Location. 2 Cost.
Garth Greenhand: Unique. Loyal. House Tyrell. Attachment. 3 Cost.
Lannisport: Unique. Loyal. House Lannister. Location. 3 Cost.
Gyles Rosby: Unique. House Lannister. Character. 3 Cost. 3 STR. P.
Redwyne Merchanter: House Tyrell. Location. 2 Cost.

Total count: 27

Find the best faction for using Street of Silk:

$ thronescli --trait ally --trait companion --or trait --count faction
[ Faction counts ]

House Targaryen:   31
Neutral:           29
House Lannister:   24
The Night's Watch: 17
House Martell:     16
House Baratheon:   15
House Stark:       14
House Greyjoy:     13
House Tyrell:      13

Total count: 172

Find all 1 cost characters and get a breakdown of their trait and icon spread.

$ thronescli --cost 1 -t char --count icon --count trait
[ Icons counts ]

Power:       13
Intrigue:    8
Military:    4

[ Traits counts ]

Ally:        13
Steward:     4
Merchant:    3
Raven:       2
Lord:        2
Mercenary:   2
Companion:   2
Builder:     1
Maester:     1
Fool:        1
House Frey:  1
House Arryn: 1
Recruit:     1
Spy:         1
Wildling:    1

Total count: 26

Find all non-unique Ranger characters that can take attachments.

$ thronescli --trait ranger --non-unique --keyword "!No attachments"
Vindictive Ranger
Ranger.
Reaction: After you lose a challenge as the defending player, Vindictive Ranger gains stealth and a challenge icon of your choice until the end of the phase.
Unique: No
Loyal: No
Faction: The Night's Watch
Type: Character
Cost: 3
STR: 3
Icons: M

Total count: 1

Credits

Metadata

Release files for thronescli 3.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thronescli 3.5.0
File Size Uploaded
thronescli-3.5.0.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thronescli 3.5.0
File Interpreter ABI Platform
thronescli-3.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / thronescli-3.5.0.tar.gz

Download URL thronescli-3.5.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
60badd4720b9945fc616ad66f6e27b6881565792e12f330c93c06a8fb6c93dfc
BLAKE2b-256 checksum
How to use checksums
a8b36128929e786d777e252714f742979b79c5f82951ad1f1564f7d2485ddd3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / thronescli-3.5.0-py3-none-any.whl

Download URL thronescli-3.5.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3cefeaf564ed6312d4b71f0f44d99bab284dc900636e71dab39a5b315634288
BLAKE2b-256 checksum
How to use checksums
3a1918411230d03e8988bb58436b20e3ea8e33ce1ea0bb8002edfd15b34ba5bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

3.5.0 This release

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.0

1 release file

2.4.0

1 release file

2.3.0

1 release file

2.1.0

1 release file

2.0.0

1 release file

1.6.2

3 release files

1.6.1

3 release files

1.6.0

3 release files

1.5.4

3 release files

1.5.3

3 release files

1.5.2

3 release files

1.5.1

3 release files

1.5.0

3 release files

1.4.4

3 release files

1.4.3

3 release files

1.4.2

3 release files

1.3.1

3 release files

1.3.0

3 release files

1.2.4

3 release files

1.2.3

3 release files

1.2

3 release files

1.1

3 release files

1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page