@docyrus/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 +249 -0
- package/dist/cli.js +2925 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.js +793 -0
- package/dist/index.js.map +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Docyrus CLI
|
|
2
|
+
|
|
3
|
+
Official command-line interface for Docyrus - authentication, project scaffolding, and code generation tools.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g docyrus
|
|
9
|
+
# or
|
|
10
|
+
pnpm add -g docyrus
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
### Authentication
|
|
16
|
+
|
|
17
|
+
#### `docyrus login`
|
|
18
|
+
|
|
19
|
+
Log in to Docyrus using browser-based SSO (default).
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
docyrus login # Opens browser for SSO authentication
|
|
23
|
+
docyrus login --email # Use email/password instead (prompts for credentials)
|
|
24
|
+
docyrus login -e user@example.com # Pre-fill email address
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### `docyrus logout`
|
|
28
|
+
|
|
29
|
+
Log out from Docyrus and clear stored credentials.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
docyrus logout
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### `docyrus whoami`
|
|
36
|
+
|
|
37
|
+
Display the currently logged-in user.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
docyrus whoami
|
|
41
|
+
# Output: Email: user@example.com
|
|
42
|
+
# Name: John Doe
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Project Creation
|
|
46
|
+
|
|
47
|
+
#### `docyrus create [name]`
|
|
48
|
+
|
|
49
|
+
Create a new Docyrus project from a template.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
docyrus create # Interactive mode - prompts for all options
|
|
53
|
+
docyrus create my-app # Create project with specified name
|
|
54
|
+
docyrus create my-app --nextjs # Next.js + plain Tailwind
|
|
55
|
+
docyrus create my-app --nextjs --shadcn # Next.js + shadcn/ui
|
|
56
|
+
docyrus create my-app --react --heroui # React + HeroUI
|
|
57
|
+
docyrus create my-app --vue --shadcn # Vue + shadcn-vue
|
|
58
|
+
docyrus create my-app --astro # Astro + plain Tailwind
|
|
59
|
+
docyrus create my-app --nextjs --shadcn --eslint --pnpm # Full flags
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Framework Options:**
|
|
63
|
+
|
|
64
|
+
| Flag | Description |
|
|
65
|
+
|------|-------------|
|
|
66
|
+
| `--nextjs` | Use Next.js 15+ (App Router) |
|
|
67
|
+
| `--react` | Use React 19+ with Vite |
|
|
68
|
+
| `--astro` | Use Astro 5+ |
|
|
69
|
+
| `--vue` | Use Vue 3.5+ with Vite |
|
|
70
|
+
|
|
71
|
+
**UI Library Options (optional - defaults to plain Tailwind if not specified):**
|
|
72
|
+
|
|
73
|
+
| Flag | Description |
|
|
74
|
+
|------|-------------|
|
|
75
|
+
| `--shadcn` | Use shadcn/ui (React/Next.js) or shadcn-vue (Vue) |
|
|
76
|
+
| `--heroui` | Use HeroUI (React/Next.js only) |
|
|
77
|
+
|
|
78
|
+
**Linter Options:**
|
|
79
|
+
|
|
80
|
+
| Flag | Description |
|
|
81
|
+
|------|-------------|
|
|
82
|
+
| `--eslint` | Use ESLint for linting |
|
|
83
|
+
| `--biome` | Use Biome for linting |
|
|
84
|
+
| `--no-linter` | Skip linter configuration |
|
|
85
|
+
|
|
86
|
+
**Package Manager Options:**
|
|
87
|
+
|
|
88
|
+
| Flag | Description |
|
|
89
|
+
|------|-------------|
|
|
90
|
+
| `--pnpm` | Use pnpm (recommended) |
|
|
91
|
+
| `--npm` | Use npm |
|
|
92
|
+
| `--yarn` | Use yarn |
|
|
93
|
+
| `--bun` | Use bun |
|
|
94
|
+
|
|
95
|
+
**Other Options:**
|
|
96
|
+
|
|
97
|
+
| Option | Description |
|
|
98
|
+
|--------|-------------|
|
|
99
|
+
| `-p, --path <path>` | Target directory path |
|
|
100
|
+
| `--alias <prefix>` | Custom import alias prefix (must start with @) |
|
|
101
|
+
|
|
102
|
+
**Available Templates:**
|
|
103
|
+
|
|
104
|
+
| Template | Description |
|
|
105
|
+
|----------|-------------|
|
|
106
|
+
| `nextjs` | Next.js 15+ + Tailwind CSS v4 |
|
|
107
|
+
| `nextjs-shadcn` | Next.js 15+ + Tailwind CSS v4 + shadcn/ui |
|
|
108
|
+
| `nextjs-heroui` | Next.js 15+ + Tailwind CSS v4 + HeroUI |
|
|
109
|
+
| `react` | React 19+ + Vite + Tailwind CSS v4 |
|
|
110
|
+
| `react-shadcn` | React 19+ + Vite + Tailwind CSS v4 + shadcn/ui |
|
|
111
|
+
| `react-heroui` | React 19+ + Vite + Tailwind CSS v4 + HeroUI |
|
|
112
|
+
| `astro` | Astro 5+ + Tailwind CSS v4 |
|
|
113
|
+
| `vue` | Vue 3.5+ + Vite + Tailwind CSS v4 |
|
|
114
|
+
| `vue-shadcn` | Vue 3.5+ + Vite + Tailwind CSS v4 + shadcn-vue |
|
|
115
|
+
|
|
116
|
+
Each template includes:
|
|
117
|
+
- Pre-configured OAuth2 authentication pages
|
|
118
|
+
- Docyrus API client integration
|
|
119
|
+
- Modern TypeScript setup
|
|
120
|
+
- Linter configuration (ESLint or Biome)
|
|
121
|
+
|
|
122
|
+
### Code Generation
|
|
123
|
+
|
|
124
|
+
#### `docyrus generate db [spec]`
|
|
125
|
+
|
|
126
|
+
Generate TanStack Query collections from an OpenAPI 3.1.0 specification.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
docyrus generate db # Auto-detect openapi.json in current directory
|
|
130
|
+
docyrus generate db ./api/openapi.json # Specify spec file path
|
|
131
|
+
docyrus generate db ./spec.json -o ./src/api # Custom output directory
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Options:**
|
|
135
|
+
|
|
136
|
+
| Option | Description |
|
|
137
|
+
|--------|-------------|
|
|
138
|
+
| `-o, --output <dir>` | Output directory (defaults to `src` in spec file folder) |
|
|
139
|
+
| `-w, --watch` | Watch for changes in the spec file (coming soon) |
|
|
140
|
+
|
|
141
|
+
### CLI Management
|
|
142
|
+
|
|
143
|
+
#### `docyrus upgrade`
|
|
144
|
+
|
|
145
|
+
Upgrade the CLI to the latest version. Automatically detects your package manager (npm, pnpm, yarn, bun).
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
docyrus upgrade
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### `docyrus completion <shell>`
|
|
152
|
+
|
|
153
|
+
Generate shell completion script for tab completion support.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Bash - add to ~/.bashrc
|
|
157
|
+
eval "$(docyrus completion bash)"
|
|
158
|
+
|
|
159
|
+
# Zsh - add to ~/.zshrc
|
|
160
|
+
eval "$(docyrus completion zsh)"
|
|
161
|
+
|
|
162
|
+
# Fish - save to completions directory
|
|
163
|
+
docyrus completion fish > ~/.config/fish/completions/docyrus.fish
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### `docyrus info`
|
|
167
|
+
|
|
168
|
+
Display CLI version, system information, and authentication status. Useful for debugging.
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
docyrus info
|
|
172
|
+
# Output:
|
|
173
|
+
# docyrus v0.0.1
|
|
174
|
+
#
|
|
175
|
+
# System:
|
|
176
|
+
# Node.js: v20.10.0
|
|
177
|
+
# OS: darwin 23.0.0 (arm64)
|
|
178
|
+
#
|
|
179
|
+
# Environment:
|
|
180
|
+
# API URL: https://api.docyrus.com
|
|
181
|
+
# Config: /Users/you/.docyrus
|
|
182
|
+
#
|
|
183
|
+
# Authentication:
|
|
184
|
+
# Status: Logged in
|
|
185
|
+
# Email: user@example.com
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Global Options
|
|
189
|
+
|
|
190
|
+
### `--json`
|
|
191
|
+
|
|
192
|
+
Output results in JSON format. Useful for scripting and CI/CD pipelines.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
docyrus whoami --json
|
|
196
|
+
# Output: {"user": {"email": "user@example.com", "firstname": "John", "lastname": "Doe"}}
|
|
197
|
+
|
|
198
|
+
docyrus generate db ./spec.json --json
|
|
199
|
+
# Output: {"spec": "./spec.json", "output": "./src", "success": true, "message": "..."}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### `-v, --version`
|
|
203
|
+
|
|
204
|
+
Display the CLI version.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
docyrus -v
|
|
208
|
+
# Output: 0.0.1
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### `-h, --help`
|
|
212
|
+
|
|
213
|
+
Display help information.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
docyrus --help
|
|
217
|
+
docyrus login --help
|
|
218
|
+
docyrus generate --help
|
|
219
|
+
docyrus generate db --help
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Auto-Update Notifications
|
|
223
|
+
|
|
224
|
+
The CLI automatically checks for updates and displays a notification when a new version is available:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
┌────────────────────────────────────────────┐
|
|
228
|
+
│ Update available! 0.0.1 → 0.1.0 │
|
|
229
|
+
│ Run npm i -g docyrus to update │
|
|
230
|
+
└────────────────────────────────────────────┘
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Environment Variables
|
|
234
|
+
|
|
235
|
+
| Variable | Description |
|
|
236
|
+
|----------|-------------|
|
|
237
|
+
| `DOCYRUS_API_URL` | Override the API base URL |
|
|
238
|
+
| `DOCYRUS_OAUTH_CLIENT_ID` | Override the OAuth2 client ID |
|
|
239
|
+
| `DEBUG` | Enable debug output |
|
|
240
|
+
|
|
241
|
+
## Token Storage
|
|
242
|
+
|
|
243
|
+
Credentials are securely stored using:
|
|
244
|
+
- **macOS/Linux**: System keychain (via `keytar`)
|
|
245
|
+
- **Fallback**: Encrypted file in `~/.docyrus/`
|
|
246
|
+
|
|
247
|
+
## License
|
|
248
|
+
|
|
249
|
+
MIT
|