This repository is to run our CLI interface. This repo specifically allows users to search cards from the command line.
The cli is intended to help search the database and make api calls to get the specific card or cards. Once the card(s) are found user can add them to their portfolio and either quit out of the application or continue to add more cards to their profile.
We used inquirer to build our CLI.
Inquirer provides the user interface and the inquiry session flow.
- providing error feedback
- asking questions
- parsing input
- validating answers
- managing hierarchical prompts
Inquirers question objects can contain:
type: name: message: choices:
inquirer
.prompt([
/* Pass your questions in here */
])
.then((answers) => {
// Use user feedback for... whatever!!
})
.catch((error) => {
if (error.isTtyError) {
// Prompt couldn't be rendered in the current environment
} else {
// Something else went wrong
}
});
npm install inquirer@^8.0.0
npm install axios
const inquirer = require('inquirer');
const axios = require('axios');
No Tests for the CLI
Stretch Goals would be to create routes for all colors (cards with dual or more than one color type), create a route for all types, subtypes, and manacost.
.png)
.png)