clever-tools 3.14.0 → 4.0.1
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 +130 -37
- package/bin/clever.js +1427 -718
- package/package.json +61 -77
- package/src/clever-client/auth-bridge.js +9 -12
- package/src/clever-client/ng.js +1 -1
- package/src/clever-client/operators.js +7 -7
- package/src/command-options.js +6 -6
- package/src/command-promise-handler.js +6 -6
- package/src/commands/accesslogs.js +38 -29
- package/src/commands/activity.js +62 -40
- package/src/commands/addon.js +65 -69
- package/src/commands/applications.js +33 -31
- package/src/commands/cancel-deploy.js +7 -7
- package/src/commands/config.js +9 -7
- package/src/commands/console.js +3 -3
- package/src/commands/create.js +32 -31
- package/src/commands/curl.js +14 -36
- package/src/commands/database.js +10 -30
- package/src/commands/delete.js +8 -8
- package/src/commands/deploy.js +60 -46
- package/src/commands/diag.js +27 -25
- package/src/commands/domain.js +89 -91
- package/src/commands/drain.js +26 -14
- package/src/commands/emails.js +24 -28
- package/src/commands/env.js +18 -18
- package/src/commands/features.js +12 -18
- package/src/commands/keycloak.js +11 -11
- package/src/commands/kv.js +13 -13
- package/src/commands/link.js +9 -8
- package/src/commands/login.js +19 -27
- package/src/commands/logout.js +1 -1
- package/src/commands/logs.js +20 -12
- package/src/commands/makeDefault.js +5 -5
- package/src/commands/matomo.js +7 -7
- package/src/commands/metabase.js +9 -9
- package/src/commands/ng.js +32 -32
- package/src/commands/notify-email.js +11 -15
- package/src/commands/open.js +1 -1
- package/src/commands/otoroshi.js +11 -11
- package/src/commands/profile.js +8 -8
- package/src/commands/published-config.js +11 -11
- package/src/commands/restart.js +15 -8
- package/src/commands/scale.js +25 -16
- package/src/commands/service.js +18 -9
- package/src/commands/ssh-keys.js +25 -29
- package/src/commands/ssh.js +1 -2
- package/src/commands/status.js +31 -22
- package/src/commands/stop.js +3 -3
- package/src/commands/tcp-redirs.js +27 -26
- package/src/commands/tokens.js +44 -43
- package/src/commands/unlink.js +7 -5
- package/src/commands/version.js +2 -4
- package/src/commands/webhooks.js +8 -10
- package/src/experimental-features.js +7 -5
- package/src/format-table.js +46 -15
- package/src/initial-setup.js +2 -32
- package/src/initial-update-notifier.js +18 -0
- package/src/lib/has-param.js +16 -0
- package/src/lib/ng-print.js +21 -24
- package/src/lib/operator-commands.js +58 -53
- package/src/lib/prompts.js +5 -5
- package/src/lib/slugify.js +1 -1
- package/src/logger.js +24 -22
- package/src/models/activity.js +3 -3
- package/src/models/addon.js +52 -53
- package/src/models/app_configuration.js +34 -32
- package/src/models/application.js +90 -77
- package/src/models/application_configuration.js +19 -27
- package/src/models/configuration.js +30 -32
- package/src/models/deployments.js +9 -19
- package/src/models/domain.js +10 -9
- package/src/models/drain.js +16 -15
- package/src/models/exit-strategy-option.js +15 -5
- package/src/models/fs-utils.js +4 -3
- package/src/models/git.js +26 -32
- package/src/models/ids-resolver.js +37 -41
- package/src/models/isomorphic-http-with-agent.js +3 -3
- package/src/models/json-array.js +5 -6
- package/src/models/log-v4.js +44 -52
- package/src/models/log.js +40 -45
- package/src/models/namespaces.js +4 -4
- package/src/models/ng-resources.js +49 -39
- package/src/models/ng.js +41 -40
- package/src/models/node-dns-resolver.js +3 -3
- package/src/models/notification.js +7 -10
- package/src/models/operator.js +8 -10
- package/src/models/organisation.js +5 -8
- package/src/models/send-to-api.js +18 -11
- package/src/models/user.js +6 -5
- package/src/models/utils.js +5 -8
- package/src/models/variables.js +18 -20
- package/src/parsers.js +34 -34
- package/src/load-package-json.cjs +0 -5
package/README.md
CHANGED
|
@@ -1,72 +1,165 @@
|
|
|
1
1
|
# Clever Tools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/clever-tools)
|
|
4
|
+
[](https://nodejs.org)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
The official CLI for [Clever Cloud](https://www.clever.cloud) - Deploy and manage your applications, add-ons, and services from the command line with modern tooling and automated workflows. The perfect developer companion, complementing the [Clever Cloud Console](https://console.clever-cloud.com).
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## Quick Start
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
**Prerequisites:** Node.js 22+
|
|
10
11
|
|
|
11
|
-
```
|
|
12
|
+
```bash
|
|
13
|
+
# Install globally
|
|
12
14
|
npm install -g clever-tools
|
|
15
|
+
|
|
16
|
+
# Or use directly without installation
|
|
17
|
+
npx --yes clever-tools@latest version
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**First steps:**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
clever login
|
|
24
|
+
clever profile
|
|
13
25
|
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
## Key Features
|
|
28
|
+
|
|
29
|
+
- **Complete Platform Control**: Manage applications, add-ons, domains, and services from the command line
|
|
30
|
+
- **Real-time Monitoring**: Stream logs, monitor deployments, and check application status
|
|
31
|
+
- **Seamless Deployment**: Deploy directly from your local environment or CI/CD pipelines
|
|
32
|
+
- **Cross-platform**: Available for Linux, macOS, Windows via multiple package managers
|
|
33
|
+
- **API Integration**: Direct access to Clever Cloud's API with authenticated commands
|
|
34
|
+
|
|
35
|
+
## Installation Options
|
|
36
|
+
|
|
37
|
+
For Node.js users, npm is the fastest way. For other installation methods including:
|
|
38
|
+
|
|
39
|
+
- Docker images
|
|
40
|
+
- Binary downloads
|
|
41
|
+
- Native packages (RPM, DEB)
|
|
42
|
+
- Package managers (Homebrew, Winget, AUR)
|
|
16
43
|
|
|
17
|
-
|
|
18
|
-
* [Arch Linux (AUR)](docs/setup-systems.md#arch-linux-aur)
|
|
19
|
-
* [CentOS/Fedora (.rpm)](docs/setup-systems.md#centosfedora-rpm)
|
|
20
|
-
* [Debian/Ubuntu (.deb)](docs/setup-systems.md#debianubuntu-deb)
|
|
21
|
-
* [Exherbo](docs/setup-systems.md#exherbo)
|
|
22
|
-
* [Binary (.tar.gz)](docs/setup-systems.md#other-distributions-targz)
|
|
23
|
-
* [macOS](docs/setup-systems.md#macos)
|
|
24
|
-
* [Homebrew](docs/setup-systems.md#homebrew)
|
|
25
|
-
* [Binary (.tar.gz)](docs/setup-systems.md#binary-zip)
|
|
26
|
-
* [Windows](docs/setup-systems.md#windows)
|
|
27
|
-
* [Chocolatey](docs/setup-systems.md#chocolatey)
|
|
28
|
-
* [Binary (.zip)](docs/setup-systems.md#binary-zip)
|
|
29
|
-
* [Docker](docs/setup-systems.md#docker)
|
|
30
|
-
* [Nix package manager](docs/setup-systems.md#nix-package-manager)
|
|
44
|
+
See our complete [setup guide](docs/setup-systems.md).
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
### Autocompletion
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
Enable smart autocompletion for bash or zsh:
|
|
35
49
|
|
|
36
50
|
```bash
|
|
51
|
+
# Bash
|
|
37
52
|
clever --bash-autocomplete-script $(which clever) | sudo tee /usr/share/bash-completion/completions/clever
|
|
53
|
+
|
|
54
|
+
# Zsh
|
|
55
|
+
clever --zsh-autocomplete-script $(which clever) | sudo tee /usr/share/zsh/site-functions/_clever
|
|
38
56
|
```
|
|
39
57
|
|
|
40
|
-
|
|
58
|
+
## Documentation
|
|
41
59
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
- **[Complete CLI Documentation](https://www.clever-cloud.com/developers/doc/cli/)** - Official user guide
|
|
61
|
+
- **[CLI Reference](https://www.clever-cloud.com/developers/doc/reference/cli/)** - Complete command reference
|
|
62
|
+
- **[Deployment Examples](https://www.clever-cloud.com/developers/guides/)** - Real-world tutorials
|
|
45
63
|
|
|
46
|
-
##
|
|
64
|
+
## Basic Usage
|
|
47
65
|
|
|
48
|
-
|
|
66
|
+
### Authentication
|
|
49
67
|
|
|
50
68
|
```bash
|
|
69
|
+
# Interactive login
|
|
51
70
|
clever login
|
|
71
|
+
|
|
72
|
+
# Non-interactive login
|
|
73
|
+
clever login --token <your-token> --secret <your-secret>
|
|
74
|
+
|
|
75
|
+
# Or use environment variables, idéal for CI/CD
|
|
76
|
+
export CLEVER_TOKEN="your-token"
|
|
77
|
+
export CLEVER_SECRET="your-secret"
|
|
52
78
|
clever profile
|
|
53
79
|
```
|
|
54
80
|
|
|
55
|
-
|
|
81
|
+
### Application Management
|
|
56
82
|
|
|
57
|
-
|
|
83
|
+
```bash
|
|
84
|
+
# List applications
|
|
85
|
+
clever applications list
|
|
58
86
|
|
|
59
|
-
|
|
87
|
+
# Create a new Node.js/Bun application
|
|
88
|
+
clever applications create --type node
|
|
89
|
+
|
|
90
|
+
# Link existing app to the current directory
|
|
91
|
+
clever link <app_id>
|
|
92
|
+
|
|
93
|
+
# Deploy current directory
|
|
94
|
+
clever deploy
|
|
95
|
+
|
|
96
|
+
# Monitor logs
|
|
97
|
+
clever logs --since 1h
|
|
98
|
+
|
|
99
|
+
# Restart an application
|
|
100
|
+
clever restart --app <app_id>
|
|
101
|
+
```
|
|
60
102
|
|
|
61
|
-
|
|
103
|
+
Learn more in our [Application Management Guide](https://www.clever-cloud.com/developers/doc/cli/applications/).
|
|
62
104
|
|
|
63
|
-
|
|
105
|
+
### Add-ons & Services Management
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# List add-ons
|
|
109
|
+
clever addon
|
|
110
|
+
|
|
111
|
+
# Create a PostgreSQL add-on
|
|
112
|
+
clever addon create postgresql-addon myPG
|
|
113
|
+
|
|
114
|
+
# Create a Cellar (S3-compatible storage) add-on
|
|
115
|
+
clever addon create cellar-addon myCellar
|
|
116
|
+
|
|
117
|
+
# Create and manage a Keycloak service
|
|
118
|
+
clever addon create keycloak myKeycloak
|
|
119
|
+
|
|
120
|
+
clever features enable operatos
|
|
121
|
+
clever keycloak get myKetcloak
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Learn more in our [Add-ons & Services Guide](https://www.clever-cloud.com/developers/doc/cli/addons/).
|
|
125
|
+
|
|
126
|
+
# Create and manage
|
|
127
|
+
|
|
128
|
+
### API Access with clever curl and clever tokens
|
|
129
|
+
|
|
130
|
+
Access Clever Cloud's API directly through authenticated commands:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Get your user information
|
|
134
|
+
clever curl https://api.clever-cloud.com/v2/self
|
|
135
|
+
|
|
136
|
+
# Get platform summary
|
|
137
|
+
clever curl https://api.clever-cloud.com/v2/summary
|
|
138
|
+
|
|
139
|
+
# List your applications (with jq for filtering)
|
|
140
|
+
clever curl https://api.clever.cloud/v2/organisations/<ORG_ID>/applications | jq '.[].id'
|
|
141
|
+
|
|
142
|
+
# Create API tokens for external tools
|
|
143
|
+
clever tokens create myTokenName
|
|
144
|
+
clever tokens create myTokenName --expiration 2w --format json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Learn more about API integration in our [API How-to Guide](https://www.clever-cloud.com/developers/api/howto).
|
|
148
|
+
|
|
149
|
+
### Get Help
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
clever help # List all commands
|
|
153
|
+
clever <command> --help # Get specific help
|
|
154
|
+
clever --format json <command> # JSON output for scripting
|
|
155
|
+
```
|
|
64
156
|
|
|
65
|
-
##
|
|
157
|
+
## Support & Contributing
|
|
66
158
|
|
|
67
|
-
|
|
68
|
-
|
|
159
|
+
- **Issues & Questions**: [GitHub Issues](https://github.com/CleverCloud/clever-tools/issues)
|
|
160
|
+
- **Email Support**: [Ticket Center](https://console.clever-cloud.com/ticket-center-choice)
|
|
161
|
+
- **Contributing**: See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines
|
|
69
162
|
|
|
70
163
|
## License
|
|
71
164
|
|
|
72
|
-
This project is licensed under the [Apache-2.0](
|
|
165
|
+
This project is licensed under the [Apache-2.0](LICENSE).
|