seedfast 1.23.14

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +184 -0
  3. package/index.js +18 -0
  4. package/package.json +21 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Seedfast
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,184 @@
1
+ # Seedfast CLI
2
+
3
+ [![npm version](https://badge.fury.io/js/seedfast.svg)](https://www.npmjs.com/package/seedfast)
4
+ [![npm downloads](https://img.shields.io/npm/dm/seedfast.svg)](https://www.npmjs.com/package/seedfast)
5
+
6
+ > AI-powered PostgreSQL database seeding tool
7
+
8
+ Seedfast CLI generates realistic test data for PostgreSQL databases. It connects to a backend service that uses AI to understand your database schema and create meaningful, contextually appropriate seed data.
9
+
10
+ ## Features
11
+
12
+ - **AI-Powered Planning**: Automatically analyzes your database schema and generates an intelligent seeding plan
13
+ - **Realistic Data**: Creates contextually appropriate test data based on table relationships and constraints
14
+ - **Interactive UI**: Rich terminal interface with real-time progress tracking
15
+ - **Concurrent Execution**: Multi-worker architecture for fast data generation
16
+ - **Secure Authentication**: OAuth-style device flow with OS-level credential storage
17
+ - **Schema-Aware**: Respects foreign keys, constraints, and relationships between tables
18
+
19
+ ## Installation
20
+
21
+ ### npm (Node.js/JavaScript projects)
22
+
23
+ ```bash
24
+ # Global installation
25
+ npm install -g seedfast
26
+
27
+ # Or use with npx (no installation required)
28
+ npx seedfast seed
29
+ ```
30
+
31
+ ### Homebrew (macOS and Linux)
32
+
33
+ ```bash
34
+ brew install argon-it/tap/seedfast
35
+ ```
36
+
37
+ ### Download Binary
38
+
39
+ Download the latest release for your platform from the [releases page](https://github.com/argon-it/seedfast-cli/releases/latest).
40
+
41
+ ### From Source
42
+
43
+ Requires Go 1.25+:
44
+
45
+ ```bash
46
+ git clone <repository-url>
47
+ cd cli
48
+ go build -o seedfast
49
+ ```
50
+
51
+ ## Quick Start
52
+
53
+ ### 1. Authenticate
54
+
55
+ ```bash
56
+ seedfast login
57
+ ```
58
+
59
+ Opens your browser for authentication. The CLI waits until you complete the login.
60
+
61
+ ### 2. Connect to Database
62
+
63
+ ```bash
64
+ seedfast connect
65
+ ```
66
+
67
+ Enter your PostgreSQL connection string:
68
+ ```
69
+ postgres://user:password@localhost:5432/dbname?sslmode=disable
70
+ ```
71
+
72
+ ### 3. Seed Your Database
73
+
74
+ ```bash
75
+ seedfast seed
76
+ ```
77
+
78
+ The CLI will:
79
+ 1. Analyze your database schema
80
+ 2. Present a seeding plan for your approval
81
+ 3. Generate and insert realistic test data
82
+ 4. Show real-time progress for each table
83
+
84
+ ## Commands
85
+
86
+ ```bash
87
+ seedfast login # Authenticate with the backend service
88
+ seedfast connect # Configure database connection
89
+ seedfast seed # Start the seeding process
90
+ seedfast me # Check authentication status (formerly whoami)
91
+ seedfast logout # Clear stored credentials
92
+ seedfast --version # Show version information
93
+ ```
94
+
95
+ ## Configuration
96
+
97
+ ### Environment Variables
98
+
99
+ - `SEEDFAST_DSN` - PostgreSQL connection string (overrides stored value)
100
+ - `DATABASE_URL` - Alternative PostgreSQL connection string (fallback)
101
+ - `SEEDFAST_VERBOSE` - Enable verbose logging (`1` to enable)
102
+
103
+ ### Database Connection
104
+
105
+ You can configure the database connection in three ways (in order of priority):
106
+
107
+ 1. Environment variable `SEEDFAST_DSN`
108
+ 2. Environment variable `DATABASE_URL`
109
+ 3. Stored value from `seedfast connect` command (saved in OS keychain)
110
+
111
+ ## How It Works
112
+
113
+ 1. **Authentication**: OAuth-style device flow securely authenticates with the backend
114
+ 2. **Schema Analysis**: Backend analyzes your PostgreSQL schema (tables, relationships, constraints)
115
+ 3. **AI Planning**: AI planner determines optimal seeding strategy and generates realistic data
116
+ 4. **Execution**: CLI receives SQL tasks via gRPC and executes them locally
117
+ 5. **Progress Tracking**: Real-time UI shows progress for each table being seeded
118
+
119
+ ## Troubleshooting
120
+
121
+ ### Authentication Issues
122
+
123
+ ```bash
124
+ # Check current auth status
125
+ seedfast me
126
+
127
+ # Re-authenticate
128
+ seedfast logout
129
+ seedfast login
130
+ ```
131
+
132
+ ### Database Connection Issues
133
+
134
+ ```bash
135
+ # Reconfigure connection
136
+ seedfast connect
137
+
138
+ # Or set via environment variable
139
+ export SEEDFAST_DSN="postgres://user:password@localhost:5432/dbname?sslmode=disable"
140
+ ```
141
+
142
+ ### Verbose Logging
143
+
144
+ ```bash
145
+ export SEEDFAST_VERBOSE=1
146
+ seedfast seed
147
+ ```
148
+
149
+ ## Development
150
+
151
+ For local development and testing with custom backends, see [DEVELOPMENT.md](DEVELOPMENT.md).
152
+
153
+ **Quick summary:**
154
+ - Production builds: Connect to production backend only
155
+ - Dev builds (`go build -tags dev`): Support `--backend-url` and `--grpc-url` flags for local testing
156
+
157
+ ## Requirements
158
+
159
+ - PostgreSQL database with `app` schema
160
+ - Active internet connection for backend communication
161
+ - OS keychain support (macOS Keychain or Windows Credential Manager)
162
+
163
+ ## Platform Support
164
+
165
+ - macOS (x64, ARM64)
166
+ - Linux (x64, ARM64)
167
+ - Windows (x64, ARM64)
168
+
169
+ Note: Linux systems don't support keychain storage. Use environment variables for credentials.
170
+
171
+ ## Contributing
172
+
173
+ This is a private repository. For contributions, please contact the maintainers.
174
+
175
+ ## License
176
+
177
+ See [LICENSE](LICENSE) file for details.
178
+
179
+ ## Built With
180
+
181
+ - [Cobra](https://github.com/spf13/cobra) - CLI framework
182
+ - [pterm](https://github.com/pterm/pterm) - Terminal UI
183
+ - [pgx](https://github.com/jackc/pgx) - PostgreSQL driver
184
+ - [gRPC](https://grpc.io/) - RPC framework
package/index.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ const { execFileSync } = require('child_process');
3
+ const path = require('path');
4
+ const os = require('os');
5
+
6
+ const platform = os.platform();
7
+ const arch = os.arch();
8
+
9
+ let pkg;
10
+ if (platform === 'darwin' && arch === 'x64') pkg = 'seedfast_darwin_amd64';
11
+ else if (platform === 'darwin' && arch === 'arm64') pkg = 'seedfast_darwin_arm64';
12
+ else if (platform === 'linux' && arch === 'x64') pkg = 'seedfast_linux_amd64';
13
+ else if (platform === 'linux' && arch === 'arm64') pkg = 'seedfast_linux_arm64';
14
+ else if (platform === 'win32' && arch === 'x64') pkg = 'seedfast_windows_amd64';
15
+ else { console.error(`Unsupported platform: ${platform}-${arch}`); process.exit(1); }
16
+
17
+ const bin = path.join(__dirname, 'node_modules', pkg, platform === 'win32' ? 'seedfast.exe' : 'seedfast');
18
+ execFileSync(bin, process.argv.slice(2), { stdio: 'inherit' });
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "seedfast",
3
+ "version": "1.23.14",
4
+ "description": "AI-powered PostgreSQL database seeding tool",
5
+ "keywords": ["postgresql", "database", "seeding", "testing", "ai"],
6
+ "bin": {
7
+ "seedfast": "./index.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/argon-it/seedfast-cli"
12
+ },
13
+ "license": "MIT",
14
+ "optionalDependencies": {
15
+ "seedfast_darwin_amd64": "1.23.14",
16
+ "seedfast_darwin_arm64": "1.23.14",
17
+ "seedfast_linux_amd64": "1.23.14",
18
+ "seedfast_linux_arm64": "1.23.14",
19
+ "seedfast_windows_amd64": "1.23.14"
20
+ }
21
+ }