Skip to content

Commit 713705f

Browse files
bug and ux fixes
1 parent 8bbbd8a commit 713705f

7 files changed

Lines changed: 57 additions & 56 deletions

File tree

.claude/settings.local.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"Bash(timeout 2 bin/r2sql-shell-macos:*)",
2626
"Bash(timeout 2 ./bin/r2sql-shell-macos:*)",
2727
"Bash(npm run build:macos:*)",
28-
"Bash(npm run:*)"
28+
"Bash(npm run:*)",
29+
"Bash(git rm:*)",
30+
"Bash(git check-ignore:*)"
2931
],
3032
"deny": [],
3133
"ask": []

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ test*
3535
PUBLISH_CHECKLIST.md
3636
HOMEBREW*
3737
get-sha256.sh
38+
CLAUDE.md

CLAUDE.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

Formula/r2sql-shell.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class R2sqlShell < Formula
2+
desc "Interactive shell for querying R2 Data Catalog with R2 SQL"
3+
homepage "https://github.com/marcinthecloud/r2sql-shell"
4+
url "https://github.com/marcinthecloud/r2sql-shell/releases/download/v1.0.0/r2sql-shell-macos"
5+
sha256 "Y326c722240c05460f0651e1e2746ac62bf8d1dbdd726eb790c10ee3b47884364" # Run: shasum -a 256 bin/r2sql-shell-macos
6+
version "1.0.0"
7+
license "MIT"
8+
9+
def install
10+
# Install the binary as "r2sql-shell" command
11+
bin.install "r2sql-shell-macos" => "r2sql-shell"
12+
end
13+
14+
test do
15+
# Test that the binary runs and returns correct version
16+
assert_match "1.0.0", shell_output("#{bin}/r2sql-shell --version")
17+
18+
# Test that help works
19+
assert_match "Interactive shell", shell_output("#{bin}/r2sql-shell --help")
20+
end
21+
end

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ R2_BUCKET_NAME=your_bucket_name_here
5353
CLOUDFLARE_API_TOKEN=your_api_token_here
5454
```
5555

56-
OR simply start `r2sql` for the first time to set it up
56+
OR simply start `r2sql-shell` for the first time to set it up
5757

5858
### Getting Your Credentials
5959

@@ -67,13 +67,16 @@ OR simply start `r2sql` for the first time to set it up
6767

6868
### Via Homebrew
6969

70+
**Option 1 (Recommended - One command):**
7071
```bash
71-
brew tap YOUR_USERNAME/r2sql
72-
brew install r2sql
73-
r2sql
72+
brew install marcinthecloud/r2sql-shell/r2sql-shell
7473
```
7574

76-
Replace `YOUR_USERNAME` with the GitHub username where the repository is published.
75+
**Option 2 (Tap first):**
76+
```bash
77+
brew tap marcinthecloud/r2sql-shell
78+
brew install r2sql-shell
79+
```
7780

7881
For publishing instructions, see [HOMEBREW_SETUP.md](HOMEBREW_SETUP.md).
7982

@@ -100,11 +103,11 @@ For publishing instructions, see [HOMEBREW_SETUP.md](HOMEBREW_SETUP.md).
100103
npm link
101104
```
102105

103-
Now you can run `r2sql` from anywhere!
106+
Now you can run `r2sql-shell` from anywhere!
104107

105108
### Download Pre-built Binary (Coming Soon)
106109

107-
Download the latest release for your platform from the [releases page](https://github.com/YOUR_USERNAME/r2sql-shell/releases):
110+
Download the latest release for your platform from the [releases page](https://github.com/marcinthecloud/r2sql-shell/releases):
108111
- macOS (Intel/Apple Silicon)
109112
- Linux (x64)
110113
- Windows (x64)
@@ -116,15 +119,15 @@ Download the latest release for your platform from the [releases page](https://g
116119
Just run the command and you'll be prompted for your credentials:
117120

118121
```bash
119-
r2sql
122+
r2sql-shell
120123
# or if running from source:
121124
npm start
122125
```
123126

124127
### Option 2: Using Command-Line Arguments
125128

126129
```bash
127-
r2sql --account-id YOUR_ACCOUNT_ID --bucket YOUR_BUCKET --token YOUR_API_TOKEN
130+
r2sql-shell --account-id YOUR_ACCOUNT_ID --bucket YOUR_BUCKET --token YOUR_API_TOKEN
128131
```
129132

130133
### Option 3: Using Environment Variables
@@ -146,15 +149,15 @@ CLOUDFLARE_API_TOKEN=your_api_token_here
146149
Then run:
147150

148151
```bash
149-
r2sql
152+
r2sql-shell
150153
```
151154

152155
## Usage
153156

154157
### Command-Line Options
155158

156159
```bash
157-
r2sql [options]
160+
r2sql-shell [options]
158161

159162
Options:
160163
--account-id <id> Cloudflare Account ID
@@ -173,22 +176,22 @@ Options:
173176

174177
```bash
175178
# Start with interactive prompt for credentials
176-
r2sql
179+
r2sql-shell
177180

178181
# Start in TUI mode with credentials
179-
r2sql --account-id YOUR_ID --bucket YOUR_BUCKET --token YOUR_TOKEN
182+
r2sql-shell --account-id YOUR_ID --bucket YOUR_BUCKET --token YOUR_TOKEN
180183

181184
# Execute a query on startup
182-
r2sql -e "SELECT * FROM my_namespace.my_table LIMIT 10"
185+
r2sql-shell -e "SELECT * FROM my_namespace.my_table LIMIT 10"
183186

184187
# Enable query history logging
185-
r2sql --history
188+
r2sql-shell --history
186189

187190
# Start in simple REPL mode
188-
r2sql --simple
191+
r2sql-shell --simple
189192

190193
# Combine options
191-
r2sql --account-id YOUR_ID --bucket YOUR_BUCKET --token YOUR_TOKEN \
194+
r2sql-shell --account-id YOUR_ID --bucket YOUR_BUCKET --token YOUR_TOKEN \
192195
-e "SELECT * FROM default.logs LIMIT 5" --history
193196
```
194197

@@ -337,7 +340,7 @@ npm start
337340

338341
### Creating Executables
339342

340-
To package r2sql as a standalone executable:
343+
To package r2sql-shell as a standalone executable:
341344

342345
```bash
343346
# Package for your current platform

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "r2sql",
2+
"name": "r2sql-shell",
33
"version": "1.0.0",
44
"description": "Interactive REPL for querying R2 Data Catalog with R2 SQL",
55
"main": "dist/index.js",
66
"type": "module",
77
"bin": {
8-
"r2sql": "./dist/index.js"
8+
"r2sql-shell": "./dist/index.js"
99
},
1010
"scripts": {
1111
"build": "tsc",
@@ -17,7 +17,7 @@
1717
"package:macos": "npm run bundle && pkg dist/bundle.cjs --targets node18-macos-x64 --output ./bin/r2sql-shell-macos",
1818
"package:linux": "npm run bundle && pkg dist/bundle.cjs --targets node18-linux-x64 --output ./bin/r2sql-shell-linux",
1919
"package:windows": "npm run bundle && pkg dist/bundle.cjs --targets node18-win-x64 --output ./bin/r2sql-shell-win.exe",
20-
"package:all": "npm run bundle && pkg dist/bundle.cjs --targets node18-macos-x64,node18-linux-x64,node18-win-x64 --out-path ./bin"
20+
"package:all": "npm run package:macos && npm run package:linux && npm run package:windows"
2121
},
2222
"keywords": [
2323
"r2",

src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import chalk from 'chalk';
99
const program = new Command();
1010

1111
program
12-
.name('r2sql')
12+
.name('r2sql-shell')
1313
.description('Interactive shell for querying R2 Data Catalog with R2 SQL')
1414
.version('1.0.0')
1515
.option('--account-id <id>', 'Cloudflare Account ID')
@@ -22,25 +22,25 @@ program
2222
.option('--simple', 'Use simple REPL mode instead of TUI')
2323
.addHelpText('after', `
2424
Examples:
25-
$ r2sql
25+
$ r2sql-shell
2626
Start with interactive prompts for credentials
2727
28-
$ r2sql --account-id abc123 --bucket my-bucket --token xyz789
28+
$ r2sql-shell --account-id abc123 --bucket my-bucket --token xyz789
2929
Start with credentials from command line
3030
31-
$ r2sql -e "SELECT * FROM default.logs LIMIT 10"
31+
$ r2sql-shell -e "SELECT * FROM default.logs LIMIT 10"
3232
Execute a query on startup (uses .env for credentials)
3333
34-
$ r2sql --account-id abc123 --bucket my-bucket --token xyz789 -e "SELECT * FROM default.logs"
34+
$ r2sql-shell --account-id abc123 --bucket my-bucket --token xyz789 -e "SELECT * FROM default.logs"
3535
Combine credentials and query execution
3636
37-
$ r2sql --history
37+
$ r2sql-shell --history
3838
Enable query history logging to r2sql-history.txt
3939
40-
$ r2sql --debug
40+
$ r2sql-shell --debug
4141
Enable debug logging to r2sql-debug.log
4242
43-
$ r2sql --simple
43+
$ r2sql-shell --simple
4444
Use simple REPL mode instead of TUI
4545
4646
Configuration:

0 commit comments

Comments
 (0)