@axiomify/cli 4.0.0 → 5.0.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.
Files changed (4) hide show
  1. package/README.md +56 -52
  2. package/dist/index.js +3199 -59
  3. package/dist/index.mjs +3198 -59
  4. package/package.json +5 -2
package/README.md CHANGED
@@ -1,85 +1,89 @@
1
1
  # @axiomify/cli
2
2
 
3
- The official Command Line Interface for the Axiomify framework.
3
+ The Axiomify command-line interface scaffold projects, run the dev server, and inspect routes.
4
4
 
5
- `@axiomify/cli` provides a lightning-fast development experience, production-ready build steps, and powerful inspection tools for your Axiomify applications.
6
-
7
- ## 📦 Installation
8
-
9
- We recommend installing the CLI locally as a development dependency in your project so your CI/CD pipelines can utilize it:
10
-
11
- ```bash
12
- npm install @axiomify/cli -D
13
- ````
14
-
15
- You can also install it globally if you want to use the `init` command anywhere on your machine:
5
+ ## Install
16
6
 
17
7
  ```bash
18
8
  npm install -g @axiomify/cli
9
+ # or use without installing:
10
+ npx @axiomify/cli init my-api
19
11
  ```
20
12
 
21
- ## 🛠️ Commands
22
-
23
- | Command | Description |
24
- | :--- | :--- |
25
- | `axiomify init` | Scaffolds a new, production-ready Axiomify project. |
26
- | `axiomify dev <entry>` | Starts the development server with hot-module reloading (HMR). |
27
- | `axiomify build <entry>` | Compiles your TypeScript application for production. |
28
- | `axiomify routes <entry>`| Inspects your app and prints a visual table of all registered routes. |
13
+ ## Commands
29
14
 
30
- ## 🚀 Usage Guide
15
+ ### `axiomify init <name>`
31
16
 
32
- ### 1\. Project Scaffolding
33
-
34
- Quickly generate a new project with all the necessary TypeScript configurations and adapter boilerplates:
17
+ Scaffolds a new Axiomify project with your chosen adapter.
35
18
 
36
19
  ```bash
37
- npx @axiomify/cli init my-new-app
20
+ axiomify init my-api
38
21
  ```
39
22
 
40
- ### 2\. Development Mode
23
+ Prompts:
41
24
 
42
- Run your application locally. The CLI automatically watches your file system and restarts the server when it detects changes.
25
+ 1. **Adapter** Native (uWS, fastest) *(default)*, Fastify, Express, Hapi, or Node HTTP
26
+ 2. **Plugins** — Auth, CORS, Helmet, Rate Limit, Metrics, Logger, OpenAPI (multi-select)
27
+ 3. **Language** — TypeScript *(default)* or JavaScript
43
28
 
44
- ```bash
45
- npx axiomify dev src/index.ts
29
+ Generates:
30
+ ```
31
+ my-api/
32
+ ├── src/
33
+ │ ├── index.ts # Entry point with chosen adapter
34
+ │ ├── routes/ # Example routes
35
+ │ └── plugins/ # Plugin configuration
36
+ ├── package.json
37
+ ├── tsconfig.json
38
+ └── README.md
46
39
  ```
47
40
 
48
- ### 3\. Route Inspector
41
+ ### `axiomify dev`
49
42
 
50
- Having trouble debugging an endpoint? The route inspector parses your Radix tree and prints a clean, color-coded table of every available method, path, and attached schema directly to your terminal.
43
+ Starts the development server with hot-reload powered by esbuild.
51
44
 
52
45
  ```bash
53
- npx axiomify routes src/index.ts
46
+ axiomify dev # watches src/, rebuilds on change
47
+ axiomify dev --port 4000 # custom port
48
+ axiomify dev --debug # verbose logging
54
49
  ```
55
50
 
56
- ### 4\. Production Build
51
+ ### `axiomify build`
57
52
 
58
- Compiles your application into highly optimized JavaScript ready for edge or serverless deployment.
53
+ Compiles the application for production.
59
54
 
60
55
  ```bash
61
- npx axiomify build src/index.ts
56
+ axiomify build # outputs to dist/
57
+ axiomify build --minify # minified output
58
+ axiomify build --sourcemap # include source maps
62
59
  ```
63
60
 
64
- ## 📖 Standard `package.json` Setup
61
+ ### `axiomify routes`
65
62
 
66
- For the best developer experience, map the CLI commands to your project's npm scripts:
63
+ Visualises all registered routes in a table.
67
64
 
68
- ```json
69
- {
70
- "scripts": {
71
- "dev": "axiomify dev src/index.ts",
72
- "build": "axiomify build src/index.ts",
73
- "start": "node dist/index.js",
74
- "routes": "axiomify routes src/index.ts"
75
- }
76
- }
65
+ ```bash
66
+ axiomify routes
67
+
68
+ ┌─────────────────────────────────────┬────────┬───────────────────────────────┐
69
+ Path │ Method │ Plugins │
70
+ ├─────────────────────────────────────┼────────┼───────────────────────────────┤
71
+ │ /users │ GET requireAuth, rateLimiter │
72
+ │ /users │ POST │ requireAuth │
73
+ │ /users/:id │ GET │ requireAuth │
74
+ │ /auth/login │ POST │ loginRateLimit │
75
+ │ /auth/refresh │ POST │ refreshRateLimit │
76
+ │ /health │ GET │ — │
77
+ │ /metrics │ GET │ — │
78
+ └─────────────────────────────────────┴────────┴───────────────────────────────┘
77
79
  ```
78
80
 
79
- ## 📚 Documentation
80
-
81
- For complete documentation, guides, and ecosystem packages, please visit the [Axiomify Master Repository](https://github.com/OTopman/axiomify).
82
-
83
- ## 📄 License
81
+ ## Adapter choices in `axiomify init`
84
82
 
85
- MIT
83
+ | Adapter | Req/s (1 core) | Use case |
84
+ |---|---:|---|
85
+ | **Native (uWS)** | ~50k | Maximum throughput, production APIs |
86
+ | **Fastify** | ~10k | Recommended default — best ecosystem balance |
87
+ | **Express** | ~5k | Legacy migration, Express middleware ecosystem |
88
+ | **Hapi** | ~5k | Enterprise Hapi plugin ecosystem |
89
+ | **Node HTTP** | ~10k | Zero dependencies, edge/serverless |