{"id":23419718,"url":"https://github.com/pdroll/card-dealer-cli","last_synced_at":"2025-10-07T09:18:42.568Z","repository":{"id":224285706,"uuid":"761023551","full_name":"pdroll/card-dealer-cli","owner":"pdroll","description":"CLI utility for interacting with a deck of cards: Pick a card or deal a hand.","archived":false,"fork":false,"pushed_at":"2024-03-05T21:06:01.000Z","size":387,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-16T05:27:33.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdroll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T05:02:06.000Z","updated_at":"2024-09-29T18:16:47.000Z","dependencies_parsed_at":"2024-03-01T04:28:12.535Z","dependency_job_id":"547c166d-b48a-4349-9cf4-839ba22b399d","html_url":"https://github.com/pdroll/card-dealer-cli","commit_stats":null,"previous_names":["pdroll/card-dealer-cli"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pdroll/card-dealer-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2Fcard-dealer-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2Fcard-dealer-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2Fcard-dealer-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2Fcard-dealer-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdroll","download_url":"https://codeload.github.com/pdroll/card-dealer-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdroll%2Fcard-dealer-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278748344,"owners_count":26038891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-23T01:28:08.431Z","updated_at":"2025-10-07T09:18:42.526Z","avatar_url":"https://github.com/pdroll.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Card Dealer CLI\n\nCLI utility for interacting with a deck of cards. You can draw a random card or cards from various types of decks (standard, euchre, pinochle, or canasta). You can also deal a hand for several card games: blackjack, poker, euchre, pinochle, canasta, gin, or rummy.\n\n## Installation\n\n```sh\nnpm install -g card-dealer-cli\n```\n\n## CLI Usage\n\nThere are two commands available: `pick-a-card` and `deal-a-hand`\n\n```sh\nUsage: card-dealer [options] [command]\n\nOptions:\n  -p, --perfect-shuffle        Should all randomness be removed when shuffling the deck? (default:false)\n  -t, --shuffle-times \u003ctimes\u003e  How many times should we shuffle the deck? (default: 7)\n  --cut [Y/n]                  Do you want to cut the deck after shuffling?\n  -h, --help                   display help for command\n\nCommands:\n  pick-a-card [options]        Pick a random card or cards from a deck\n  deal-a-hand [options]        Deal a hand for one of several types of card games\n  help [command]               display help for command\n```\n\n### `pick-a-card`\n\nPick a random card (or multiple cards) from a deck of cards.\n\n![pick-a-card cli in action](./pick-a-card.gif)\n\n(_This is the default command, so it will run if you don't specify another command_)\n\n```sh\nUsage: card-dealer pick-a-card [options]\n\nPick a random card or cards from a deck\n\nOptions:\n  -d, --deck \u003cdeck-type\u003e  What type of deck should we use (choices: \"standard\", \"double\", \"euchre\", \"canasta\", \"pinochle\", default: \"standard\")\n  -c, --count \u003cnumber\u003e    How many cards should be chosen? (default: 1)\n  --top                   Should the card be pulled from the top of the deck, rather than at a random point in the deck? (default: false)\n  -h, --help              display help for command\n```\n\n#### Examples\n\nPick a random card from a standard 52 card deck:\n\n```sh\ncard-dealer\n```\n\nCut the deck after shuffling without being prompted\n\n```sh\ncard-dealer pick-a-card --cut\n```\n\nDo not shuffle or cut the deck and pick a card off the top of the deck. (This will not be random at all).\n\n```sh\ncard-dealer pick-a-card --shuffle-times 0 --cut n --top\n```\n\nPick two random cards from a canata deck:\n\n```sh\ncard-dealer pick-a-card --deck canasta --count 2\n```\n\n### `deal-a-hand`\n\nDeal the initial hand for several types of cards games: blackjack, poker, euchre, pinochle, canasta, gin or rummy.\n\n![deal-a-hand cli in use](./deal-a-hand.gif)\n\n```sh\nUsage: card-dealer deal-a-hand [options]\n\nDeal a hand for one of several types of card games\n\nOptions:\n  -g, --game \u003cgame-type\u003e  What card game should we deal a hand for? (choices: \"blackjack\", \"poker\", \"euchre\", \"pinochle\", \"canasta\", \"gin\", \"rummy\")\n  -h, --help              display help for command\n```\n\n#### Examples\n\nDeal hand, being prompted for what game\n\n```sh\ncard-dealer deal-a-hand\n```\n\nDeal a game of Texas hold 'em poker\n\n```sh\ncard-dealer deal-a-hand --game poker\n```\n\nDeal a game Euchre without shuffling, only cutting the deck once\n\n```sh\ncard-dealer deal-a-hand --game euchre --shuffle-times 0 --cut\n```\n\n## Importing libs\n\nIn addition to the CLI utility, you can also import the underlying classes and objects for use in your own application.\n\n```sh\nnpm install card-dealer-cli\n```\n\n### Usage\n\n```ts\nimport { StandardDeck, CanastaDeck } from 'card-dealer-cli'\n\nconst deck = new StandardDeck()\nconst canastaDeck = new CanastaDeck()\n\nconsole.log(deck.count) # =\u003e 52\nconsole.log(canastaDeck.count) # =\u003e 108\n\n# Shuffle the deck three times\ndeck.riffleShuffle(3)\n# Cut the deck\ndeck.cut()\n\nconst hands = deck.dealHands({ cardsPerHand: 5, numberOfHands: 3 })\n\nconsole.log(hands[0].showCards()) # =\u003e ♠️ J   ♣️ 2   ♣️ 5   ♥ 3   ♦ 2\n```\n\nSee the [`BaseDeck` definition](./src/lib/base-deck.ts) for available functions on `deck` objects and in [`deck.ts`](./src/lib/deck.ts) for the types of decks available. Look in the [`lib` directory](./src/lib/) for defintions of other objects such as `Card` and `Hand`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdroll%2Fcard-dealer-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdroll%2Fcard-dealer-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdroll%2Fcard-dealer-cli/lists"}