@kiyeonjeon21/ncli 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +180 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,180 @@
1
+ # ncli
2
+
3
+ Agent-native CLI for Naver Open APIs.
4
+
5
+ > Unofficial CLI for Naver Open APIs. Not affiliated with NAVER Corp.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @kiyeonjeon21/ncli
11
+ ```
12
+
13
+ Or via curl (includes interactive setup):
14
+
15
+ ```bash
16
+ curl -fsSL https://kiyeonjeon21.github.io/naver-cli/install | bash
17
+ ```
18
+
19
+ Requires Node.js 18+.
20
+
21
+ ## Setup
22
+
23
+ Register an application at [developers.naver.com](https://developers.naver.com/apps/) and run:
24
+
25
+ ```bash
26
+ ncli init
27
+ ```
28
+
29
+ This prompts for your Client ID and Client Secret, then saves them to `~/.ncli/.env`.
30
+
31
+ ## Usage
32
+
33
+ ### Search
34
+
35
+ ```bash
36
+ # Blog search with field mask
37
+ ncli search blog "AI" --fields "title,link,description"
38
+
39
+ # News sorted by date
40
+ ncli search news "semiconductor" --sort date --display 5
41
+
42
+ # Shopping search as JSON payload
43
+ ncli search shop --json '{"query":"macbook","display":3,"sort":"dsc"}' --fields "title,lprice,mallName"
44
+
45
+ # Paginate through results
46
+ ncli search blog "TypeScript" --page-all --max-results 50 --output ndjson
47
+
48
+ # Pipe JSON from stdin
49
+ echo '{"query":"AI","display":5}' | ncli search blog --json -
50
+ ```
51
+
52
+ Available search types: `blog`, `news`, `web`, `image`, `book`, `cafe`, `kin`, `encyclopedia`, `shop`, `local`, `errata`, `adult`, `doc`
53
+
54
+ ### DataLab
55
+
56
+ ```bash
57
+ # Search keyword trend
58
+ ncli datalab trend --json '{
59
+ "startDate": "2026-01-01",
60
+ "endDate": "2026-04-01",
61
+ "timeUnit": "month",
62
+ "keywordGroups": [
63
+ {"groupName": "AI", "keywords": ["AI", "artificial intelligence"]}
64
+ ]
65
+ }'
66
+
67
+ # Shopping category trend
68
+ ncli datalab shopping --json '{
69
+ "startDate": "2026-01-01",
70
+ "endDate": "2026-04-01",
71
+ "timeUnit": "month",
72
+ "category": [{"name": "laptop", "param": ["50000832"]}]
73
+ }'
74
+ ```
75
+
76
+ ### CAPTCHA
77
+
78
+ ```bash
79
+ # Issue image CAPTCHA key
80
+ ncli captcha image key
81
+
82
+ # Download CAPTCHA image
83
+ ncli captcha image download --key <KEY>
84
+
85
+ # Verify user input
86
+ ncli captcha image verify --key <KEY> --value <INPUT>
87
+
88
+ # Voice CAPTCHA (same pattern)
89
+ ncli captcha voice key
90
+ ```
91
+
92
+ ### Schema Introspection
93
+
94
+ ```bash
95
+ # List available services
96
+ ncli schema --list-services
97
+
98
+ # List methods for a service
99
+ ncli schema --list-methods search
100
+
101
+ # Inspect a specific method
102
+ ncli schema search.blog
103
+
104
+ # Or use --describe on any command
105
+ ncli search blog --describe
106
+ ```
107
+
108
+ ### Other Commands
109
+
110
+ ```bash
111
+ # Check auth status
112
+ ncli auth status
113
+
114
+ # Print CONTEXT.md for agent consumption
115
+ ncli context
116
+
117
+ # Show version
118
+ ncli --version
119
+ ```
120
+
121
+ ## Agent-First Design
122
+
123
+ ncli is built for AI agents following the [agentic-cli-guide](https://github.com/kiyeonjeon21/agentic-cli-guide) principles:
124
+
125
+ | Feature | Flag | Purpose |
126
+ |---------|------|---------|
127
+ | JSON output | `--output json` (default) | Machine-readable output |
128
+ | NDJSON streaming | `--output ndjson` | Line-by-line streaming for large results |
129
+ | Field masks | `--fields "title,link"` | Reduce token usage |
130
+ | Dry-run | `--dry-run` | Validate without executing |
131
+ | Sanitize | `--sanitize` | Filter prompt injection in API responses |
132
+ | Schema | `--describe` / `ncli schema` | Runtime API introspection |
133
+ | Stdin | `--json -` | Pipe JSON payloads |
134
+ | File input | `--json @payload.json` | Read JSON from file |
135
+ | Pagination | `--page-all --max-results N` | Auto-paginate search results |
136
+ | Context | `ncli context` | Inject CONTEXT.md into agent context |
137
+
138
+ ### Why CLI over MCP?
139
+
140
+ | Metric | CLI | MCP |
141
+ |--------|-----|-----|
142
+ | Token cost | 1x | 10-32x |
143
+ | Reliability | 100% | ~72% |
144
+ | Startup | Instant | Protocol negotiation |
145
+
146
+ CLI is the pragmatic choice for agent tooling. MCP servers for Naver APIs [already exist](https://github.com/isnow890/naver-search-mcp) for environments that need them.
147
+
148
+ ## Rate Limits
149
+
150
+ | API | Limit |
151
+ |-----|-------|
152
+ | Search (all types) | 25,000/day |
153
+ | DataLab (trend) | 1,000/day |
154
+ | DataLab (shopping) | 1,000/day |
155
+ | CAPTCHA | 1,000/day |
156
+
157
+ ## Configuration
158
+
159
+ Credentials are loaded in this priority:
160
+
161
+ 1. Environment variables (`NAVER_CLIENT_ID`, `NAVER_CLIENT_SECRET`)
162
+ 2. Project `.env` file (via dotenv)
163
+ 3. Global `~/.ncli/.env` (set by `ncli init`)
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ git clone https://github.com/kiyeonjeon21/naver-cli.git
169
+ cd naver-cli
170
+ npm install
171
+ cp .env.example .env # add your credentials
172
+
173
+ npm run dev -- search blog "test" # run in dev mode
174
+ npm test # run tests (58 tests)
175
+ npm run build # compile TypeScript
176
+ ```
177
+
178
+ ## License
179
+
180
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiyeonjeon21/ncli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Agent-native CLI for Naver Open APIs",
5
5
  "type": "module",
6
6
  "bin": {