@countrystatecity/cli 0.1.2 → 0.1.3
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 +24 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @countrystatecity/cli
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@countrystatecity/cli)
|
|
4
|
+
[](https://github.com/dr5hn/countrystatecity-npm/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@countrystatecity/cli)
|
|
6
|
+
[](https://www.npmjs.com/package/@countrystatecity/cli)
|
|
7
|
+
|
|
3
8
|
Official CLI for the [Country State City API](https://countrystatecity.in) — search, explore, and generate code from geographic data.
|
|
4
9
|
|
|
5
10
|
```bash
|
|
@@ -19,6 +24,16 @@ csc search countries
|
|
|
19
24
|
csc get country IN
|
|
20
25
|
```
|
|
21
26
|
|
|
27
|
+
## Global Flags
|
|
28
|
+
|
|
29
|
+
These flags work on every command:
|
|
30
|
+
|
|
31
|
+
| Flag | Short | Description |
|
|
32
|
+
|------|-------|-------------|
|
|
33
|
+
| `--json` | | Output raw JSON instead of formatted tables |
|
|
34
|
+
| `--quiet` | `-q` | Suppress all decorative output (spinners, tips) |
|
|
35
|
+
| `--no-footer` | | Hide the API usage footer after each command |
|
|
36
|
+
|
|
22
37
|
## Commands
|
|
23
38
|
|
|
24
39
|
### Authentication
|
|
@@ -27,7 +42,9 @@ csc get country IN
|
|
|
27
42
|
csc auth login # Interactive login with API key
|
|
28
43
|
csc auth login --key <KEY> # Login with key directly
|
|
29
44
|
csc auth status # Check current auth status
|
|
45
|
+
csc auth status --json # Returns { authenticated, key, tier, daily, monthly }
|
|
30
46
|
csc auth logout # Remove stored API key
|
|
47
|
+
csc auth logout --json # Returns { success: true }
|
|
31
48
|
```
|
|
32
49
|
|
|
33
50
|
### Search
|
|
@@ -56,9 +73,12 @@ csc search india
|
|
|
56
73
|
# Detailed country info (timezones, coordinates, currency, etc.)
|
|
57
74
|
csc get country IN
|
|
58
75
|
csc get country US --json
|
|
76
|
+
csc get country # Interactive — prompts to pick a country (TTY only)
|
|
59
77
|
|
|
60
78
|
# Detailed state info
|
|
61
79
|
csc get state IN MH
|
|
80
|
+
csc get state IN MH --json
|
|
81
|
+
csc get state # Interactive — prompts for country then state (TTY only)
|
|
62
82
|
```
|
|
63
83
|
|
|
64
84
|
### Usage & Billing
|
|
@@ -66,9 +86,11 @@ csc get state IN MH
|
|
|
66
86
|
```bash
|
|
67
87
|
# View API usage with progress bars
|
|
68
88
|
csc usage
|
|
89
|
+
csc usage --json # Returns { plan, price, daily, monthly }
|
|
69
90
|
|
|
70
91
|
# View plans and open pricing page
|
|
71
92
|
csc upgrade
|
|
93
|
+
csc upgrade --json # Returns { plans, currentPlan }
|
|
72
94
|
```
|
|
73
95
|
|
|
74
96
|
### Code Generation
|
|
@@ -88,9 +110,9 @@ csc generate seed --entity countries --format prisma
|
|
|
88
110
|
csc generate seed -e states -f prisma --country IN
|
|
89
111
|
csc generate seed -e cities -f prisma -c IN -s MH
|
|
90
112
|
|
|
91
|
-
# Options
|
|
113
|
+
# Options (apply to both dropdown and seed)
|
|
92
114
|
--output <dir> # Output directory (default: current directory)
|
|
93
|
-
--no-typescript # Generate .jsx instead of .tsx
|
|
115
|
+
--no-typescript # Generate .jsx instead of .tsx (dropdown only)
|
|
94
116
|
```
|
|
95
117
|
|
|
96
118
|
#### Example: Generated Country Dropdown
|