Skip to content

Commit 9228102

Browse files
authored
Merge pull request #60 from intercube/feature/on-demand-onboarding
2 parents f2953e4 + 500761b commit 9228102

5 files changed

Lines changed: 634 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
## Intercube CLI
22
This command line interface allows you to connect, manage, and synchronize data from your Intercube cubes (servers).
33

4+
### Onboarding
5+
6+
Use the onboarding command to set up your CLI config interactively:
7+
8+
```bash
9+
intercube onboarding
10+
```
11+
12+
The wizard can help you:
13+
- configure login defaults (`username`, `password`, `scope`, `auth_method`, `instance_url`)
14+
- optionally set sync defaults (`remote_user`, `file_syncing.from_server`, `file_syncing.path`)
15+
- verify local prerequisites such as Boundary CLI and the Intercube sync helper
16+
17+
After onboarding, use:
18+
19+
```bash
20+
intercube login
21+
```
22+
23+
If required settings are missing (or the config file does not exist), the CLI
24+
will prompt only when needed and save values automatically:
25+
- `intercube login` prompts for required login settings
26+
- `intercube sync files ...` prompts for missing sync defaults
27+
- `intercube map` prompts to create mappings when none exist

‎cmd/login.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ var loginCmd = &cobra.Command{
3939
Short: "Login with your API token",
4040
Args: cobra.MaximumNArgs(1),
4141
Run: func(cmd *cobra.Command, args []string) {
42+
if err := ensureLoginConfiguration(); err != nil {
43+
fmt.Printf("Unable to continue login: %v\n", err)
44+
return
45+
}
46+
4247
boundaryUrl := config.Login.InstanceUrl
4348
if boundaryUrl == "" {
4449
boundaryUrl = "https://controller.boundary.intercube.cloud"

‎cmd/map.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ var mapCmd = &cobra.Command{
2626
Use: "map",
2727
Short: "Maps files based on config yaml file",
2828
Run: func(cmd *cobra.Command, args []string) {
29+
if err := ensureMappingsConfiguration(); err != nil {
30+
fmt.Printf("Unable to continue map: %v\n", err)
31+
return
32+
}
33+
2934
for _, mapping := range config.Mappings {
3035
symlink(mapping.From, mapping.To)
3136
}

0 commit comments

Comments
 (0)