Skip to content

Commit 569834e

Browse files
committed
Polish README documentation
1 parent 069bdd8 commit 569834e

1 file changed

Lines changed: 38 additions & 33 deletions

File tree

README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ The CLI uses aliases to connect to different backends. Config is stored in `~/.o
2121

2222
```bash
2323
# Add API alias
24-
ow alias set cloud --api https://dash.openworkers.com/api/v1 --token <token>
25-
ow alias set local --api http://localhost:3000 --token dev
24+
ow alias set prod --api https://dash.openworkers.com/api/v1 --token <token>
25+
ow alias set dev --api http://localhost:7000 --token <token>
2626

27-
# Add DB alias
27+
# Add DB alias (for infrastructure operations)
2828
ow alias set infra --db postgres://user:pass@host/db
2929

3030
# List aliases
3131
ow alias list
3232

3333
# Set default
34-
ow alias set-default cloud
34+
ow alias set-default prod
3535

3636
# Remove alias
3737
ow alias rm old-alias
@@ -43,39 +43,23 @@ On first run, a `cloud` alias pointing to `https://dash.openworkers.com/api/v1`
4343

4444
## Commands
4545

46-
### Database Operations
47-
48-
Requires a `db` type alias.
49-
50-
```bash
51-
# Run pending migrations
52-
ow infra db migrate
53-
54-
# Check migration status
55-
ow infra db status
56-
57-
# Baseline existing database (mark all migrations as applied without running them)
58-
ow infra db baseline
59-
```
60-
6146
### Workers
6247

63-
Works with both `api` and `db` aliases.
64-
6548
```bash
6649
# List workers
6750
ow workers list
6851
ow workers ls
6952

7053
# Create a worker
7154
ow workers create my-api -d "My API worker"
55+
ow workers create my-api --language javascript
7256

7357
# Get worker details
7458
ow workers get my-api
7559

7660
# Deploy code to a worker
77-
ow workers deploy my-api ./src/index.ts -m "Initial deploy"
78-
ow workers deploy my-api ./src/index.ts -m "Fix bug" # v2, v3, ...
61+
ow workers deploy my-api ./src/index.ts
62+
ow workers deploy my-api ./src/index.ts -m "Fix bug"
7963

8064
# Delete a worker
8165
ow workers delete my-api
@@ -84,28 +68,52 @@ ow workers rm my-api
8468

8569
Supported file types: `.js`, `.ts`, `.wasm`
8670

71+
### Database Operations
72+
73+
Requires a `db` type alias.
74+
75+
```bash
76+
# Run pending migrations
77+
ow infra db migrate
78+
79+
# Check migration status
80+
ow infra db status
81+
82+
# Baseline existing database (mark all migrations as applied)
83+
ow infra db baseline
84+
```
85+
8786
### Using Aliases
8887

8988
```bash
9089
# Use default alias
9190
ow workers list
9291

93-
# Use specific alias (mc-style, alias as first argument)
92+
# Use specific alias as first argument
9493
ow prod workers list
94+
ow dev workers get my-api
9595
ow infra db migrate
96+
97+
# Or use --alias flag
98+
ow --alias prod workers list
9699
```
97100

98-
## Config File Format
101+
## Config File
99102

100103
```json
101104
{
102105
"version": 1,
103-
"default": "cloud",
106+
"default": "prod",
104107
"aliases": {
105-
"cloud": {
108+
"prod": {
106109
"type": "api",
107110
"url": "https://dash.openworkers.com/api/v1",
108-
"token": "owk_xxx"
111+
"token": "ow_xxx"
112+
},
113+
"dev": {
114+
"type": "api",
115+
"url": "http://localhost:7000",
116+
"token": "ow_xxx"
109117
},
110118
"infra": {
111119
"type": "db",
@@ -118,10 +126,7 @@ ow infra db migrate
118126
## Development
119127

120128
```bash
121-
# Build
122129
cargo build
123-
124-
# Run
125-
cargo run -- alias list
126-
cargo run -- --alias infra db status
130+
cargo run -- workers list
131+
cargo run -- dev workers list
127132
```

0 commit comments

Comments
 (0)