@runtypelabs/cli 0.1.0
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.
- package/README.md +182 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Runtype CLI
|
|
2
|
+
|
|
3
|
+
Command-line interface for the Runtype AI platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @runtypelabs/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### 1. Create Account & Authenticate
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create a new account
|
|
17
|
+
runtype auth signup
|
|
18
|
+
|
|
19
|
+
# Or login to existing account
|
|
20
|
+
runtype auth login
|
|
21
|
+
|
|
22
|
+
# Check authentication status
|
|
23
|
+
runtype auth whoami
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Start Interactive Chat
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Start a chat session
|
|
30
|
+
runtype talk
|
|
31
|
+
|
|
32
|
+
# With custom model
|
|
33
|
+
runtype talk --model claude-3-opus --temperature 0.2
|
|
34
|
+
|
|
35
|
+
# With system prompt
|
|
36
|
+
runtype talk --system "You are an expert in Next.js development"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Manage Flows and Records
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# List flows
|
|
43
|
+
runtype flows list
|
|
44
|
+
|
|
45
|
+
# Run a flow
|
|
46
|
+
runtype flows run <flow-id> --record <record-id>
|
|
47
|
+
|
|
48
|
+
# Create a record
|
|
49
|
+
runtype records create --name "My Record" --type "document"
|
|
50
|
+
|
|
51
|
+
# List records
|
|
52
|
+
runtype records list --type document
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Chat Commands
|
|
56
|
+
|
|
57
|
+
During a chat session, you can use these special commands:
|
|
58
|
+
|
|
59
|
+
- `/help` - Show available commands
|
|
60
|
+
- `/clear` - Clear conversation history
|
|
61
|
+
- `/save [filename]` - Save session to file
|
|
62
|
+
- `/load <filename>` - Load session from file
|
|
63
|
+
- `/export` - Export conversation as markdown
|
|
64
|
+
- `/model <model>` - Change AI model
|
|
65
|
+
- `/temp <value>` - Set temperature (0-1)
|
|
66
|
+
- `/info` - Show session information
|
|
67
|
+
- `/exit` - Exit chat session
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# View all configuration
|
|
73
|
+
runtype config get
|
|
74
|
+
|
|
75
|
+
# Set API URL
|
|
76
|
+
runtype config set apiUrl https://api.runtype.com
|
|
77
|
+
|
|
78
|
+
# Set default model
|
|
79
|
+
runtype config set defaultModel gpt-4o
|
|
80
|
+
|
|
81
|
+
# Reset configuration
|
|
82
|
+
runtype config reset
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Development
|
|
86
|
+
|
|
87
|
+
### Local Development Setup
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# From repository root, navigate to CLI package
|
|
91
|
+
cd packages/cli
|
|
92
|
+
|
|
93
|
+
# Install dependencies
|
|
94
|
+
pnpm install
|
|
95
|
+
|
|
96
|
+
# Copy environment template and configure for local development
|
|
97
|
+
cp .env.example .env
|
|
98
|
+
# Edit .env with your local settings (API URL, Clerk key, etc.)
|
|
99
|
+
|
|
100
|
+
# Build the CLI
|
|
101
|
+
pnpm build
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Running the CLI Locally
|
|
105
|
+
|
|
106
|
+
**Option 1: Development mode with hot reload**
|
|
107
|
+
```bash
|
|
108
|
+
# Run with tsx watch (for development)
|
|
109
|
+
pnpm dev
|
|
110
|
+
|
|
111
|
+
# Run specific commands in dev mode
|
|
112
|
+
pnpm dev -- --help
|
|
113
|
+
pnpm dev -- auth login
|
|
114
|
+
pnpm dev -- config get
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Option 2: Build and run directly**
|
|
118
|
+
```bash
|
|
119
|
+
# Build first
|
|
120
|
+
pnpm build
|
|
121
|
+
|
|
122
|
+
# Run built CLI with Node.js
|
|
123
|
+
node dist/index.js --help
|
|
124
|
+
node dist/index.js auth login
|
|
125
|
+
node dist/index.js talk
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Option 3: Install globally for testing**
|
|
129
|
+
```bash
|
|
130
|
+
# Build and install globally
|
|
131
|
+
pnpm build
|
|
132
|
+
npm install -g .
|
|
133
|
+
|
|
134
|
+
# Now use the runtype command anywhere
|
|
135
|
+
runtype --help
|
|
136
|
+
runtype auth login
|
|
137
|
+
runtype talk
|
|
138
|
+
|
|
139
|
+
# After making changes, rebuild and reinstall
|
|
140
|
+
pnpm build && npm install -g .
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Local Environment Configuration
|
|
144
|
+
|
|
145
|
+
Create a `.env` file for local development:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Point to local API and dashboard
|
|
149
|
+
RUNTYPE_API_URL=http://localhost:8787
|
|
150
|
+
RUNTYPE_DASHBOARD_URL=http://localhost:3001
|
|
151
|
+
|
|
152
|
+
# Add your Clerk publishable key (get from Clerk dashboard)
|
|
153
|
+
CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
|
|
154
|
+
|
|
155
|
+
# Optional: Set defaults
|
|
156
|
+
RUNTYPE_DEFAULT_MODEL=meta/llama3.1-8b-instruct-free
|
|
157
|
+
RUNTYPE_DEFAULT_TEMPERATURE=0.7
|
|
158
|
+
DEBUG=true
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Testing
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Run tests
|
|
165
|
+
pnpm test
|
|
166
|
+
|
|
167
|
+
# Watch mode
|
|
168
|
+
pnpm test:watch
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Environment Variables
|
|
172
|
+
|
|
173
|
+
- `RUNTYPE_API_URL` - API endpoint URL (default: https://api.runtype.com)
|
|
174
|
+
- `RUNTYPE_DASHBOARD_URL` - Dashboard URL (default: https://dashboard.runtype.com)
|
|
175
|
+
- `CLERK_PUBLISHABLE_KEY` - Clerk public key for OAuth
|
|
176
|
+
- `RUNTYPE_DEFAULT_MODEL` - Default AI model (default: gpt-4o)
|
|
177
|
+
- `RUNTYPE_DEFAULT_TEMPERATURE` - Default temperature (default: 0.7)
|
|
178
|
+
- `DEBUG` - Enable debug mode
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@runtypelabs/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Command-line interface for Runtype AI platform",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"runtype": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@clerk/backend": "^2.28.0",
|
|
11
|
+
"chalk": "^5.3.0",
|
|
12
|
+
"commander": "^12.0.0",
|
|
13
|
+
"conf": "^13.0.0",
|
|
14
|
+
"dotenv": "^16.4.5",
|
|
15
|
+
"express": "^4.19.2",
|
|
16
|
+
"inquirer": "^9.2.15",
|
|
17
|
+
"keytar": "^7.9.0",
|
|
18
|
+
"marked": "^12.0.0",
|
|
19
|
+
"marked-terminal": "^7.0.0",
|
|
20
|
+
"open": "^10.1.0",
|
|
21
|
+
"ora": "^8.0.1",
|
|
22
|
+
"uuid": "^9.0.1",
|
|
23
|
+
"@runtypelabs/sdk": "0.1.1",
|
|
24
|
+
"@travrse/shared": "1.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/express": "^4.17.21",
|
|
28
|
+
"@types/inquirer": "^9.0.7",
|
|
29
|
+
"@types/node": "^20.11.24",
|
|
30
|
+
"@types/supertest": "^6.0.3",
|
|
31
|
+
"@types/uuid": "^9.0.8",
|
|
32
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
33
|
+
"supertest": "^7.1.4",
|
|
34
|
+
"tsup": "^8.0.2",
|
|
35
|
+
"tsx": "^4.7.1",
|
|
36
|
+
"typescript": "^5.3.3",
|
|
37
|
+
"vitest": "^1.3.1"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"README.md"
|
|
48
|
+
],
|
|
49
|
+
"keywords": [
|
|
50
|
+
"runtype",
|
|
51
|
+
"cli",
|
|
52
|
+
"ai",
|
|
53
|
+
"automation",
|
|
54
|
+
"workflow"
|
|
55
|
+
],
|
|
56
|
+
"author": "Runtype Labs",
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "https://github.com/runtypelabs/core",
|
|
61
|
+
"directory": "packages/cli"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://runtype.com",
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "https://github.com/runtypelabs/core/issues"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"dev": "tsx watch src/index.ts",
|
|
69
|
+
"build": "tsup",
|
|
70
|
+
"start": "node dist/index.js",
|
|
71
|
+
"type-check": "tsc --noEmit",
|
|
72
|
+
"test": "vitest",
|
|
73
|
+
"test:watch": "vitest watch",
|
|
74
|
+
"test:coverage": "vitest run --coverage",
|
|
75
|
+
"test:ui": "vitest --ui"
|
|
76
|
+
}
|
|
77
|
+
}
|