dataset-cli 1.0.3 → 1.0.4

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 +269 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # Dataset CLI
2
+
3
+ A powerful CLI tool for processing and querying datasets with support for SQLite, PostgreSQL, and TursoDB (cloud SQLite).
4
+
5
+ ![License](https://img.shields.io/badge/license-MIT-blue.svg)
6
+ ![Go](https://img.shields.io/badge/Go-1.26+-00ADD8.svg)
7
+ ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-green.svg)
8
+
9
+ ## Features
10
+
11
+ - **Multiple Databases** - Works with SQLite (default), PostgreSQL, and TursoDB cloud
12
+ - **Smart Data Import** - Import CSV/JSON files with automatic type detection
13
+ - **Beautiful CLI** - Color-coded output, progress bars, interactive prompts
14
+ - **No SQL Required** - Interactive query builder for non-technical users
15
+ - **Streaming Import** - Handle large files efficiently with low memory usage
16
+ - **Data Validation** - Pre-flight checks before import
17
+ - **Multiple Output Formats** - Table, JSON, CSV, Markdown, Pretty print
18
+
19
+ ## Installation
20
+
21
+ ### npm (Recommended)
22
+
23
+ ```bash
24
+ npm install -g dataset-cli
25
+ ```
26
+
27
+ Works on Windows, macOS, and Linux. Binary is downloaded automatically on first run.
28
+
29
+ ### Download Binary
30
+
31
+ Download the latest release for your platform from [GitHub Releases](https://github.com/darshan192004/cli-project/releases).
32
+
33
+ ### Docker
34
+
35
+ ```bash
36
+ docker pull darshan192004/dataset-cli
37
+ docker run --rm darshan192004/dataset-cli --help
38
+ ```
39
+
40
+ ### Build from Source
41
+
42
+ ```bash
43
+ git clone https://github.com/darshan192004/cli-project.git
44
+ cd cli-project
45
+ go build -o dataset-cli .
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```bash
51
+ # Start interactive mode
52
+ dataset-cli
53
+
54
+ # Import a CSV file
55
+ dataset-cli migrate data.csv
56
+
57
+ # Filter data with SQL-like syntax
58
+ dataset-cli filter users --where "age > 25"
59
+
60
+ # Export to JSON
61
+ dataset-cli export users --output data.json
62
+
63
+ # Check system health
64
+ dataset-cli doctor
65
+ ```
66
+
67
+ ## Commands
68
+
69
+ ### `migrate` - Import Data
70
+
71
+ ```bash
72
+ # Basic import (creates table from filename)
73
+ dataset-cli migrate data.csv
74
+
75
+ # Specify table name
76
+ dataset-cli migrate data.csv --table-name users
77
+
78
+ # With options
79
+ dataset-cli migrate data.csv \
80
+ --table-name users \
81
+ --drop \ # Drop existing table first
82
+ --skip-errors \ # Continue on errors
83
+ --progress # Show progress bar
84
+
85
+ # Use PostgreSQL
86
+ dataset-cli migrate data.csv --postgres
87
+
88
+ # Use TursoDB Cloud
89
+ dataset-cli migrate data.csv --cloud
90
+ ```
91
+
92
+ ### `filter` - Query Data
93
+
94
+ ```bash
95
+ # Interactive mode
96
+ dataset-cli filter
97
+
98
+ # SQL-like query
99
+ dataset-cli filter users --where "age > 25 AND city = 'NYC'" --limit 10
100
+
101
+ # Simple query
102
+ dataset-cli filter users
103
+ ```
104
+
105
+ ### `transform` - Select Columns
106
+
107
+ ```bash
108
+ # Select specific columns
109
+ dataset-cli transform users --columns name,email,age
110
+
111
+ # With filter
112
+ dataset-cli transform users \
113
+ --columns name,email \
114
+ --where "city = 'New York'"
115
+ ```
116
+
117
+ ### `export` - Export Data
118
+
119
+ ```bash
120
+ # JSON (default)
121
+ dataset-cli export users --output data.json
122
+
123
+ # CSV
124
+ dataset-cli export users --output data.csv --format csv
125
+
126
+ # Markdown (great for docs)
127
+ dataset-cli export users --output data.md --format md
128
+
129
+ # Pretty print to terminal
130
+ dataset-cli export users --format pretty
131
+ ```
132
+
133
+ ### `schema` - View Table Schema
134
+
135
+ ```bash
136
+ dataset-cli schema users
137
+ ```
138
+
139
+ ### `stats` - Table Statistics
140
+
141
+ ```bash
142
+ # Basic stats
143
+ dataset-cli stats users
144
+
145
+ # Include NULL counts
146
+ dataset-cli stats users --show-nulls
147
+ ```
148
+
149
+ ### `aggregate` - Aggregate Functions
150
+
151
+ ```bash
152
+ # Count records
153
+ dataset-cli aggregate users --operation count
154
+
155
+ # Sum a column
156
+ dataset-cli aggregate orders --operation sum --column amount
157
+
158
+ # Average, min, max
159
+ dataset-cli aggregate users --operation avg --column age
160
+ ```
161
+
162
+ ### `backup` & `restore` - Data Backup
163
+
164
+ ```bash
165
+ # Backup a table
166
+ dataset-cli backup users --output backup.json
167
+
168
+ # Restore from backup
169
+ dataset-cli restore users --input backup.json
170
+ ```
171
+
172
+ ### `doctor` - System Diagnostics
173
+
174
+ ```bash
175
+ dataset-cli doctor
176
+ ```
177
+
178
+ ## Global Flags
179
+
180
+ ```bash
181
+ dataset-cli [command] [flags]
182
+
183
+ Flags:
184
+ -v, --verbose Enable verbose output
185
+ --dry-run Show what would be done without executing
186
+ --no-color Disable color output
187
+ --config string Config file path (default ~/.dataset-cli.yaml)
188
+ --postgres Use PostgreSQL instead of SQLite
189
+ --cloud Use TursoDB cloud (requires LIBSQL_URL env var)
190
+ --host string Database host (overrides config)
191
+ --port int Database port (overrides config)
192
+ --user string Database user (overrides config)
193
+ --password string Database password (overrides config)
194
+ --dbname string Database name (overrides config)
195
+ ```
196
+
197
+ ## Configuration
198
+
199
+ Create `~/.dataset-cli.yaml`:
200
+
201
+ ```yaml
202
+ database:
203
+ host: localhost
204
+ port: 5432
205
+ user: postgres
206
+ password: postgres
207
+ dbname: dataset
208
+ sslmode: disable
209
+ ```
210
+
211
+ Or use environment variables:
212
+
213
+ ```bash
214
+ export DB_HOST=localhost
215
+ export DB_PORT=5432
216
+ export DB_USER=postgres
217
+ export DB_PASSWORD=secret
218
+ export DB_NAME=dataset
219
+ export LIBSQL_URL=libsql://your-db.turso.io?authToken=your-token
220
+ ```
221
+
222
+ ## Database Support
223
+
224
+ | Database | CGO Required | Notes |
225
+ |-----------|--------------|--------------------------------|
226
+ | SQLite | No | Default, stores at ~/.dataset-cli/ |
227
+ | PostgreSQL| No | Use `--postgres` flag |
228
+ | TursoDB | No | Cloud SQLite, use `--cloud` flag |
229
+
230
+ ## Shell Completion
231
+
232
+ ```bash
233
+ # Bash
234
+ dataset-cli completion bash >> ~/.bashrc
235
+
236
+ # Zsh
237
+ dataset-cli completion zsh >> ~/.zshrc
238
+
239
+ # Fish
240
+ dataset-cli completion fish > ~/.config/fish/completions/dataset-cli.fish
241
+ ```
242
+
243
+ ## Development
244
+
245
+ ```bash
246
+ # Build
247
+ make build
248
+
249
+ # Run tests
250
+ go test ./...
251
+
252
+ # Run with PostgreSQL
253
+ make start # Start PostgreSQL
254
+ make run # Run CLI
255
+ ```
256
+
257
+ ## License
258
+
259
+ MIT License - see [LICENSE](LICENSE) for details.
260
+
261
+ ## Links
262
+
263
+ - [GitHub Repository](https://github.com/darshan192004/cli-project)
264
+ - [Issue Tracker](https://github.com/darshan192004/cli-project/issues)
265
+ - [npm Package](https://www.npmjs.com/package/dataset-cli)
266
+
267
+ ---
268
+
269
+ Made with ❤️ using Go
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataset-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Dataset processing CLI tool",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "files": [
16
16
  "bin/",
17
- "scripts/"
17
+ "scripts/",
18
+ "README.md"
18
19
  ]
19
20
  }