@sinch/cli 0.2.0 → 0.2.1-beta.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 (5) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +228 -228
  3. package/bin/sinch +4 -4
  4. package/dist/index.js +34 -34
  5. package/package.json +79 -79
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Sinch
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Sinch
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 CHANGED
@@ -1,228 +1,228 @@
1
- # Sinch CLI
2
-
3
- > **Official command-line interface for Sinch - Manage Functions, Voice, SMS, and more from your terminal**
4
-
5
- [![npm version](https://img.shields.io/npm/v/@sinch/sinch-cli.svg)](https://www.npmjs.com/package/@sinch/sinch-cli)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
-
8
- ## Overview
9
-
10
- The Sinch CLI is your unified developer tool for managing all Sinch products. Currently featuring full support for **Sinch Functions** - create, test, and deploy serverless voice applications. More Sinch products coming soon!
11
-
12
- ## Installation
13
-
14
- ```bash
15
- # Latest stable release (production)
16
- npm install -g @sinch/cli
17
-
18
- # Beta releases (pre-release testing)
19
- npm install -g @sinch/cli@beta
20
-
21
- # Dev channel (bleeding edge - latest from main branch)
22
- npm install -g @sinch/cli@dev
23
- ```
24
-
25
- **Installation Channels:**
26
-
27
- - **`@latest`** (default) - Production-ready stable releases
28
- - **`@beta`** - Pre-release versions for testing new features
29
- - **`@dev`** - Cutting-edge builds from main branch (auto-published on every commit)
30
-
31
- ## Prerequisites
32
-
33
- - **Node.js**: 20.0.0 or higher (Node 20 LTS or Node 22 LTS recommended)
34
- - **npm**: 9.0.0 or higher
35
- - **OS**: Windows 10+, macOS 10.15+, or Ubuntu 20.04+
36
-
37
- ## Quick Start
38
-
39
- ### 1. Authenticate with Sinch
40
-
41
- ```bash
42
- sinch auth login
43
- ```
44
-
45
- ### 2. Create a new function
46
-
47
- ```bash
48
- # Interactive mode - choose from templates
49
- sinch functions init
50
-
51
- # Or specify a template directly
52
- # package | function | command | template
53
- sinch functions init simple-voice-ivr
54
- ```
55
-
56
- ### 3. Test locally
57
-
58
- ```bash
59
- cd my-voice-app
60
- sinch functions dev
61
-
62
- # With runtime tunnel for webhooks
63
- sinch functions dev
64
- ```
65
-
66
- ### 4. Deploy to production
67
-
68
- ```bash
69
- sinch functions deploy
70
- ```
71
-
72
- ### 5. Monitor your function
73
-
74
- ```bash
75
- # List all functions
76
- sinch functions list
77
-
78
- # Stream logs
79
- sinch functions logs <function-id> --follow
80
-
81
- # Check status
82
- sinch functions status <function-id>
83
- ```
84
-
85
- ## Available Commands
86
-
87
- | Command | Description |
88
- | -------------------------------------- | --------------------------------- |
89
- | `sinch auth login` | Authenticate with Sinch platform |
90
- | `sinch functions init` | Create new function from template |
91
- | `sinch functions dev` | Start local development server |
92
- | `sinch functions deploy` | Deploy function to production |
93
- | `sinch functions list` | List all deployed functions |
94
- | `sinch functions logs` | Stream function logs |
95
- | `sinch functions delete` | Delete a deployed function |
96
- | `sinch sip trunks list` | List SIP trunks |
97
- | `sinch sip trunks create` | Create a new SIP trunk |
98
- | `sinch sip endpoints list <trunkId>` | List endpoints for a trunk |
99
- | `sinch sip endpoints create <trunkId>` | Create a SIP endpoint |
100
- | `sinch secrets add` | Store secrets securely |
101
- | `sinch templates list` | Browse available templates |
102
- | `sinch help` | Show help for any command |
103
-
104
- ## Templates
105
-
106
- Create functions from pre-built templates:
107
-
108
- ### Voice Templates
109
-
110
- - `node/simple-voice-ivr` - Interactive voice menu system
111
- - `node/call-forwarding` - Intelligent call routing
112
- - `node/number-masking` - Privacy-preserving calls
113
- - `node/conference-call` - Multi-party conferences
114
- - `node/voicemail` - Complete voicemail system
115
-
116
- ### More Languages
117
-
118
- - `csharp/simple-voice-ivr` - IVR in C#/.NET
119
- - `java/simple-voice-ivr` - Q4 2025
120
-
121
- ## Features
122
-
123
- ### 🔐 Secure Secrets Management
124
-
125
- Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
126
-
127
- ```bash
128
- # Add a secret
129
- sinch secrets add STRIPE_KEY sk_test_123456
130
-
131
- # List secrets
132
- sinch secrets list
133
-
134
- # Use in your function
135
- const stripeKey = process.env.STRIPE_KEY;
136
- ```
137
-
138
- ### 🔄 Hot Reload Development
139
-
140
- Changes to your function are automatically reloaded:
141
-
142
- ```bash
143
- sinch functions dev --watch
144
- ```
145
-
146
- ### 🐛 VS Code Debugging
147
-
148
- All templates include VS Code launch configs. Just press F5 to debug!
149
-
150
- ### 🌐 Tunnel Support
151
-
152
- Test webhooks locally with runtime-integrated tunneling:
153
-
154
- ```bash
155
- sinch functions dev
156
- # Choose tunnel preference when prompted
157
- # Tunnel runs inside your function runtime
158
- ```
159
-
160
- ### 📞 Elastic SIP Trunking
161
-
162
- Manage SIP trunks and endpoints for voice connectivity:
163
-
164
- ```bash
165
- # List your SIP trunks
166
- sinch sip trunks list
167
-
168
- # Create a new trunk (interactive)
169
- sinch sip trunks create
170
-
171
- # Add an endpoint to a trunk
172
- sinch sip endpoints create <trunk-id>
173
-
174
- # Get JSON output for scripting
175
- sinch sip trunks list --json
176
- ```
177
-
178
- ## Documentation
179
-
180
- - **Full Documentation**: [/docs/README.md](./docs/README.md)
181
- - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
182
- - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
183
- - **Examples**: [/docs/examples/](./docs/examples/)
184
-
185
- ## Resources
186
-
187
- - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
188
- - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
189
- - **Templates Gallery**: Browse available templates with `sinch templates list`
190
-
191
- ## Troubleshooting
192
-
193
- ### Authentication Issues
194
-
195
- ```bash
196
- # Check authentication status
197
- sinch auth status
198
-
199
- # Re-authenticate if needed
200
- sinch auth logout
201
- sinch auth login
202
- ```
203
-
204
- ### Debug Mode
205
-
206
- ```bash
207
- # Enable debug output
208
- DEBUG=1 sinch functions dev
209
-
210
- # HTTP request debugging
211
- DEBUG_HTTP=1 sinch functions deploy
212
- ```
213
-
214
- ### Common Issues
215
-
216
- - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
217
- - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
218
- - **Deployment failed**: Verify your function configuration and project access
219
-
220
- ## Support
221
-
222
- - **Documentation**: [Full CLI Documentation](./docs/README.md)
223
- - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
224
- - **Email**: support@sinch.com
225
-
226
- ## License
227
-
228
- MIT License - Copyright © 2025 Sinch
1
+ # Sinch CLI
2
+
3
+ > **Official command-line interface for Sinch - Manage Functions, Voice, SMS, and more from your terminal**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@sinch/sinch-cli.svg)](https://www.npmjs.com/package/@sinch/sinch-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Overview
9
+
10
+ The Sinch CLI is your unified developer tool for managing all Sinch products. Currently featuring full support for **Sinch Functions** - create, test, and deploy serverless voice applications. More Sinch products coming soon!
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ # Latest stable release (production)
16
+ npm install -g @sinch/cli
17
+
18
+ # Beta releases (pre-release testing)
19
+ npm install -g @sinch/cli@beta
20
+
21
+ # Dev channel (bleeding edge - latest from main branch)
22
+ npm install -g @sinch/cli@dev
23
+ ```
24
+
25
+ **Installation Channels:**
26
+
27
+ - **`@latest`** (default) - Production-ready stable releases
28
+ - **`@beta`** - Pre-release versions for testing new features
29
+ - **`@dev`** - Cutting-edge builds from main branch (auto-published on every commit)
30
+
31
+ ## Prerequisites
32
+
33
+ - **Node.js**: 20.0.0 or higher (Node 20 LTS or Node 22 LTS recommended)
34
+ - **npm**: 9.0.0 or higher
35
+ - **OS**: Windows 10+, macOS 10.15+, or Ubuntu 20.04+
36
+
37
+ ## Quick Start
38
+
39
+ ### 1. Authenticate with Sinch
40
+
41
+ ```bash
42
+ sinch auth login
43
+ ```
44
+
45
+ ### 2. Create a new function
46
+
47
+ ```bash
48
+ # Interactive mode - choose from templates
49
+ sinch functions init
50
+
51
+ # Or specify a template directly
52
+ # package | function | command | template
53
+ sinch functions init simple-voice-ivr
54
+ ```
55
+
56
+ ### 3. Test locally
57
+
58
+ ```bash
59
+ cd my-voice-app
60
+ sinch functions dev
61
+
62
+ # With runtime tunnel for webhooks
63
+ sinch functions dev
64
+ ```
65
+
66
+ ### 4. Deploy to production
67
+
68
+ ```bash
69
+ sinch functions deploy
70
+ ```
71
+
72
+ ### 5. Monitor your function
73
+
74
+ ```bash
75
+ # List all functions
76
+ sinch functions list
77
+
78
+ # Stream logs
79
+ sinch functions logs <function-id> --follow
80
+
81
+ # Check status
82
+ sinch functions status <function-id>
83
+ ```
84
+
85
+ ## Available Commands
86
+
87
+ | Command | Description |
88
+ | -------------------------------------- | --------------------------------- |
89
+ | `sinch auth login` | Authenticate with Sinch platform |
90
+ | `sinch functions init` | Create new function from template |
91
+ | `sinch functions dev` | Start local development server |
92
+ | `sinch functions deploy` | Deploy function to production |
93
+ | `sinch functions list` | List all deployed functions |
94
+ | `sinch functions logs` | Stream function logs |
95
+ | `sinch functions delete` | Delete a deployed function |
96
+ | `sinch sip trunks list` | List SIP trunks |
97
+ | `sinch sip trunks create` | Create a new SIP trunk |
98
+ | `sinch sip endpoints list <trunkId>` | List endpoints for a trunk |
99
+ | `sinch sip endpoints create <trunkId>` | Create a SIP endpoint |
100
+ | `sinch secrets add` | Store secrets securely |
101
+ | `sinch templates list` | Browse available templates |
102
+ | `sinch help` | Show help for any command |
103
+
104
+ ## Templates
105
+
106
+ Create functions from pre-built templates:
107
+
108
+ ### Voice Templates
109
+
110
+ - `node/simple-voice-ivr` - Interactive voice menu system
111
+ - `node/call-forwarding` - Intelligent call routing
112
+ - `node/number-masking` - Privacy-preserving calls
113
+ - `node/conference-call` - Multi-party conferences
114
+ - `node/voicemail` - Complete voicemail system
115
+
116
+ ### More Languages
117
+
118
+ - `csharp/simple-voice-ivr` - IVR in C#/.NET
119
+ - `java/simple-voice-ivr` - Q4 2025
120
+
121
+ ## Features
122
+
123
+ ### 🔐 Secure Secrets Management
124
+
125
+ Secrets are stored in your OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service):
126
+
127
+ ```bash
128
+ # Add a secret
129
+ sinch secrets add STRIPE_KEY sk_test_123456
130
+
131
+ # List secrets
132
+ sinch secrets list
133
+
134
+ # Use in your function
135
+ const stripeKey = process.env.STRIPE_KEY;
136
+ ```
137
+
138
+ ### 🔄 Hot Reload Development
139
+
140
+ Changes to your function are automatically reloaded:
141
+
142
+ ```bash
143
+ sinch functions dev --watch
144
+ ```
145
+
146
+ ### 🐛 VS Code Debugging
147
+
148
+ All templates include VS Code launch configs. Just press F5 to debug!
149
+
150
+ ### 🌐 Tunnel Support
151
+
152
+ Test webhooks locally with runtime-integrated tunneling:
153
+
154
+ ```bash
155
+ sinch functions dev
156
+ # Choose tunnel preference when prompted
157
+ # Tunnel runs inside your function runtime
158
+ ```
159
+
160
+ ### 📞 Elastic SIP Trunking
161
+
162
+ Manage SIP trunks and endpoints for voice connectivity:
163
+
164
+ ```bash
165
+ # List your SIP trunks
166
+ sinch sip trunks list
167
+
168
+ # Create a new trunk (interactive)
169
+ sinch sip trunks create
170
+
171
+ # Add an endpoint to a trunk
172
+ sinch sip endpoints create <trunk-id>
173
+
174
+ # Get JSON output for scripting
175
+ sinch sip trunks list --json
176
+ ```
177
+
178
+ ## Documentation
179
+
180
+ - **Full Documentation**: [/docs/README.md](./docs/README.md)
181
+ - **Command Reference**: [/docs/COMMANDS.md](./docs/COMMANDS.md)
182
+ - **Development Guide**: [/docs/DEVELOPMENT.md](./docs/DEVELOPMENT.md)
183
+ - **Examples**: [/docs/examples/](./docs/examples/)
184
+
185
+ ## Resources
186
+
187
+ - **Sinch Voice API**: https://www.sinch.com/products/apis/voice/
188
+ - **Documentation**: Full CLI reference in [/docs](./docs/README.md)
189
+ - **Templates Gallery**: Browse available templates with `sinch templates list`
190
+
191
+ ## Troubleshooting
192
+
193
+ ### Authentication Issues
194
+
195
+ ```bash
196
+ # Check authentication status
197
+ sinch auth status
198
+
199
+ # Re-authenticate if needed
200
+ sinch auth logout
201
+ sinch auth login
202
+ ```
203
+
204
+ ### Debug Mode
205
+
206
+ ```bash
207
+ # Enable debug output
208
+ DEBUG=1 sinch functions dev
209
+
210
+ # HTTP request debugging
211
+ DEBUG_HTTP=1 sinch functions deploy
212
+ ```
213
+
214
+ ### Common Issues
215
+
216
+ - **Command not found**: Reinstall globally with `npm install -g @sinch/sinch-cli@beta`
217
+ - **Authentication failed**: Check your Sinch API credentials with `sinch auth status`
218
+ - **Deployment failed**: Verify your function configuration and project access
219
+
220
+ ## Support
221
+
222
+ - **Documentation**: [Full CLI Documentation](./docs/README.md)
223
+ - **Issues**: [Report a Bug](https://gitlab.com/sinch/sinch-projects/voice/functions/sinch-cli/-/issues)
224
+ - **Email**: support@sinch.com
225
+
226
+ ## License
227
+
228
+ MIT License - Copyright © 2025 Sinch
package/bin/sinch CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
2
-
3
- // Use compiled TypeScript output
4
- require('../dist/index.js');
1
+ #!/usr/bin/env node
2
+
3
+ // Use compiled TypeScript output
4
+ require('../dist/index.js');