# Command line

Use the `remember-cards` CLI to create, update, and fetch cards from your terminal.

## Install

Install the package from PyPI:

<terminal title="Install">
uv tool install remember-cards
</terminal>

## Authentication

Create an API key from your [profile](/profile), then expose it as an environment variable:

<terminal title="Authentication">
export REMEMBER_CARDS_API_KEY=rc_...
</terminal>

## Command reference

| Command | Required inputs | Optional inputs | Output |
| --- | --- | --- | --- |
| `remember-cards --help` | none | none | Show top-level help |
| `remember-cards --version` | none | none | Show the installed CLI version |
| `add` | `--front TEXT`, `--back TEXT` | `--tags TEXT` | New card ID and tag summary |
| `fetch` | `--tag TEXT` | none | Matching cards as Markdown |
| `update` | `--id INTEGER` and at least one changed field | `--front TEXT`, `--back TEXT`, `--tags TEXT` | Updated card ID and tag summary |
| `list-tags` | none | none | Tags with card counts |

## Commands

### Add a card

Add one flashcard to your account.

| Input | Required | Description |
| --- | --- | --- |
| `--front TEXT` | yes | Card front text |
| `--back TEXT` | yes | Card back text |
| `--tags TEXT` | no | Comma-separated tags |

<terminal title="Add a card">
remember-cards add \
  --front "What is spaced repetition?" \
  --back "A review schedule that expands over time." \
  --tags "learning,memory"
</terminal>

Tags are comma-separated and normalized to lowercase.

### Fetch cards by tag

Fetch cards matching one tag and print them as Markdown.

| Input | Required | Description |
| --- | --- | --- |
| `--tag TEXT` | yes | Tag name to filter cards by |

<terminal title="Fetch cards">
remember-cards fetch --tag learning
</terminal>

Cards are printed as Markdown blocks, which makes the output easy to save, pipe, or edit.

### Update a card

Update an existing card by numeric ID. At least one of `--front`, `--back`, or `--tags` must be provided.

| Input | Required | Description |
| --- | --- | --- |
| `--id INTEGER` | yes | Card ID to update |
| `--front TEXT` | no | New card front text; omit to keep the current front |
| `--back TEXT` | no | New card back text; omit to keep the current back |
| `--tags TEXT` | no | New comma-separated tags; pass `""` to clear, omit to keep current tags |

<terminal title="Update a card">
remember-cards update \
  --id 42 \
  --front "What is spaced repetition good for?" \
  --back "Remembering information with less repeated effort."
</terminal>

Omit fields you want to keep unchanged. To replace all tags, pass a new comma-separated list:

<terminal title="Replace tags">
remember-cards update --id 42 --tags "learning,anki"
</terminal>

To clear tags, pass an empty string:

<terminal title="Clear tags">
remember-cards update --id 42 --tags ""
</terminal>

### List tags

List every tag attached to your cards.

| Input | Required | Description |
| --- | --- | --- |
| none | no | This command has no command-specific inputs |

<terminal title="List tags">
remember-cards list-tags
</terminal>

This prints every tag attached to your cards, plus the number of cards for each tag.

### Check the version

Show the installed CLI version.

| Input | Required | Description |
| --- | --- | --- |
| none | no | This command has no inputs |

<terminal title="Version">
remember-cards --version
</terminal>

## See also

- [API v1 reference](/resources/api) — use HTTP directly from scripts or integrations.
- [Import / Export](/resources/import-export) — bulk-load or export your library.
