thecatapi-cli 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/bun.lock +32 -0
- package/dist/index.js +2840 -0
- package/dist/thecatapi-cli.js +2840 -0
- package/package.json +21 -0
- package/skills/thecatapi-cli/SKILL.md +80 -0
- package/src/commands/auth.ts +53 -0
- package/src/index.ts +41 -0
- package/src/lib/auth.ts +54 -0
- package/src/lib/client.ts +107 -0
- package/src/lib/config.ts +29 -0
- package/src/lib/errors.ts +101 -0
- package/src/lib/logger.ts +41 -0
- package/src/lib/output.ts +169 -0
- package/src/resources/breeds.ts +103 -0
- package/src/resources/example.ts +125 -0
- package/src/resources/facts.ts +35 -0
- package/src/resources/favourites.ts +83 -0
- package/src/resources/images.ts +153 -0
- package/src/resources/votes.ts +88 -0
- package/tsconfig.json +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# thecatapi-cli
|
|
2
|
+
|
|
3
|
+
Unofficial CLI for [The Cat API](https://thecatapi.com). Made with [api2cli.dev](https://api2cli.dev).
|
|
4
|
+
|
|
5
|
+
> **Note:** This is a community-maintained project and is not officially affiliated with or endorsed by The Cat API.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx api2cli install thecatapi
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This clones the repo, builds the CLI, links it to your PATH, and installs the AgentSkill to your coding agents.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
thecatapi-cli auth set "your-api-key"
|
|
19
|
+
thecatapi-cli auth test
|
|
20
|
+
thecatapi-cli --help
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Get a free API key at https://thecatapi.com/signup
|
|
24
|
+
|
|
25
|
+
## Resources
|
|
26
|
+
|
|
27
|
+
### images
|
|
28
|
+
|
|
29
|
+
| Command | Description |
|
|
30
|
+
|---------|-------------|
|
|
31
|
+
| `thecatapi-cli images search` | Search random cat images |
|
|
32
|
+
| `thecatapi-cli images search --limit 5 --has-breeds` | Search with filters |
|
|
33
|
+
| `thecatapi-cli images list` | List your uploaded images |
|
|
34
|
+
| `thecatapi-cli images get <id>` | Get a specific image |
|
|
35
|
+
| `thecatapi-cli images upload <file>` | Upload a cat image |
|
|
36
|
+
| `thecatapi-cli images delete <id>` | Delete an uploaded image |
|
|
37
|
+
|
|
38
|
+
### breeds
|
|
39
|
+
|
|
40
|
+
| Command | Description |
|
|
41
|
+
|---------|-------------|
|
|
42
|
+
| `thecatapi-cli breeds list` | List all cat breeds |
|
|
43
|
+
| `thecatapi-cli breeds get <id>` | Get breed details (e.g. abys, beng) |
|
|
44
|
+
| `thecatapi-cli breeds search <query>` | Search breeds by name |
|
|
45
|
+
| `thecatapi-cli breeds facts <id>` | Get facts about a breed |
|
|
46
|
+
|
|
47
|
+
### favourites
|
|
48
|
+
|
|
49
|
+
| Command | Description |
|
|
50
|
+
|---------|-------------|
|
|
51
|
+
| `thecatapi-cli favourites list` | List favourited images |
|
|
52
|
+
| `thecatapi-cli favourites create --image-id <id>` | Add to favourites |
|
|
53
|
+
| `thecatapi-cli favourites delete <id>` | Remove from favourites |
|
|
54
|
+
|
|
55
|
+
### votes
|
|
56
|
+
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| `thecatapi-cli votes list` | List your votes |
|
|
60
|
+
| `thecatapi-cli votes create --image-id <id> --value 1` | Upvote an image |
|
|
61
|
+
| `thecatapi-cli votes delete <id>` | Delete a vote |
|
|
62
|
+
|
|
63
|
+
### facts
|
|
64
|
+
|
|
65
|
+
| Command | Description |
|
|
66
|
+
|---------|-------------|
|
|
67
|
+
| `thecatapi-cli facts list` | Get random cat facts |
|
|
68
|
+
| `thecatapi-cli facts list --limit 10` | Get multiple facts |
|
|
69
|
+
|
|
70
|
+
## Global Flags
|
|
71
|
+
|
|
72
|
+
All commands support: `--json`, `--format <text|json|csv|yaml>`, `--verbose`, `--no-color`, `--no-header`
|
package/bun.lock
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "thecatapi-cli",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"commander": "^13.0.0",
|
|
9
|
+
"picocolors": "^1.1.0",
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@types/bun": "latest",
|
|
13
|
+
"typescript": "^5.7.0",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
"packages": {
|
|
18
|
+
"@types/bun": ["@types/bun@1.3.10", "", { "dependencies": { "bun-types": "1.3.10" } }, "sha512-0+rlrUrOrTSskibryHbvQkDOWRJwJZqZlxrUs1u4oOoTln8+WIXBPmAuCF35SWB2z4Zl3E84Nl/D0P7803nigQ=="],
|
|
19
|
+
|
|
20
|
+
"@types/node": ["@types/node@25.3.5", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA=="],
|
|
21
|
+
|
|
22
|
+
"bun-types": ["bun-types@1.3.10", "", { "dependencies": { "@types/node": "*" } }, "sha512-tcpfCCl6XWo6nCVnpcVrxQ+9AYN1iqMIzgrSKYMB/fjLtV2eyAVEg7AxQJuCq/26R6HpKWykQXuSOq/21RYcbg=="],
|
|
23
|
+
|
|
24
|
+
"commander": ["commander@13.1.0", "", {}, "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw=="],
|
|
25
|
+
|
|
26
|
+
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
|
27
|
+
|
|
28
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
29
|
+
|
|
30
|
+
"undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
|
|
31
|
+
}
|
|
32
|
+
}
|