@ls-apis/cli 0.0.0
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 +144 -0
- package/data/apis.json +43955 -0
- package/dist/categories.js +13 -0
- package/dist/colors.js +19 -0
- package/dist/config.js +32 -0
- package/dist/formatter.js +73 -0
- package/dist/index.js +150 -0
- package/dist/providers.js +21 -0
- package/dist/search.js +50 -0
- package/dist/types.js +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# ls-apis
|
|
2
|
+
|
|
3
|
+
### Public APIs Discovery for Humans & Agents
|
|
4
|
+
|
|
5
|
+
A curated collection of **2,500+ public APIs** with a powerful CLI search tool. Discover, filter, and explore APIs by category, authentication type.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Comprehensive Dataset** - 4,500+ APIs aggregated from multiple sources
|
|
10
|
+
- **Smart Search** - Filter by query, category, authentication type
|
|
11
|
+
- **Colored Output** - Syntax-highlighted results (use `--no-color` to disable)
|
|
12
|
+
- **Multiple Output Formats** - Text or JSON output
|
|
13
|
+
- **Extensible Architecture** - Pluggable fetchers for adding new API sources
|
|
14
|
+
- **TypeScript** - Fully typed for better developer experience
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git clone https://github.com/koalyptus/ls-apis.git
|
|
20
|
+
cd ls-apis
|
|
21
|
+
npm install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @ls-apis/cli
|
|
28
|
+
ls-apis -q weather
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### CLI Search
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Search by keyword
|
|
37
|
+
npx ls-apis -q weather
|
|
38
|
+
|
|
39
|
+
# Filter by category
|
|
40
|
+
npx ls-apis -c weather
|
|
41
|
+
|
|
42
|
+
# Filter by authentication type
|
|
43
|
+
npx ls-apis -a apiKey
|
|
44
|
+
|
|
45
|
+
# Combine filters
|
|
46
|
+
npx ls-apis -q weather -c data -a oauth
|
|
47
|
+
|
|
48
|
+
# Limit results
|
|
49
|
+
npx ls-apis -q weather -l 10
|
|
50
|
+
|
|
51
|
+
# Output as JSON
|
|
52
|
+
npx ls-apis -q weather -o json
|
|
53
|
+
|
|
54
|
+
# Sort by name
|
|
55
|
+
npx ls-apis -q weather -s name
|
|
56
|
+
|
|
57
|
+
# List all categories
|
|
58
|
+
npx ls-apis categories
|
|
59
|
+
|
|
60
|
+
# List categories sorted by count
|
|
61
|
+
npx ls-apis categories --sort count
|
|
62
|
+
|
|
63
|
+
# List categories as JSON
|
|
64
|
+
npx ls-apis categories --output json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Commands
|
|
68
|
+
|
|
69
|
+
| Command | Description |
|
|
70
|
+
| ------------ | ----------------------------------- |
|
|
71
|
+
| `categories` | List all API categories with counts |
|
|
72
|
+
| `providers` | List all data providers |
|
|
73
|
+
|
|
74
|
+
### Categories Options
|
|
75
|
+
|
|
76
|
+
| Flag | Alias | Description |
|
|
77
|
+
| ---------- | ----- | ----------------------------------- |
|
|
78
|
+
| `--sort` | `-s` | Sort by: name (default), count |
|
|
79
|
+
| `--output` | `-o` | Output format: text (default), json |
|
|
80
|
+
|
|
81
|
+
### Providers Options
|
|
82
|
+
|
|
83
|
+
| Flag | Alias | Description |
|
|
84
|
+
| ---------- | ----- | ----------------------------------- |
|
|
85
|
+
| `--sort` | `-s` | Sort by: name (default), count |
|
|
86
|
+
| `--output` | `-o` | Output format: text (default), json |
|
|
87
|
+
|
|
88
|
+
### Options
|
|
89
|
+
|
|
90
|
+
| Flag | Alias | Description |
|
|
91
|
+
| ------------ | ----- | ------------------------------------------- |
|
|
92
|
+
| `--query` | `-q` | Search query (filters name, description) |
|
|
93
|
+
| `--category` | `-c` | Filter by category |
|
|
94
|
+
| `--auth` | `-a` | Filter by auth type (apiKey, OAuth, no) |
|
|
95
|
+
| `--limit` | `-l` | Max results to show (default: 20) |
|
|
96
|
+
| `--output` | `-o` | Output format: text or json (default: text) |
|
|
97
|
+
| `--sort` | `-s` | Sort results: name, category, auth |
|
|
98
|
+
| `--no-color` | | Disable colors in output |
|
|
99
|
+
| `--help` | `-h` | Show help |
|
|
100
|
+
| `--version` | `-V` | Show version |
|
|
101
|
+
|
|
102
|
+
> **Note**: Colors are enabled by default. Use `--no-color` or set `NO_COLOR=1` environment variable to disable.
|
|
103
|
+
|
|
104
|
+
### Configuration File
|
|
105
|
+
|
|
106
|
+
A config file is automatically created at `~/.ls-apis` on first run. You can edit it to set personal defaults. CLI flags always override config values.
|
|
107
|
+
|
|
108
|
+
**Location**: `~/.ls-apis` (your home directory)
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"limit": 10,
|
|
113
|
+
"descriptionMaxLength": 150,
|
|
114
|
+
"colors": true
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| Key | Default | Description |
|
|
119
|
+
| ---------------------- | ------- | --------------------------- |
|
|
120
|
+
| `limit` | 20 | Default max results |
|
|
121
|
+
| `descriptionMaxLength` | 250 | Max chars before truncation |
|
|
122
|
+
| `colors` | true | Enable terminal colors |
|
|
123
|
+
|
|
124
|
+
The config file is plain JSON. Edit it manually to customize defaults, or delete it to regenerate with built-in values. Uses only Node.js standard library (`os`, `path`, `fs/promises`).
|
|
125
|
+
|
|
126
|
+
### Example Output
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Found 2 APIs:
|
|
130
|
+
Weather API
|
|
131
|
+
Description: Get real-time weather data for any location...
|
|
132
|
+
Link: https://api.weather.example.com
|
|
133
|
+
Auth: apiKey
|
|
134
|
+
Categories: weather, data
|
|
135
|
+
Sources: apis-guru
|
|
136
|
+
|
|
137
|
+
Weather2 API
|
|
138
|
+
Description: Comprehensive weather forecasting service...
|
|
139
|
+
Link: https://api.weather2.example.com
|
|
140
|
+
Auth: OAuth
|
|
141
|
+
Categories: weather, forecast
|
|
142
|
+
Sources: publicapis-dev
|
|
143
|
+
```
|
|
144
|
+
|