Skip to content

Commit bb8cc84

Browse files
committed
Make CLI globally installable
1 parent 49f8144 commit bb8cc84

File tree

2 files changed

+36
-11
lines changed

2 files changed

+36
-11
lines changed

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ bunx playwright install chromium
2020
bun src/cli.ts restaurants --query "pizza" --limit 5 --json
2121
```
2222

23+
## Global install (local)
24+
25+
From the repo root:
26+
27+
```bash
28+
bun install
29+
bun run build
30+
31+
# Option 1: Bun link (recommended for local dev)
32+
bun link
33+
clifood restaurants --query "pizza" --limit 5
34+
35+
# Option 2: npm global install from local path
36+
npm install -g .
37+
clifood restaurants --query "pizza" --limit 5
38+
```
39+
2340
## Use your existing logged-in browser (recommended)
2441

2542
Start Chrome with remote debugging enabled, then point the CLI to it:
@@ -29,8 +46,9 @@ Start Chrome with remote debugging enabled, then point the CLI to it:
2946
--remote-debugging-port=9222 \
3047
--user-data-dir="$HOME/.clifood/chrome-profile"
3148

32-
# Then run
49+
# Then run (direct or global)
3350
bun src/cli.ts restaurants --query "japonesa" --cdp-url http://127.0.0.1:9222
51+
clifood restaurants --query "japonesa" --cdp-url http://127.0.0.1:9222
3452
```
3553

3654
This keeps your existing iFood login and address selection. All API calls are executed from your authenticated browser context to avoid bot blocks.
@@ -40,49 +58,49 @@ This keeps your existing iFood login and address selection. All API calls are ex
4058
### Open iFood (manual setup)
4159

4260
```bash
43-
bun src/cli.ts open --wait
61+
clifood open --wait
4462
```
4563

4664
Use this to log in or set your delivery address in the connected browser profile.
4765

4866
### Search restaurants
4967

5068
```bash
51-
bun src/cli.ts restaurants --query "sushi" --limit 10
69+
clifood restaurants --query "sushi" --limit 10
5270
```
5371

5472
Exclude categories or names:
5573

5674
```bash
57-
bun src/cli.ts restaurants --query "a" --exclude pizza --exclude hamburguer --exclude doces --limit 10
75+
clifood restaurants --query "a" --exclude pizza --exclude hamburguer --exclude doces --limit 10
5876
```
5977

6078
Shortcut:
6179

6280
```bash
63-
bun src/cli.ts restaurants --query "a" --exclude-defaults --limit 10
81+
clifood restaurants --query "a" --exclude-defaults --limit 10
6482
```
6583

6684
Defaults cover pizza, burgers, and sweets (including lanches, açaí, sorvetes, bolos).
6785

6886
Top restaurants (discovery feed, no search term):
6987

7088
```bash
71-
bun src/cli.ts restaurants --top --exclude-defaults --limit 10
89+
clifood restaurants --top --exclude-defaults --limit 10
7290
```
7391

7492
### Search items in a restaurant
7593

7694
```bash
77-
bun src/cli.ts items --restaurant "Restaurante X" --query "temaki" --limit 10
95+
clifood items --restaurant "Restaurante X" --query "temaki" --limit 10
7896
```
7997

8098
You can also pass a full iFood restaurant URL with `--restaurant`.
8199

82100
### Place an order
83101

84102
```bash
85-
bun src/cli.ts order \
103+
clifood order \
86104
--restaurant "Restaurante X" \
87105
--item "Temaki de salmão:2" \
88106
--item "Guioza" \

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{
22
"name": "clifood",
33
"version": "0.1.0",
4-
"private": true,
4+
"private": false,
55
"type": "module",
66
"bin": {
7-
"clifood": "src/cli.ts"
7+
"clifood": "dist/cli.js"
88
},
99
"scripts": {
1010
"cli": "bun src/cli.ts",
11-
"build": "bun build src/cli.ts --outdir dist --target bun",
11+
"build": "bun build src/cli.ts --outdir dist --target node",
12+
"prepare": "bun run build",
1213
"typecheck": "bunx tsc --noEmit",
1314
"test": "bun test"
1415
},
16+
"files": [
17+
"dist",
18+
"README.md",
19+
"LICENSE",
20+
"CHANGELOG.md"
21+
],
1522
"dependencies": {
1623
"commander": "^12.1.0",
1724
"playwright": "^1.49.0",

0 commit comments

Comments
 (0)